1 ; RUN: llc -march=x86-64 -asm-verbose=false < %s | FileCheck %s
3 ; This switch should use bit tests, and the third bit test case is just
4 ; testing for one possible value, so it doesn't need a bt.
6 ; CHECK: movabsq $2305843009482129440, %r
7 ; CHECK-NEXT: btq %rax, %r
9 ; CHECK: movl $671088640, %e
10 ; CHECK-NEXT: btq %rax, %r
12 ; CHECK: testq %rax, %r
15 define void @test(i8* %l) nounwind {
17 %l.addr = alloca i8*, align 8 ; <i8**> [#uses=2]
18 store i8* %l, i8** %l.addr
19 %tmp = load i8** %l.addr ; <i8*> [#uses=1]
20 %tmp1 = load i8* %tmp ; <i8> [#uses=1]
21 %conv = sext i8 %tmp1 to i32 ; <i32> [#uses=1]
22 switch i32 %conv, label %sw.default [
31 sw.bb: ; preds = %entry, %entry
35 sw.bb2: ; preds = %entry, %entry, %entry
39 sw.bb4: ; preds = %entry
43 sw.default: ; preds = %entry
44 call void @foo(i32 97)
47 sw.epilog: ; preds = %sw.default, %sw.bb4, %sw.bb2, %sw.bb
51 declare void @foo(i32)
53 ; Don't zero extend the test operands to pointer type if it can be avoided.
55 define void @test2(i32 %x) nounwind ssp {
60 ; CHECK-NEXT: movl $91
65 switch i32 %x, label %if.end [
73 if.then: ; preds = %entry, %entry, %entry, %entry, %entry
74 tail call void @bar() nounwind
77 if.end: ; preds = %entry
83 define void @test3(i32 %x) nounwind {
89 switch i32 %x, label %if.end [
97 tail call void @bar() nounwind