aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/i386/indjmp-1.c23
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b0f902a..fb9e00b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2014-06-23 Kai Tietz <ktietz@redhat.com>
+
+ * gcc.target/i386/indjmp-1.c: New test.
+
2014-06-23 Andrew Pinski <apinski@cavium.com>
* gcc.c-torture/compile/20140723-1.c: New testcase.
diff --git a/gcc/testsuite/gcc.target/i386/indjmp-1.c b/gcc/testsuite/gcc.target/i386/indjmp-1.c
new file mode 100644
index 0000000..bbcb243
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/indjmp-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2" } */
+
+#define ADVANCE_AND_DISPATCH() goto *addresses[*pc++]
+
+void
+Interpret(const unsigned char *pc)
+{
+ static const void *const addresses[] = {
+ &&l0, &&l1, &&l2
+ };
+
+l0:
+ ADVANCE_AND_DISPATCH();
+
+l1:
+ ADVANCE_AND_DISPATCH();
+
+l2:
+ return;
+}
+
+/* { dg-final { scan-assembler-not "jmp\[ \t\]*.%eax" } } */