1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s | FileCheck %s
3 ; RUN: llc -relocation-model=pic < %s | FileCheck %s --check-prefix=PIC
5 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64-unknown-linux-gnu"
8 @foo = external global i8, align 1, !absolute_symbol !0
10 define void @bar(ptr %x) {
12 ; CHECK: # %bb.0: # %entry
13 ; CHECK-NEXT: testb $foo, (%rdi)
14 ; CHECK-NEXT: je .LBB0_1
15 ; CHECK-NEXT: # %bb.2: # %if.then
16 ; CHECK-NEXT: xorl %eax, %eax
17 ; CHECK-NEXT: jmp xf@PLT # TAILCALL
18 ; CHECK-NEXT: .LBB0_1: # %if.end
22 ; PIC: # %bb.0: # %entry
23 ; PIC-NEXT: testb $foo, (%rdi)
24 ; PIC-NEXT: je .LBB0_1
25 ; PIC-NEXT: # %bb.2: # %if.then
26 ; PIC-NEXT: xorl %eax, %eax
27 ; PIC-NEXT: jmp xf@PLT # TAILCALL
28 ; PIC-NEXT: .LBB0_1: # %if.end
31 %0 = load i8, ptr %x, align 1
32 %conv = sext i8 %0 to i32
33 %ext = sext i8 ptrtoint (ptr @foo to i8) to i32
34 %and = and i32 %conv, %ext
35 %tobool = icmp eq i32 %and, 0
36 br i1 %tobool, label %if.end, label %if.then
38 if.then: ; preds = %entry
39 tail call void (...) @xf()
42 if.end: ; preds = %entry, %if.then
48 !0 = !{i64 0, i64 256}