tst.complex.d revision 178476
122375Spst/*
222375Spst * CDDL HEADER START
350476Speter *
422375Spst * The contents of this file are subject to the terms of the
522375Spst * Common Development and Distribution License (the "License").
622375Spst * You may not use this file except in compliance with the License.
7195767Skensmith *
822375Spst * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
922375Spst * or http://www.opensolaris.org/os/licensing.
1022375Spst * See the License for the specific language governing permissions
11202196Sed * and limitations under the License.
1222375Spst *
1322375Spst * When distributing Covered Code, include this CDDL HEADER in each
1422375Spst * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1522375Spst * If applicable, add the following below this CDDL HEADER, with the
1622375Spst * fields enclosed by brackets "[]" replaced with your own identifying
1722375Spst * information: Portions Copyright [yyyy] [name of copyright owner]
18202196Sed *
1960572Skris * CDDL HEADER END
2055955Srgrimes */
2122375Spst
2222375Spst/*
2329971Sache * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2422375Spst * Use is subject to license terms.
2581062Smarkm */
2681062Smarkm
2779473Smarkm#pragma	ident	"%Z%%M%	%I%	%E% SMI"
28201381Sed
29201381Sed/*
30145413Strhodes * ASSERTION:
31125503Sru * 	Complex operations and if,then test.
3240202Speter *	Call 'n' permutation and combination of operations over if,then.
3374870Sru *	Match expected output in tst.complex.d.out
3422375Spst *
3579473Smarkm * SECTION: Program Structure/Predicates
3679473Smarkm *
3722375Spst */
38
39#pragma D option quiet
40
41BEGIN
42{
43	i = 0;
44	j = 0;
45}
46
47tick-10ms
48/i < 10/
49{
50	i++;
51	j++;
52	printf("\n\n%d\n------\n", i);
53}
54
55tick-10ms
56/i == 5 || i == 10/
57{
58	printf("i == 5 (or) i == 10\n");
59}
60
61tick-10ms
62/i <= 5/
63{
64	printf("i <= 5\n");
65}
66
67tick-10ms
68/j >= 5/
69{
70	printf("j >= 5\n");
71}
72
73tick-10ms
74/j >= 5 || i <= 5/
75{
76	printf("i >= 5 || j >= 5\n");
77}
78
79tick-10ms
80/j >= 5 && i <= 5/
81{
82	printf("j >= 5 && i <= 55\n");
83}
84
85tick-10ms
86/i < 5/
87{
88	printf("i < 5\n");
89}
90
91tick-10ms
92/i == 2 || j == 2/
93{
94	printf("i == 2 (or) j == 2\n");
95}
96
97tick-10ms
98/i == 2 && j == 2/
99{
100	printf("i == 2 (and) j == 2\n");
101}
102
103tick-10ms
104/j != 10/
105{
106	printf("j != 10\n");
107}
108
109tick-10ms
110/j == 5 || i == 2/
111{
112	printf("j == 5 || i == 2\n");
113}
114
115tick-10ms
116/j == 5 && i == 2/
117{
118	printf("j == 5 && i == 2\n");
119}
120
121tick-10ms
122/i == 10/
123{
124	printf("i == 10\n");
125	exit(0);
126}
127