OSDN Git Service

2007-07-04 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 Jul 2007 12:39:42 +0000 (12:39 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 Jul 2007 12:39:42 +0000 (12:39 +0000)
PR tree-optimization/32500
* gcc.c-torture/execute/pr32500.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126316 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr32500.c [new file with mode: 0644]

index a0c0745..261286e 100644 (file)
@@ -1,5 +1,10 @@
 2007-07-04  Richard Guenther  <rguenther@suse.de>
 
+       PR tree-optimization/32500
+       * gcc.c-torture/execute/pr32500.c: New testcase.
+
+2007-07-04  Richard Guenther  <rguenther@suse.de>
+
        PR tree-optimization/32482
        * gcc.c-torture/compile/pr32482.c: New testcase.
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr32500.c b/gcc/testsuite/gcc.c-torture/execute/pr32500.c
new file mode 100644 (file)
index 0000000..dae06ea
--- /dev/null
@@ -0,0 +1,26 @@
+extern void abort(void);
+extern void exit(int);
+void foo(int) __attribute__((noinline));
+void bar(void) __attribute__((noinline));
+
+/* Make sure foo is not inlined or considered pure/const.  */
+int x;
+void foo(int i) { x = i; }
+void bar(void) { exit(0); }
+
+int
+main(int argc, char *argv[])
+{
+       int i;
+       int numbers[4] = { 0xdead, 0xbeef, 0x1337, 0x4242 };
+
+       for (i = 1; i <= 12; i++) {
+               if (i <= 4)
+                       foo(numbers[i]);
+               else if (i >= 7 && i <= 9)
+                       bar();
+       }
+
+       abort();
+}
+