1 ; RUN: llc -mtriple=x86_64-apple-darwin -print-machineinstrs=expand-isel-pseudos -enable-selectiondag-sp=true %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=SELDAG
2 ; RUN: llc -mtriple=x86_64-apple-darwin -print-machineinstrs=expand-isel-pseudos -enable-selectiondag-sp=false %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=IR
4 ; SELDAG: # Machine code for function test_branch_weights:
5 ; SELDAG: Successors according to CFG: BB#[[SUCCESS:[0-9]+]](1048575) BB#[[FAILURE:[0-9]+]](1)
6 ; SELDAG: BB#[[FAILURE]]:
7 ; SELDAG: CALL64pcrel32 <es:__stack_chk_fail>
8 ; SELDAG: BB#[[SUCCESS]]:
10 ; IR: # Machine code for function test_branch_weights:
11 ; IR: Successors according to CFG: BB#[[SUCCESS:[0-9]+]](1048575) BB#[[FAILURE:[0-9]+]](1)
14 ; IR: CALL64pcrel32 <ga:@__stack_chk_fail>
16 define i32 @test_branch_weights(i32 %n) #0 {
18 %a = alloca [128 x i32], align 16
19 %0 = bitcast [128 x i32]* %a to i8*
20 call void @llvm.lifetime.start(i64 512, i8* %0)
21 %arraydecay = getelementptr inbounds [128 x i32]* %a, i64 0, i64 0
22 call void @foo2(i32* %arraydecay)
23 %idxprom = sext i32 %n to i64
24 %arrayidx = getelementptr inbounds [128 x i32]* %a, i64 0, i64 %idxprom
25 %1 = load i32* %arrayidx, align 4
26 call void @llvm.lifetime.end(i64 512, i8* %0)
30 declare void @llvm.lifetime.start(i64, i8* nocapture)
32 declare void @foo2(i32*)
34 declare void @llvm.lifetime.end(i64, i8* nocapture)
36 attributes #0 = { ssp "stack-protector-buffer-size"="8" }