aboutsummaryrefslogtreecommitdiff
path: root/tests/switch.qbe
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-11 18:43:18 -0800
committerMichael Forney <mforney@mforney.org>2019-02-12 01:55:14 -0800
commiteddc4693e49f70cd214b7645cb9fce54a89fbb6c (patch)
treefa1b640f49cde25e323aa0629aed64c064da930e /tests/switch.qbe
Initial import
Diffstat (limited to 'tests/switch.qbe')
-rw-r--r--tests/switch.qbe62
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/switch.qbe b/tests/switch.qbe
new file mode 100644
index 0000000..73320a0
--- /dev/null
+++ b/tests/switch.qbe
@@ -0,0 +1,62 @@
+export
+function $f() {
+@start.1
+@body.2
+ jmp @switch_cond.3
+@switch_case.5
+ jmp @switch_join.4
+@switch_case.6
+ jmp @switch_join.4
+@switch_case.7
+ jmp @switch_join.4
+@switch_default.8
+ jmp @switch_join.4
+@switch_case.9
+ jmp @switch_join.4
+@switch_case.10
+ jmp @switch_join.4
+@switch_cond.3
+ %.1 =w cultw 0, 52
+ jnz %.1, @switch_lt.11, @switch_ge.12
+@switch_lt.11
+ %.2 =w cultw 0, 3
+ jnz %.2, @switch_lt.14, @switch_ge.15
+@switch_lt.14
+ %.3 =w cultw 0, 0
+ jnz %.3, @switch_lt.17, @switch_ge.18
+@switch_lt.17
+ jmp @switch_default.8
+@switch_ge.18
+ %.4 =w cugtw 0, 0
+ jnz %.4, @switch_gt.19, @switch_case.9
+@switch_gt.19
+ jmp @switch_default.8
+@switch_ge.15
+ %.5 =w cugtw 0, 3
+ jnz %.5, @switch_gt.16, @switch_case.5
+@switch_gt.16
+ jmp @switch_default.8
+@switch_ge.12
+ %.6 =w cugtw 0, 52
+ jnz %.6, @switch_gt.13, @switch_case.6
+@switch_gt.13
+ %.7 =w cultw 0, 18446744073709551613
+ jnz %.7, @switch_lt.20, @switch_ge.21
+@switch_lt.20
+ %.8 =w cultw 0, 101
+ jnz %.8, @switch_lt.23, @switch_ge.24
+@switch_lt.23
+ jmp @switch_default.8
+@switch_ge.24
+ %.9 =w cugtw 0, 101
+ jnz %.9, @switch_gt.25, @switch_case.10
+@switch_gt.25
+ jmp @switch_default.8
+@switch_ge.21
+ %.10 =w cugtw 0, 18446744073709551613
+ jnz %.10, @switch_gt.22, @switch_case.7
+@switch_gt.22
+ jmp @switch_default.8
+@switch_join.4
+ ret
+}