aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/switch-or.ll
blob: 6e6b013d9fa89c007265ae93480fc8cb7753f8a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
; RUN: llc -march=x86 -asm-verbose=false < %s | FileCheck %s

; Check that merging switch cases that differ in one bit works.
; CHECK: orl $2
; CHECK-NEXT: cmpl $6

define void @foo(i32 %variable) nounwind {
entry:
  switch i32 %variable, label %if.end [
    i32 4, label %if.then
    i32 6, label %if.then
  ]

if.then:
  %call = tail call i32 (...) @bar() nounwind
  ret void

if.end:
  ret void
}

declare i32 @bar(...) nounwind