aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/external/c-testsuite/tests/single-exec/00033.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/external/c-testsuite/tests/single-exec/00033.c')
-rw-r--r--test/external/c-testsuite/tests/single-exec/00033.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/external/c-testsuite/tests/single-exec/00033.c b/test/external/c-testsuite/tests/single-exec/00033.c
new file mode 100644
index 0000000..cfc26f6
--- /dev/null
+++ b/test/external/c-testsuite/tests/single-exec/00033.c
@@ -0,0 +1,45 @@
+int g;
+
+int
+effect()
+{
+ g = 1;
+ return 1;
+}
+
+int
+main()
+{
+ int x;
+
+ g = 0;
+ x = 0;
+ if(x && effect())
+ return 1;
+ if(g)
+ return 2;
+ x = 1;
+ if(x && effect()) {
+ if(g != 1)
+ return 3;
+ } else {
+ return 4;
+ }
+ g = 0;
+ x = 1;
+ if(x || effect()) {
+ if(g)
+ return 5;
+ } else {
+ return 6;
+ }
+ x = 0;
+ if(x || effect()) {
+ if(g != 1)
+ return 7;
+ } else {
+ return 8;
+ }
+ return 0;
+}
+