summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr46216.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr46216.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr46216.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr46216.c b/gcc/testsuite/gcc.dg/torture/pr46216.c
new file mode 100644
index 000000000..b257dbf2c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr46216.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+typedef int Embryo_Cell;
+int
+embryo_program_run(Embryo_Cell *cip)
+{
+ unsigned char op;
+ Embryo_Cell offs;
+ static const void *switchtable[256] = {
+ &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_LOAD_PRI
+ };
+ for (;;)
+ {
+ op = *cip++;
+ while (1) {
+ goto *switchtable[op];
+SWITCHTABLE_EMBRYO_OP_LOAD_PRI:
+ offs = *(Embryo_Cell *)cip++;
+SWITCHTABLE_EMBRYO_OP_NONE:
+ break;
+ };
+ }
+ return offs;
+}