1 ; RUN: llc < %s | FileCheck %s
2 ; RUN: llc -relocation-model=pic < %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 @bit_mask8 = external hidden global i8, !absolute_symbol !0
8 @bit_mask32 = external hidden global i8, !absolute_symbol !1
9 @bit_mask64 = external hidden global i8, !absolute_symbol !2
13 define void @foo8(ptr %ptr) {
14 %load = load i8, ptr %ptr
15 ; CHECK: testb $bit_mask8, (%rdi)
16 %and = and i8 %load, ptrtoint (ptr @bit_mask8 to i8)
17 %icmp = icmp eq i8 %and, 0
18 br i1 %icmp, label %t, label %f
28 define void @foo32(ptr %ptr) {
29 %load = load i32, ptr %ptr
30 ; CHECK: testl $bit_mask32, (%rdi)
31 %and = and i32 %load, ptrtoint (ptr @bit_mask32 to i32)
32 %icmp = icmp eq i32 %and, 0
33 br i1 %icmp, label %t, label %f
43 define void @foo64(ptr %ptr) {
44 %load = load i64, ptr %ptr
45 ; CHECK: movabsq $bit_mask64, %rax
46 ; CHECK: testq %rax, (%rdi)
47 %and = and i64 %load, ptrtoint (ptr @bit_mask64 to i64)
48 %icmp = icmp eq i64 %and, 0
49 br i1 %icmp, label %t, label %f
59 !0 = !{i64 0, i64 256}
60 !1 = !{i64 0, i64 4294967296}
61 !2 = !{i64 -1, i64 -1}