aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20020418-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20020418-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20020418-1.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20020418-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20020418-1.c
new file mode 100644
index 000000000..4826ca886
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20020418-1.c
@@ -0,0 +1,24 @@
+/* ifcvt accidentally deletes a referenced label while generating
+ conditional traps on machines having such patterns */
+
+struct foo { int a; };
+
+void gcc_crash(struct foo *p)
+{
+ if (__builtin_expect(p->a < 52, 0))
+ __builtin_trap();
+ top:
+ p->a++;
+ if (p->a >= 62)
+ goto top;
+}
+
+int main(void)
+{
+ struct foo x;
+
+ x.a = 53;
+ gcc_crash(&x);
+
+ exit (0);
+}