* gcc.target/i386/indjmp-1.c: New test.
authorKai Tietz <ktietz@redhat.com>
Mon, 23 Jun 2014 21:50:48 +0000 (23:50 +0200)
committerKai Tietz <ktietz@gcc.gnu.org>
Mon, 23 Jun 2014 21:50:48 +0000 (23:50 +0200)
From-SVN: r211918

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/indjmp-1.c [new file with mode: 0644]

index b0f902a..fb9e00b 100644 (file)
@@ -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 (file)
index 0000000..bbcb243
--- /dev/null
@@ -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" } } */