aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim/cgoto01.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-22 16:37:07 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-22 17:07:53 +0100
commit80777740bcb17ee8aacb78ebd2dd9c0f84945474 (patch)
treef1aa85a3f459b54578135a128e63cbd6869168b5 /validation/optim/cgoto01.c
parentb59dbdaf37400cc57e21f8b4bc72a8092d0a2332 (diff)
parent45e0e859a9cf2d14546dd5597a777926087928f0 (diff)
downloadsparse-dev-80777740bcb17ee8aacb78ebd2dd9c0f84945474.tar.gz
Merge branch 'optim-cgoto' into next
* simplification of computed gotos with 1 or 2 targets
Diffstat (limited to 'validation/optim/cgoto01.c')
-rw-r--r--validation/optim/cgoto01.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/validation/optim/cgoto01.c b/validation/optim/cgoto01.c
new file mode 100644
index 00000000..94b2c2c4
--- /dev/null
+++ b/validation/optim/cgoto01.c
@@ -0,0 +1,24 @@
+void abort(void) __attribute__((__noreturn__));
+
+int foo(int a)
+{
+ void *label;
+
+ if (a == a)
+ label = &&L1;
+ else
+ label = &&L2;
+ goto *label;
+L1: return 0;
+L2: abort();
+}
+
+/*
+ * check-name: cgoto01
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-ignore
+ * check-output-excludes: set\\.
+ * check-output-excludes: jmp
+ * check-output-excludes: call
+ */