Skip to content

Commit 35ddc17

Browse files
authored
[StackSafety] Make lit tests compatible with lit's internal shell. NFC. (#94971)
Use DEFINE: %{res} = ... instead of $(cat ...). Rewrite one use of a subshell to write to a temporary file instead.
1 parent 79ce70b commit 35ddc17

File tree

2 files changed

+88
-89
lines changed

2 files changed

+88
-89
lines changed

llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
; REQUIRES: aarch64-registered-target
2-
; REQUIRES: shell
32

43
; Test IPA over a single combined file
54
; RUN: llvm-as %s -o %t0.bc
@@ -14,27 +13,27 @@
1413
; RUN: opt -module-summary %s -o %t.summ0.bc
1514
; RUN: opt -module-summary %S/Inputs/ipa-alias.ll -o %t.summ1.bc
1615

17-
; RUN: echo > %t.res.txt \
18-
; RUN: -r %t.summ0.bc,AliasCall,px \
19-
; RUN: -r %t.summ0.bc,AliasToBitcastAliasWrite1, \
20-
; RUN: -r %t.summ0.bc,AliasToPreemptableAliasWrite1, \
21-
; RUN: -r %t.summ0.bc,AliasWrite1, \
22-
; RUN: -r %t.summ0.bc,BitcastAliasCall,px \
23-
; RUN: -r %t.summ0.bc,BitcastAliasWrite1, \
24-
; RUN: -r %t.summ0.bc,InterposableAliasCall,px \
25-
; RUN: -r %t.summ0.bc,InterposableAliasWrite1, \
26-
; RUN: -r %t.summ0.bc,PreemptableAliasCall,px \
27-
; RUN: -r %t.summ0.bc,PreemptableAliasWrite1, \
28-
; RUN: -r %t.summ1.bc,AliasToBitcastAliasWrite1,px \
29-
; RUN: -r %t.summ1.bc,AliasToPreemptableAliasWrite1,px \
30-
; RUN: -r %t.summ1.bc,AliasWrite1,px \
31-
; RUN: -r %t.summ1.bc,BitcastAliasWrite1,px \
32-
; RUN: -r %t.summ1.bc,InterposableAliasWrite1,px \
33-
; RUN: -r %t.summ1.bc,PreemptableAliasWrite1,px \
34-
; RUN: -r %t.summ1.bc,Write1,px
16+
; DEFINE: %{res} = \
17+
; DEFINE: -r %t.summ0.bc,AliasCall,px \
18+
; DEFINE: -r %t.summ0.bc,AliasToBitcastAliasWrite1, \
19+
; DEFINE: -r %t.summ0.bc,AliasToPreemptableAliasWrite1, \
20+
; DEFINE: -r %t.summ0.bc,AliasWrite1, \
21+
; DEFINE: -r %t.summ0.bc,BitcastAliasCall,px \
22+
; DEFINE: -r %t.summ0.bc,BitcastAliasWrite1, \
23+
; DEFINE: -r %t.summ0.bc,InterposableAliasCall,px \
24+
; DEFINE: -r %t.summ0.bc,InterposableAliasWrite1, \
25+
; DEFINE: -r %t.summ0.bc,PreemptableAliasCall,px \
26+
; DEFINE: -r %t.summ0.bc,PreemptableAliasWrite1, \
27+
; DEFINE: -r %t.summ1.bc,AliasToBitcastAliasWrite1,px \
28+
; DEFINE: -r %t.summ1.bc,AliasToPreemptableAliasWrite1,px \
29+
; DEFINE: -r %t.summ1.bc,AliasWrite1,px \
30+
; DEFINE: -r %t.summ1.bc,BitcastAliasWrite1,px \
31+
; DEFINE: -r %t.summ1.bc,InterposableAliasWrite1,px \
32+
; DEFINE: -r %t.summ1.bc,PreemptableAliasWrite1,px \
33+
; DEFINE: -r %t.summ1.bc,Write1,px
3534

3635
; RUN: llvm-lto2 run %t.summ0.bc %t.summ1.bc -o %t.lto -stack-safety-print -stack-safety-run -save-temps -thinlto-threads 1 -O0 \
37-
; RUN: $(cat %t.res.txt) \
36+
; RUN: %{res} \
3837
; RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL,LTO
3938

4039
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"

llvm/test/Analysis/StackSafetyAnalysis/ipa.ll

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
; REQUIRES: aarch64-registered-target
2-
; REQUIRES: shell
32

43
; RUN: llvm-as %s -o %t0.bc
54
; RUN: llvm-as %S/Inputs/ipa.ll -o %t1.bc
@@ -17,78 +16,79 @@
1716
; RUN: llvm-dis %t.summ0.bc -o - > %t.ids.txt
1817
; RUN: llvm-dis %t.summ1.bc -o - >> %t.ids.txt
1918

20-
; RUN: echo > %t.res.txt \
21-
; RUN: -r %t.summ0.bc,ExternalCall, \
22-
; RUN: -r %t.summ0.bc,f1,px \
23-
; RUN: -r %t.summ0.bc,f2,px \
24-
; RUN: -r %t.summ0.bc,f3,px \
25-
; RUN: -r %t.summ0.bc,f4,px \
26-
; RUN: -r %t.summ0.bc,f5,px \
27-
; RUN: -r %t.summ0.bc,f6,px \
28-
; RUN: -r %t.summ0.bc,f7,px \
29-
; RUN: -r %t.summ0.bc,f8left,px \
30-
; RUN: -r %t.summ0.bc,f8oobleft,px \
31-
; RUN: -r %t.summ0.bc,f8oobright,px \
32-
; RUN: -r %t.summ0.bc,f8right,px \
33-
; RUN: -r %t.summ0.bc,InterposableCall,px \
34-
; RUN: -r %t.summ0.bc,InterposableWrite1, \
35-
; RUN: -r %t.summ0.bc,PreemptableCall,px \
36-
; RUN: -r %t.summ0.bc,PreemptableWrite1, \
37-
; RUN: -r %t.summ0.bc,PrivateCall,px \
38-
; RUN: -r %t.summ0.bc,Rec2, \
39-
; RUN: -r %t.summ0.bc,RecursiveNoOffset, \
40-
; RUN: -r %t.summ0.bc,RecursiveWithOffset, \
41-
; RUN: -r %t.summ0.bc,ReturnDependent, \
42-
; RUN: -r %t.summ0.bc,TestCrossModuleConflict,px \
43-
; RUN: -r %t.summ0.bc,TestCrossModuleOnce,px \
44-
; RUN: -r %t.summ0.bc,TestCrossModuleTwice,px \
45-
; RUN: -r %t.summ0.bc,TestCrossModuleWeak,px \
46-
; RUN: -r %t.summ0.bc,TestRecursiveNoOffset,px \
47-
; RUN: -r %t.summ0.bc,TestRecursiveWithOffset,px \
48-
; RUN: -r %t.summ0.bc,TestUpdateArg,px \
49-
; RUN: -r %t.summ0.bc,TwoArguments,px \
50-
; RUN: -r %t.summ0.bc,TwoArgumentsOOBBoth,px \
51-
; RUN: -r %t.summ0.bc,TwoArgumentsOOBOne,px \
52-
; RUN: -r %t.summ0.bc,TwoArgumentsOOBOther,px \
53-
; RUN: -r %t.summ0.bc,Weak,x \
54-
; RUN: -r %t.summ0.bc,Write1, \
55-
; RUN: -r %t.summ0.bc,Write1DiffModule,x \
56-
; RUN: -r %t.summ0.bc,Write1Module0,px \
57-
; RUN: -r %t.summ0.bc,Write1Private,x \
58-
; RUN: -r %t.summ0.bc,Write1SameModule,x \
59-
; RUN: -r %t.summ0.bc,Write1Weak,x \
60-
; RUN: -r %t.summ0.bc,Write4_2, \
61-
; RUN: -r %t.summ0.bc,Write4, \
62-
; RUN: -r %t.summ0.bc,Write8, \
63-
; RUN: -r %t.summ0.bc,WriteAndReturn8, \
64-
; RUN: -r %t.summ1.bc,ExternalCall,px \
65-
; RUN: -r %t.summ1.bc,InterposableWrite1,px \
66-
; RUN: -r %t.summ1.bc,PreemptableWrite1,px \
67-
; RUN: -r %t.summ1.bc,Rec0,px \
68-
; RUN: -r %t.summ1.bc,Rec1,px \
69-
; RUN: -r %t.summ1.bc,Rec2,px \
70-
; RUN: -r %t.summ1.bc,RecursiveNoOffset,px \
71-
; RUN: -r %t.summ1.bc,RecursiveWithOffset,px \
72-
; RUN: -r %t.summ1.bc,ReturnAlloca,px \
73-
; RUN: -r %t.summ1.bc,ReturnDependent,px \
74-
; RUN: -r %t.summ1.bc,Weak,x \
75-
; RUN: -r %t.summ1.bc,Write1,px \
76-
; RUN: -r %t.summ1.bc,Write1DiffModule,px \
77-
; RUN: -r %t.summ1.bc,Write1Module0,x \
78-
; RUN: -r %t.summ1.bc,Write1Private,px \
79-
; RUN: -r %t.summ1.bc,Write1SameModule,px \
80-
; RUN: -r %t.summ1.bc,Write1Weak,px \
81-
; RUN: -r %t.summ1.bc,Write4_2,px \
82-
; RUN: -r %t.summ1.bc,Write4,px \
83-
; RUN: -r %t.summ1.bc,Write8,px \
84-
; RUN: -r %t.summ1.bc,WriteAndReturn8,px
19+
; DEFINE: %{res} = \
20+
; DEFINE: -r %t.summ0.bc,ExternalCall, \
21+
; DEFINE: -r %t.summ0.bc,f1,px \
22+
; DEFINE: -r %t.summ0.bc,f2,px \
23+
; DEFINE: -r %t.summ0.bc,f3,px \
24+
; DEFINE: -r %t.summ0.bc,f4,px \
25+
; DEFINE: -r %t.summ0.bc,f5,px \
26+
; DEFINE: -r %t.summ0.bc,f6,px \
27+
; DEFINE: -r %t.summ0.bc,f7,px \
28+
; DEFINE: -r %t.summ0.bc,f8left,px \
29+
; DEFINE: -r %t.summ0.bc,f8oobleft,px \
30+
; DEFINE: -r %t.summ0.bc,f8oobright,px \
31+
; DEFINE: -r %t.summ0.bc,f8right,px \
32+
; DEFINE: -r %t.summ0.bc,InterposableCall,px \
33+
; DEFINE: -r %t.summ0.bc,InterposableWrite1, \
34+
; DEFINE: -r %t.summ0.bc,PreemptableCall,px \
35+
; DEFINE: -r %t.summ0.bc,PreemptableWrite1, \
36+
; DEFINE: -r %t.summ0.bc,PrivateCall,px \
37+
; DEFINE: -r %t.summ0.bc,Rec2, \
38+
; DEFINE: -r %t.summ0.bc,RecursiveNoOffset, \
39+
; DEFINE: -r %t.summ0.bc,RecursiveWithOffset, \
40+
; DEFINE: -r %t.summ0.bc,ReturnDependent, \
41+
; DEFINE: -r %t.summ0.bc,TestCrossModuleConflict,px \
42+
; DEFINE: -r %t.summ0.bc,TestCrossModuleOnce,px \
43+
; DEFINE: -r %t.summ0.bc,TestCrossModuleTwice,px \
44+
; DEFINE: -r %t.summ0.bc,TestCrossModuleWeak,px \
45+
; DEFINE: -r %t.summ0.bc,TestRecursiveNoOffset,px \
46+
; DEFINE: -r %t.summ0.bc,TestRecursiveWithOffset,px \
47+
; DEFINE: -r %t.summ0.bc,TestUpdateArg,px \
48+
; DEFINE: -r %t.summ0.bc,TwoArguments,px \
49+
; DEFINE: -r %t.summ0.bc,TwoArgumentsOOBBoth,px \
50+
; DEFINE: -r %t.summ0.bc,TwoArgumentsOOBOne,px \
51+
; DEFINE: -r %t.summ0.bc,TwoArgumentsOOBOther,px \
52+
; DEFINE: -r %t.summ0.bc,Weak,x \
53+
; DEFINE: -r %t.summ0.bc,Write1, \
54+
; DEFINE: -r %t.summ0.bc,Write1DiffModule,x \
55+
; DEFINE: -r %t.summ0.bc,Write1Module0,px \
56+
; DEFINE: -r %t.summ0.bc,Write1Private,x \
57+
; DEFINE: -r %t.summ0.bc,Write1SameModule,x \
58+
; DEFINE: -r %t.summ0.bc,Write1Weak,x \
59+
; DEFINE: -r %t.summ0.bc,Write4_2, \
60+
; DEFINE: -r %t.summ0.bc,Write4, \
61+
; DEFINE: -r %t.summ0.bc,Write8, \
62+
; DEFINE: -r %t.summ0.bc,WriteAndReturn8, \
63+
; DEFINE: -r %t.summ1.bc,ExternalCall,px \
64+
; DEFINE: -r %t.summ1.bc,InterposableWrite1,px \
65+
; DEFINE: -r %t.summ1.bc,PreemptableWrite1,px \
66+
; DEFINE: -r %t.summ1.bc,Rec0,px \
67+
; DEFINE: -r %t.summ1.bc,Rec1,px \
68+
; DEFINE: -r %t.summ1.bc,Rec2,px \
69+
; DEFINE: -r %t.summ1.bc,RecursiveNoOffset,px \
70+
; DEFINE: -r %t.summ1.bc,RecursiveWithOffset,px \
71+
; DEFINE: -r %t.summ1.bc,ReturnAlloca,px \
72+
; DEFINE: -r %t.summ1.bc,ReturnDependent,px \
73+
; DEFINE: -r %t.summ1.bc,Weak,x \
74+
; DEFINE: -r %t.summ1.bc,Write1,px \
75+
; DEFINE: -r %t.summ1.bc,Write1DiffModule,px \
76+
; DEFINE: -r %t.summ1.bc,Write1Module0,x \
77+
; DEFINE: -r %t.summ1.bc,Write1Private,px \
78+
; DEFINE: -r %t.summ1.bc,Write1SameModule,px \
79+
; DEFINE: -r %t.summ1.bc,Write1Weak,px \
80+
; DEFINE: -r %t.summ1.bc,Write4_2,px \
81+
; DEFINE: -r %t.summ1.bc,Write4,px \
82+
; DEFINE: -r %t.summ1.bc,Write8,px \
83+
; DEFINE: -r %t.summ1.bc,WriteAndReturn8,px
8584

8685
; RUN: llvm-lto2 run %t.summ0.bc %t.summ1.bc -o %t.lto -stack-safety-print -stack-safety-run -save-temps -thinlto-threads 1 -O0 \
87-
; RUN: $(cat %t.res.txt) \
86+
; RUN: %{res} \
8887
; RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK,GLOBAL,LTO
8988

90-
; RUN: llvm-lto2 run %t.summ0.bc %t.summ1.bc -o %t.lto -stack-safety-run -thinlto-distributed-indexes -thinlto-threads 1 -O0 $(cat %t.res.txt)
91-
; RUN: (cat %t.ids.txt ; llvm-dis %t.summ1.bc.thinlto.bc -o -) | FileCheck --check-prefixes=INDEX %s
89+
; RUN: llvm-lto2 run %t.summ0.bc %t.summ1.bc -o %t.lto -stack-safety-run -thinlto-distributed-indexes -thinlto-threads 1 -O0 %{res}
90+
; RUN: llvm-dis %t.summ1.bc.thinlto.bc -o - >> %t.ids.txt
91+
; RUN: FileCheck --check-prefixes=INDEX %s < %t.ids.txt
9292

9393
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
9494
target triple = "aarch64-unknown-linux"

0 commit comments

Comments
 (0)