aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/switch-default-only.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/switch-default-only.ll')
-rw-r--r--test/CodeGen/X86/switch-default-only.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/X86/switch-default-only.ll b/test/CodeGen/X86/switch-default-only.ll
new file mode 100644
index 0000000..360ace5
--- /dev/null
+++ b/test/CodeGen/X86/switch-default-only.ll
@@ -0,0 +1,14 @@
+; RUN: llc -O0 -fast-isel=false -march=x86 < %s | FileCheck %s
+
+; No need for branching when the default and only destination follows
+; immediately after the switch.
+; CHECK-LABEL: no_branch:
+; CHECK-NOT: jmp
+; CHECK: ret
+
+define void @no_branch(i32 %x) {
+entry:
+ switch i32 %x, label %exit [ ]
+exit:
+ ret void
+}