1; RUN: llc < %s -O2 --code-model=kernel | FileCheck %s 2; The intent of the test is that we do not generate conditional 3; tail calls to the thunk. 4 5target triple = "x86_64-unknown-linux-gnu" 6 7define dso_local void @foo(ptr %something) #0 { 8; CHECK-LABEL: foo: 9; CHECK: # %bb.0: # %entry 10; CHECK-NEXT: movq (%rdi), %r11 11; CHECK-NEXT: testq %r11, %r11 12; Make sure that a JNE was not generated instead of a JE + JMP sequence 13; CHECK-NOT: jne 14; CHECK-NEXT: je .LBB0_1 15; CHECK-NEXT: bb.2: # %if.then 16; CHECK-NEXT: jmp __x86_indirect_thunk_r11 17; CHECK-NEXT: LBB0_1: 18; CHECK-NEXT: retq 19entry: 20 %0 = load ptr, ptr %something, align 8 21 %tobool.not = icmp eq ptr %0, null 22 br i1 %tobool.not, label %if.end, label %if.then 23 24if.then: 25 tail call void %0() 26 br label %if.end 27 28if.end: 29 ret void 30} 31 32attributes #0 = { optsize "target-features"="+retpoline-external-thunk" } 33