xref: /llvm-project/llvm/test/CodeGen/X86/switch-default-only.ll (revision d0505201c468ec9ed7f738af0ae3da58faf24a0f)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -O0 -fast-isel=false -mtriple=i686-- < %s | FileCheck %s
3
4; No need for branching when the default and only destination follows
5; immediately after the switch.
6define void @no_branch(i32 %x) {
7; CHECK-LABEL: no_branch:
8; CHECK:       # %bb.0: # %entry
9; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %eax
10; CHECK-NEXT:  # %bb.1: # %exit
11; CHECK-NEXT:    retl
12entry:
13  switch i32 %x, label %exit [ ]
14exit:
15  ret void
16}
17