summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/20031010-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/20031010-1.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20031010-1.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20031010-1.c b/gcc/testsuite/gcc.c-torture/execute/20031010-1.c
new file mode 100644
index 000000000..54457f964
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20031010-1.c
@@ -0,0 +1,34 @@
+/* A reminder to process ops in generate_expr_as_of_bb exactly once. */
+
+long __attribute__((noinline))
+foo (long ct, long cf, _Bool p1, _Bool p2, _Bool p3)
+{
+ long diff;
+
+ diff = ct - cf;
+
+ if (p1)
+ {
+ if (p2)
+ {
+ if (p3)
+ {
+ long tmp = ct;
+ ct = cf;
+ cf = tmp;
+ }
+ diff = ct - cf;
+ }
+
+ return diff;
+ }
+
+ abort ();
+}
+
+int main ()
+{
+ if (foo(2, 3, 1, 1, 1) == 0)
+ abort ();
+ return 0;
+}