brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · cfc54d5 Raw
78 lines · plain
1; RUN: split-file %s %t2; RUN: opt -module-summary %t/a.ll -o %ta.bc3; RUN: opt -module-summary %t/b.ll -o %tb.bc4; RUN: llvm-lto2 run %ta.bc %tb.bc -o %tc.bc -save-temps \5; RUN:   -r=%ta.bc,nossp_caller,px \6; RUN:   -r=%ta.bc,ssp_caller,px \7; RUN:   -r=%ta.bc,nossp_caller2,px \8; RUN:   -r=%ta.bc,ssp_caller2,px \9; RUN:   -r=%ta.bc,nossp_callee,x \10; RUN:   -r=%ta.bc,ssp_callee,x \11; RUN:   -r=%tb.bc,nossp_callee,px \12; RUN:   -r=%tb.bc,ssp_callee,px \13; RUN:   -r=%tb.bc,foo14; RUN: llvm-dis %tc.bc.1.4.opt.bc -o - | FileCheck %s15 16;--- a.ll17 18target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"19target triple = "x86_64-pc-linux-gnu"20 21declare void @nossp_callee()22declare void @ssp_callee() ssp23 24; nossp caller should be able to inline nossp callee.25define void @nossp_caller() {26; CHECK-LABEL: define void @nossp_caller()27; CHECK-NOT: #028; CHECK-NEXT: tail call void @foo29  tail call void @nossp_callee()30  ret void31}32 33; ssp caller should be able to inline ssp callee.34define void @ssp_caller() ssp {35; CHECK-LABEL: define void @ssp_caller()36; CHECK-SAME: #037; CHECK-NEXT: tail call void @foo38  tail call void @ssp_callee()39  ret void40}41 42; nossp caller should be able to inline ssp callee.43; the ssp attribute is not propagated.44define void @nossp_caller2() {45; CHECK-LABEL: define void @nossp_caller2()46; CHECK-NOT: #047; CHECK-NEXT: tail call void @foo48  tail call void @ssp_callee()49  ret void50}51 52; ssp caller should be able to inline nossp callee.53define void @ssp_caller2() ssp {54; CHECK-LABEL: define void @ssp_caller2()55; CHECK-SAME: #056; CHECK-NEXT: tail call void @foo57  tail call void @nossp_callee()58  ret void59}60 61; CHECK: attributes #0 = { ssp }62 63;--- b.ll64target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"65target triple = "x86_64-pc-linux-gnu"66 67declare void @foo()68 69define void @nossp_callee() {70  call void @foo()71  ret void72}73 74define void @ssp_callee() ssp {75  call void @foo()76  ret void77}78