aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr65244-1.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-pr65244-1.c b/gcc/testsuite/gcc.dg/uninit-pr65244-1.c
new file mode 100644
index 0000000..7c1d910
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-pr65244-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+extern void __attribute__((noreturn)) abort (void);
+
+int foo (int flag, int val)
+{
+ int tem;
+ if (flag)
+ {
+ if (val == 0)
+ abort ();
+ tem = val;
+ }
+ /* large - prevent jump threading */
+ __asm__ volatile ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
+ if (flag)
+ return tem; /* { dg-bogus "uninitialized" } */
+ return 0;
+}