1178476Sjb/*
2178476Sjb * CDDL HEADER START
3178476Sjb *
4178476Sjb * The contents of this file are subject to the terms of the
5178476Sjb * Common Development and Distribution License (the "License").
6178476Sjb * You may not use this file except in compliance with the License.
7178476Sjb *
8178476Sjb * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9178476Sjb * or http://www.opensolaris.org/os/licensing.
10178476Sjb * See the License for the specific language governing permissions
11178476Sjb * and limitations under the License.
12178476Sjb *
13178476Sjb * When distributing Covered Code, include this CDDL HEADER in each
14178476Sjb * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15178476Sjb * If applicable, add the following below this CDDL HEADER, with the
16178476Sjb * fields enclosed by brackets "[]" replaced with your own identifying
17178476Sjb * information: Portions Copyright [yyyy] [name of copyright owner]
18178476Sjb *
19178476Sjb * CDDL HEADER END
20178476Sjb */
21178476Sjb
22178476Sjb/*
23178476Sjb * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24178476Sjb * Use is subject to license terms.
25178476Sjb */
26178476Sjb
27178476Sjb#pragma	ident	"%Z%%M%	%I%	%E% SMI"
28178476Sjb
29178476Sjb/*
30178476Sjb * ASSERTION:
31178476Sjb * 	Complex operations and if,then test.
32178476Sjb *	Call 'n' permutation and combination of operations over if,then.
33178476Sjb *	Match expected output in tst.complex.d.out
34178476Sjb *
35178476Sjb * SECTION: Program Structure/Predicates
36178476Sjb *
37178476Sjb */
38178476Sjb
39178476Sjb#pragma D option quiet
40178476Sjb
41178476SjbBEGIN
42178476Sjb{
43178476Sjb	i = 0;
44178476Sjb	j = 0;
45178476Sjb}
46178476Sjb
47178476Sjbtick-10ms
48178476Sjb/i < 10/
49178476Sjb{
50178476Sjb	i++;
51178476Sjb	j++;
52178476Sjb	printf("\n\n%d\n------\n", i);
53178476Sjb}
54178476Sjb
55178476Sjbtick-10ms
56178476Sjb/i == 5 || i == 10/
57178476Sjb{
58178476Sjb	printf("i == 5 (or) i == 10\n");
59178476Sjb}
60178476Sjb
61178476Sjbtick-10ms
62178476Sjb/i <= 5/
63178476Sjb{
64178476Sjb	printf("i <= 5\n");
65178476Sjb}
66178476Sjb
67178476Sjbtick-10ms
68178476Sjb/j >= 5/
69178476Sjb{
70178476Sjb	printf("j >= 5\n");
71178476Sjb}
72178476Sjb
73178476Sjbtick-10ms
74178476Sjb/j >= 5 || i <= 5/
75178476Sjb{
76178476Sjb	printf("i >= 5 || j >= 5\n");
77178476Sjb}
78178476Sjb
79178476Sjbtick-10ms
80178476Sjb/j >= 5 && i <= 5/
81178476Sjb{
82178476Sjb	printf("j >= 5 && i <= 55\n");
83178476Sjb}
84178476Sjb
85178476Sjbtick-10ms
86178476Sjb/i < 5/
87178476Sjb{
88178476Sjb	printf("i < 5\n");
89178476Sjb}
90178476Sjb
91178476Sjbtick-10ms
92178476Sjb/i == 2 || j == 2/
93178476Sjb{
94178476Sjb	printf("i == 2 (or) j == 2\n");
95178476Sjb}
96178476Sjb
97178476Sjbtick-10ms
98178476Sjb/i == 2 && j == 2/
99178476Sjb{
100178476Sjb	printf("i == 2 (and) j == 2\n");
101178476Sjb}
102178476Sjb
103178476Sjbtick-10ms
104178476Sjb/j != 10/
105178476Sjb{
106178476Sjb	printf("j != 10\n");
107178476Sjb}
108178476Sjb
109178476Sjbtick-10ms
110178476Sjb/j == 5 || i == 2/
111178476Sjb{
112178476Sjb	printf("j == 5 || i == 2\n");
113178476Sjb}
114178476Sjb
115178476Sjbtick-10ms
116178476Sjb/j == 5 && i == 2/
117178476Sjb{
118178476Sjb	printf("j == 5 && i == 2\n");
119178476Sjb}
120178476Sjb
121178476Sjbtick-10ms
122178476Sjb/i == 10/
123178476Sjb{
124178476Sjb	printf("i == 10\n");
125178476Sjb	exit(0);
126178476Sjb}
127