aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/20031102-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/20031102-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031102-1.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031102-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031102-1.c
new file mode 100644
index 000000000..2148381a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031102-1.c
@@ -0,0 +1,37 @@
+/* PR optimization/12799 */
+/* Origin: Pratap Subrahmanyam <pratap@vmware.com> */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -march=i686" { target { { i686-*-* x86_64-*-* } && ia32 } } } */
+
+/* Verify that reload_cse_move2add doesn't add unexpected CLOBBERs. */
+
+extern void abort(void);
+
+int loo = 1;
+
+__inline__ char InlineFunc(void)
+{
+ return __builtin_expect(!!(loo == 1), 1);
+}
+
+int FooBar(void)
+{
+ int i;
+ int var1 = InlineFunc() ? 2046 : 1023;
+ int var2 = InlineFunc() ? 512 : 1024;
+
+ for (i = 0; i < var1; i++)
+ ;
+
+ if (InlineFunc() && var2 != 512)
+ abort();
+
+ return 0;
+}
+
+int main(void)
+{
+ return FooBar();
+}