aboutsummaryrefslogtreecommitdiff
path: root/gcc/cil/tests/switch.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cil/tests/switch.c')
-rw-r--r--gcc/cil/tests/switch.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/cil/tests/switch.c b/gcc/cil/tests/switch.c
new file mode 100644
index 00000000000..5193ff8c70a
--- /dev/null
+++ b/gcc/cil/tests/switch.c
@@ -0,0 +1,25 @@
+/*
+ * This example tests C switches.
+ */
+
+int main(int argc, char** argv)
+{
+ switch (argc + 1) {
+ case -3:
+ case -2:
+ return -1;
+ case 0:
+ return -2;
+ case 2: /* expected case */
+ return 0;
+ case 3:
+ return 7;
+ case 4:
+ case 6:
+ case 7:
+ case 8:
+ return 1;
+ default:
+ return 13;
+ }
+}