xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/stack-protector.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-I386 %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-X64 %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llc -code-model=kernel -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-KERNEL-X64 %s
4*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | FileCheck --check-prefix=DARWIN-X64 %s
5*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=amd64-pc-openbsd < %s -o - | FileCheck --check-prefix=OPENBSD-AMD64 %s
6*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=i386-pc-windows-msvc < %s -o - | FileCheck -check-prefix=MSVC-I386 %s
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker%struct.foo = type { [16 x i8] }
9*9880d681SAndroid Build Coastguard Worker%struct.foo.0 = type { [4 x i8] }
10*9880d681SAndroid Build Coastguard Worker%struct.pair = type { i32, i32 }
11*9880d681SAndroid Build Coastguard Worker%struct.nest = type { %struct.pair, %struct.pair }
12*9880d681SAndroid Build Coastguard Worker%struct.vec = type { <4 x i32> }
13*9880d681SAndroid Build Coastguard Worker%class.A = type { [2 x i8] }
14*9880d681SAndroid Build Coastguard Worker%struct.deep = type { %union.anon }
15*9880d681SAndroid Build Coastguard Worker%union.anon = type { %struct.anon }
16*9880d681SAndroid Build Coastguard Worker%struct.anon = type { %struct.anon.0 }
17*9880d681SAndroid Build Coastguard Worker%struct.anon.0 = type { %union.anon.1 }
18*9880d681SAndroid Build Coastguard Worker%union.anon.1 = type { [2 x i8] }
19*9880d681SAndroid Build Coastguard Worker%struct.small = type { i8 }
20*9880d681SAndroid Build Coastguard Worker%struct.small_char = type { i32, [5 x i8] }
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker@.str = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker; test1a: array of [16 x i8]
25*9880d681SAndroid Build Coastguard Worker;         no ssp attribute
26*9880d681SAndroid Build Coastguard Worker; Requires no protector.
27*9880d681SAndroid Build Coastguard Workerdefine void @test1a(i8* %a) {
28*9880d681SAndroid Build Coastguard Workerentry:
29*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test1a:
30*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
31*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test1a:
34*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
35*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test1a:
38*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
39*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test1a:
42*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
43*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test1a:
46*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll  @__security_check_cookie@4
47*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
48*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
49*9880d681SAndroid Build Coastguard Worker  %buf = alloca [16 x i8], align 16
50*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
51*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
52*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
53*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
54*9880d681SAndroid Build Coastguard Worker  %arraydecay1 = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
55*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay1)
56*9880d681SAndroid Build Coastguard Worker  ret void
57*9880d681SAndroid Build Coastguard Worker}
58*9880d681SAndroid Build Coastguard Worker
59*9880d681SAndroid Build Coastguard Worker; test1b: array of [16 x i8]
60*9880d681SAndroid Build Coastguard Worker;         ssp attribute
61*9880d681SAndroid Build Coastguard Worker; Requires protector.
62*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
63*9880d681SAndroid Build Coastguard Workerdefine void @test1b(i8* %a) #0 {
64*9880d681SAndroid Build Coastguard Workerentry:
65*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test1b:
66*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
67*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
68*9880d681SAndroid Build Coastguard Worker
69*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test1b:
70*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
71*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
72*9880d681SAndroid Build Coastguard Worker
73*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test1b:
74*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
75*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
76*9880d681SAndroid Build Coastguard Worker
77*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test1b:
78*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
79*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
80*9880d681SAndroid Build Coastguard Worker
81*9880d681SAndroid Build Coastguard Worker; OPENBSD-AMD64-LABEL: test1b:
82*9880d681SAndroid Build Coastguard Worker; OPENBSD-AMD64: movq __guard_local(%rip)
83*9880d681SAndroid Build Coastguard Worker; OPENBSD-AMD64: callq __stack_smash_handler
84*9880d681SAndroid Build Coastguard Worker
85*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test1b:
86*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
87*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
88*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
89*9880d681SAndroid Build Coastguard Worker  %buf = alloca [16 x i8], align 16
90*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
91*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
92*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
93*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
94*9880d681SAndroid Build Coastguard Worker  %arraydecay1 = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
95*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay1)
96*9880d681SAndroid Build Coastguard Worker  ret void
97*9880d681SAndroid Build Coastguard Worker}
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard Worker; test1c: array of [16 x i8]
100*9880d681SAndroid Build Coastguard Worker;         sspstrong attribute
101*9880d681SAndroid Build Coastguard Worker; Requires protector.
102*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
103*9880d681SAndroid Build Coastguard Workerdefine void @test1c(i8* %a) #1 {
104*9880d681SAndroid Build Coastguard Workerentry:
105*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test1c:
106*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
107*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
108*9880d681SAndroid Build Coastguard Worker
109*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test1c:
110*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
111*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
112*9880d681SAndroid Build Coastguard Worker
113*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test1c:
114*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
115*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
116*9880d681SAndroid Build Coastguard Worker
117*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test1c:
118*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
119*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
120*9880d681SAndroid Build Coastguard Worker
121*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test1c:
122*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
123*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
124*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
125*9880d681SAndroid Build Coastguard Worker  %buf = alloca [16 x i8], align 16
126*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
127*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
128*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
129*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
130*9880d681SAndroid Build Coastguard Worker  %arraydecay1 = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
131*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay1)
132*9880d681SAndroid Build Coastguard Worker  ret void
133*9880d681SAndroid Build Coastguard Worker}
134*9880d681SAndroid Build Coastguard Worker
135*9880d681SAndroid Build Coastguard Worker; test1d: array of [16 x i8]
136*9880d681SAndroid Build Coastguard Worker;         sspreq attribute
137*9880d681SAndroid Build Coastguard Worker; Requires protector.
138*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
139*9880d681SAndroid Build Coastguard Workerdefine void @test1d(i8* %a) #2 {
140*9880d681SAndroid Build Coastguard Workerentry:
141*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test1d:
142*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
143*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
144*9880d681SAndroid Build Coastguard Worker
145*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test1d:
146*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
147*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
148*9880d681SAndroid Build Coastguard Worker
149*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test1d:
150*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
151*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
152*9880d681SAndroid Build Coastguard Worker
153*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test1d:
154*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
155*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
156*9880d681SAndroid Build Coastguard Worker
157*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test1d:
158*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
159*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
160*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
161*9880d681SAndroid Build Coastguard Worker  %buf = alloca [16 x i8], align 16
162*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
163*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
164*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
165*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
166*9880d681SAndroid Build Coastguard Worker  %arraydecay1 = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
167*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay1)
168*9880d681SAndroid Build Coastguard Worker  ret void
169*9880d681SAndroid Build Coastguard Worker}
170*9880d681SAndroid Build Coastguard Worker
171*9880d681SAndroid Build Coastguard Worker; test2a: struct { [16 x i8] }
172*9880d681SAndroid Build Coastguard Worker;         no ssp attribute
173*9880d681SAndroid Build Coastguard Worker; Requires no protector.
174*9880d681SAndroid Build Coastguard Workerdefine void @test2a(i8* %a) {
175*9880d681SAndroid Build Coastguard Workerentry:
176*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test2a:
177*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
178*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
179*9880d681SAndroid Build Coastguard Worker
180*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test2a:
181*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
182*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
183*9880d681SAndroid Build Coastguard Worker
184*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test2a:
185*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
186*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
187*9880d681SAndroid Build Coastguard Worker
188*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test2a:
189*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
190*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
191*9880d681SAndroid Build Coastguard Worker
192*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test2a:
193*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
194*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
195*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
196*9880d681SAndroid Build Coastguard Worker  %b = alloca %struct.foo, align 1
197*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
198*9880d681SAndroid Build Coastguard Worker  %buf = getelementptr inbounds %struct.foo, %struct.foo* %b, i32 0, i32 0
199*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
200*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
201*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
202*9880d681SAndroid Build Coastguard Worker  %buf1 = getelementptr inbounds %struct.foo, %struct.foo* %b, i32 0, i32 0
203*9880d681SAndroid Build Coastguard Worker  %arraydecay2 = getelementptr inbounds [16 x i8], [16 x i8]* %buf1, i32 0, i32 0
204*9880d681SAndroid Build Coastguard Worker  %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay2)
205*9880d681SAndroid Build Coastguard Worker  ret void
206*9880d681SAndroid Build Coastguard Worker}
207*9880d681SAndroid Build Coastguard Worker
208*9880d681SAndroid Build Coastguard Worker; test2b: struct { [16 x i8] }
209*9880d681SAndroid Build Coastguard Worker;          ssp attribute
210*9880d681SAndroid Build Coastguard Worker; Requires protector.
211*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
212*9880d681SAndroid Build Coastguard Workerdefine void @test2b(i8* %a) #0 {
213*9880d681SAndroid Build Coastguard Workerentry:
214*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test2b:
215*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
216*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
217*9880d681SAndroid Build Coastguard Worker
218*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test2b:
219*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
220*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
221*9880d681SAndroid Build Coastguard Worker
222*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test2b:
223*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
224*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
225*9880d681SAndroid Build Coastguard Worker
226*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test2b:
227*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
228*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
229*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
230*9880d681SAndroid Build Coastguard Worker  %b = alloca %struct.foo, align 1
231*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
232*9880d681SAndroid Build Coastguard Worker  %buf = getelementptr inbounds %struct.foo, %struct.foo* %b, i32 0, i32 0
233*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
234*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
235*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
236*9880d681SAndroid Build Coastguard Worker  %buf1 = getelementptr inbounds %struct.foo, %struct.foo* %b, i32 0, i32 0
237*9880d681SAndroid Build Coastguard Worker  %arraydecay2 = getelementptr inbounds [16 x i8], [16 x i8]* %buf1, i32 0, i32 0
238*9880d681SAndroid Build Coastguard Worker  %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay2)
239*9880d681SAndroid Build Coastguard Worker  ret void
240*9880d681SAndroid Build Coastguard Worker}
241*9880d681SAndroid Build Coastguard Worker
242*9880d681SAndroid Build Coastguard Worker; test2c: struct { [16 x i8] }
243*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
244*9880d681SAndroid Build Coastguard Worker; Requires protector.
245*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
246*9880d681SAndroid Build Coastguard Workerdefine void @test2c(i8* %a) #1 {
247*9880d681SAndroid Build Coastguard Workerentry:
248*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test2c:
249*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
250*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
251*9880d681SAndroid Build Coastguard Worker
252*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test2c:
253*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
254*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
255*9880d681SAndroid Build Coastguard Worker
256*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test2c:
257*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
258*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
259*9880d681SAndroid Build Coastguard Worker
260*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test2c:
261*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
262*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
263*9880d681SAndroid Build Coastguard Worker
264*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test2c:
265*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
266*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
267*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
268*9880d681SAndroid Build Coastguard Worker  %b = alloca %struct.foo, align 1
269*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
270*9880d681SAndroid Build Coastguard Worker  %buf = getelementptr inbounds %struct.foo, %struct.foo* %b, i32 0, i32 0
271*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
272*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
273*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
274*9880d681SAndroid Build Coastguard Worker  %buf1 = getelementptr inbounds %struct.foo, %struct.foo* %b, i32 0, i32 0
275*9880d681SAndroid Build Coastguard Worker  %arraydecay2 = getelementptr inbounds [16 x i8], [16 x i8]* %buf1, i32 0, i32 0
276*9880d681SAndroid Build Coastguard Worker  %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay2)
277*9880d681SAndroid Build Coastguard Worker  ret void
278*9880d681SAndroid Build Coastguard Worker}
279*9880d681SAndroid Build Coastguard Worker
280*9880d681SAndroid Build Coastguard Worker; test2d: struct { [16 x i8] }
281*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
282*9880d681SAndroid Build Coastguard Worker; Requires protector.
283*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
284*9880d681SAndroid Build Coastguard Workerdefine void @test2d(i8* %a) #2 {
285*9880d681SAndroid Build Coastguard Workerentry:
286*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test2d:
287*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
288*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
289*9880d681SAndroid Build Coastguard Worker
290*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test2d:
291*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
292*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
293*9880d681SAndroid Build Coastguard Worker
294*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test2d:
295*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
296*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
297*9880d681SAndroid Build Coastguard Worker
298*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test2d:
299*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
300*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
301*9880d681SAndroid Build Coastguard Worker
302*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test2d:
303*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
304*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
305*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
306*9880d681SAndroid Build Coastguard Worker  %b = alloca %struct.foo, align 1
307*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
308*9880d681SAndroid Build Coastguard Worker  %buf = getelementptr inbounds %struct.foo, %struct.foo* %b, i32 0, i32 0
309*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [16 x i8], [16 x i8]* %buf, i32 0, i32 0
310*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
311*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
312*9880d681SAndroid Build Coastguard Worker  %buf1 = getelementptr inbounds %struct.foo, %struct.foo* %b, i32 0, i32 0
313*9880d681SAndroid Build Coastguard Worker  %arraydecay2 = getelementptr inbounds [16 x i8], [16 x i8]* %buf1, i32 0, i32 0
314*9880d681SAndroid Build Coastguard Worker  %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay2)
315*9880d681SAndroid Build Coastguard Worker  ret void
316*9880d681SAndroid Build Coastguard Worker}
317*9880d681SAndroid Build Coastguard Worker
318*9880d681SAndroid Build Coastguard Worker; test3a:  array of [4 x i8]
319*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
320*9880d681SAndroid Build Coastguard Worker; Requires no protector.
321*9880d681SAndroid Build Coastguard Workerdefine void @test3a(i8* %a) {
322*9880d681SAndroid Build Coastguard Workerentry:
323*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test3a:
324*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
325*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
326*9880d681SAndroid Build Coastguard Worker
327*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test3a:
328*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
329*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
330*9880d681SAndroid Build Coastguard Worker
331*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test3a:
332*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
333*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
334*9880d681SAndroid Build Coastguard Worker
335*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test3a:
336*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
337*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
338*9880d681SAndroid Build Coastguard Worker
339*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test3a:
340*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
341*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
342*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
343*9880d681SAndroid Build Coastguard Worker  %buf = alloca [4 x i8], align 1
344*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
345*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
346*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
347*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
348*9880d681SAndroid Build Coastguard Worker  %arraydecay1 = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
349*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay1)
350*9880d681SAndroid Build Coastguard Worker  ret void
351*9880d681SAndroid Build Coastguard Worker}
352*9880d681SAndroid Build Coastguard Worker
353*9880d681SAndroid Build Coastguard Worker; test3b:  array [4 x i8]
354*9880d681SAndroid Build Coastguard Worker;          ssp attribute
355*9880d681SAndroid Build Coastguard Worker; Requires no protector.
356*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
357*9880d681SAndroid Build Coastguard Workerdefine void @test3b(i8* %a) #0 {
358*9880d681SAndroid Build Coastguard Workerentry:
359*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test3b:
360*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
361*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
362*9880d681SAndroid Build Coastguard Worker
363*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test3b:
364*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
365*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
366*9880d681SAndroid Build Coastguard Worker
367*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test3b:
368*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
369*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
370*9880d681SAndroid Build Coastguard Worker
371*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test3b:
372*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
373*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
374*9880d681SAndroid Build Coastguard Worker
375*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test3b:
376*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
377*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
378*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
379*9880d681SAndroid Build Coastguard Worker  %buf = alloca [4 x i8], align 1
380*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
381*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
382*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
383*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
384*9880d681SAndroid Build Coastguard Worker  %arraydecay1 = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
385*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay1)
386*9880d681SAndroid Build Coastguard Worker  ret void
387*9880d681SAndroid Build Coastguard Worker}
388*9880d681SAndroid Build Coastguard Worker
389*9880d681SAndroid Build Coastguard Worker; test3c:  array of [4 x i8]
390*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
391*9880d681SAndroid Build Coastguard Worker; Requires protector.
392*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
393*9880d681SAndroid Build Coastguard Workerdefine void @test3c(i8* %a) #1 {
394*9880d681SAndroid Build Coastguard Workerentry:
395*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test3c:
396*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
397*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
398*9880d681SAndroid Build Coastguard Worker
399*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test3c:
400*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
401*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
402*9880d681SAndroid Build Coastguard Worker
403*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test3c:
404*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
405*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
406*9880d681SAndroid Build Coastguard Worker
407*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test3c:
408*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
409*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
410*9880d681SAndroid Build Coastguard Worker
411*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test3c:
412*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
413*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
414*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
415*9880d681SAndroid Build Coastguard Worker  %buf = alloca [4 x i8], align 1
416*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
417*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
418*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
419*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
420*9880d681SAndroid Build Coastguard Worker  %arraydecay1 = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
421*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay1)
422*9880d681SAndroid Build Coastguard Worker  ret void
423*9880d681SAndroid Build Coastguard Worker}
424*9880d681SAndroid Build Coastguard Worker
425*9880d681SAndroid Build Coastguard Worker; test3d:  array of [4 x i8]
426*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
427*9880d681SAndroid Build Coastguard Worker; Requires protector.
428*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
429*9880d681SAndroid Build Coastguard Workerdefine void @test3d(i8* %a) #2 {
430*9880d681SAndroid Build Coastguard Workerentry:
431*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test3d:
432*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
433*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
434*9880d681SAndroid Build Coastguard Worker
435*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test3d:
436*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
437*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
438*9880d681SAndroid Build Coastguard Worker
439*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test3d:
440*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
441*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
442*9880d681SAndroid Build Coastguard Worker
443*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test3d:
444*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
445*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
446*9880d681SAndroid Build Coastguard Worker
447*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test3d:
448*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
449*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
450*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
451*9880d681SAndroid Build Coastguard Worker  %buf = alloca [4 x i8], align 1
452*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
453*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
454*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
455*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
456*9880d681SAndroid Build Coastguard Worker  %arraydecay1 = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
457*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay1)
458*9880d681SAndroid Build Coastguard Worker  ret void
459*9880d681SAndroid Build Coastguard Worker}
460*9880d681SAndroid Build Coastguard Worker
461*9880d681SAndroid Build Coastguard Worker; test4a:  struct { [4 x i8] }
462*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
463*9880d681SAndroid Build Coastguard Worker; Requires no protector.
464*9880d681SAndroid Build Coastguard Workerdefine void @test4a(i8* %a) {
465*9880d681SAndroid Build Coastguard Workerentry:
466*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test4a:
467*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
468*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
469*9880d681SAndroid Build Coastguard Worker
470*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test4a:
471*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
472*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
473*9880d681SAndroid Build Coastguard Worker
474*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test4a:
475*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
476*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
477*9880d681SAndroid Build Coastguard Worker
478*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test4a:
479*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
480*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
481*9880d681SAndroid Build Coastguard Worker
482*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test4a:
483*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
484*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
485*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
486*9880d681SAndroid Build Coastguard Worker  %b = alloca %struct.foo.0, align 1
487*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
488*9880d681SAndroid Build Coastguard Worker  %buf = getelementptr inbounds %struct.foo.0, %struct.foo.0* %b, i32 0, i32 0
489*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
490*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
491*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
492*9880d681SAndroid Build Coastguard Worker  %buf1 = getelementptr inbounds %struct.foo.0, %struct.foo.0* %b, i32 0, i32 0
493*9880d681SAndroid Build Coastguard Worker  %arraydecay2 = getelementptr inbounds [4 x i8], [4 x i8]* %buf1, i32 0, i32 0
494*9880d681SAndroid Build Coastguard Worker  %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay2)
495*9880d681SAndroid Build Coastguard Worker  ret void
496*9880d681SAndroid Build Coastguard Worker}
497*9880d681SAndroid Build Coastguard Worker
498*9880d681SAndroid Build Coastguard Worker; test4b:  struct { [4 x i8] }
499*9880d681SAndroid Build Coastguard Worker;          ssp attribute
500*9880d681SAndroid Build Coastguard Worker; Requires no protector.
501*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
502*9880d681SAndroid Build Coastguard Workerdefine void @test4b(i8* %a) #0 {
503*9880d681SAndroid Build Coastguard Workerentry:
504*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test4b:
505*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
506*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
507*9880d681SAndroid Build Coastguard Worker
508*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test4b:
509*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
510*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
511*9880d681SAndroid Build Coastguard Worker
512*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test4b:
513*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
514*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
515*9880d681SAndroid Build Coastguard Worker
516*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test4b:
517*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
518*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
519*9880d681SAndroid Build Coastguard Worker
520*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test4b:
521*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
522*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
523*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
524*9880d681SAndroid Build Coastguard Worker  %b = alloca %struct.foo.0, align 1
525*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
526*9880d681SAndroid Build Coastguard Worker  %buf = getelementptr inbounds %struct.foo.0, %struct.foo.0* %b, i32 0, i32 0
527*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
528*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
529*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
530*9880d681SAndroid Build Coastguard Worker  %buf1 = getelementptr inbounds %struct.foo.0, %struct.foo.0* %b, i32 0, i32 0
531*9880d681SAndroid Build Coastguard Worker  %arraydecay2 = getelementptr inbounds [4 x i8], [4 x i8]* %buf1, i32 0, i32 0
532*9880d681SAndroid Build Coastguard Worker  %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay2)
533*9880d681SAndroid Build Coastguard Worker  ret void
534*9880d681SAndroid Build Coastguard Worker}
535*9880d681SAndroid Build Coastguard Worker
536*9880d681SAndroid Build Coastguard Worker; test4c:  struct { [4 x i8] }
537*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
538*9880d681SAndroid Build Coastguard Worker; Requires protector.
539*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
540*9880d681SAndroid Build Coastguard Workerdefine void @test4c(i8* %a) #1 {
541*9880d681SAndroid Build Coastguard Workerentry:
542*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test4c:
543*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
544*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
545*9880d681SAndroid Build Coastguard Worker
546*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test4c:
547*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
548*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
549*9880d681SAndroid Build Coastguard Worker
550*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test4c:
551*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
552*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
553*9880d681SAndroid Build Coastguard Worker
554*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test4c:
555*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
556*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
557*9880d681SAndroid Build Coastguard Worker
558*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test4c:
559*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
560*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
561*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
562*9880d681SAndroid Build Coastguard Worker  %b = alloca %struct.foo.0, align 1
563*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
564*9880d681SAndroid Build Coastguard Worker  %buf = getelementptr inbounds %struct.foo.0, %struct.foo.0* %b, i32 0, i32 0
565*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
566*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
567*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
568*9880d681SAndroid Build Coastguard Worker  %buf1 = getelementptr inbounds %struct.foo.0, %struct.foo.0* %b, i32 0, i32 0
569*9880d681SAndroid Build Coastguard Worker  %arraydecay2 = getelementptr inbounds [4 x i8], [4 x i8]* %buf1, i32 0, i32 0
570*9880d681SAndroid Build Coastguard Worker  %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay2)
571*9880d681SAndroid Build Coastguard Worker  ret void
572*9880d681SAndroid Build Coastguard Worker}
573*9880d681SAndroid Build Coastguard Worker
574*9880d681SAndroid Build Coastguard Worker; test4d:  struct { [4 x i8] }
575*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
576*9880d681SAndroid Build Coastguard Worker; Requires protector.
577*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
578*9880d681SAndroid Build Coastguard Workerdefine void @test4d(i8* %a) #2 {
579*9880d681SAndroid Build Coastguard Workerentry:
580*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test4d:
581*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
582*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
583*9880d681SAndroid Build Coastguard Worker
584*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test4d:
585*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
586*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
587*9880d681SAndroid Build Coastguard Worker
588*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test4d:
589*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
590*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
591*9880d681SAndroid Build Coastguard Worker
592*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test4d:
593*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
594*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
595*9880d681SAndroid Build Coastguard Worker
596*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test4d:
597*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
598*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
599*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
600*9880d681SAndroid Build Coastguard Worker  %b = alloca %struct.foo.0, align 1
601*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
602*9880d681SAndroid Build Coastguard Worker  %buf = getelementptr inbounds %struct.foo.0, %struct.foo.0* %b, i32 0, i32 0
603*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %buf, i32 0, i32 0
604*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
605*9880d681SAndroid Build Coastguard Worker  %call = call i8* @strcpy(i8* %arraydecay, i8* %0)
606*9880d681SAndroid Build Coastguard Worker  %buf1 = getelementptr inbounds %struct.foo.0, %struct.foo.0* %b, i32 0, i32 0
607*9880d681SAndroid Build Coastguard Worker  %arraydecay2 = getelementptr inbounds [4 x i8], [4 x i8]* %buf1, i32 0, i32 0
608*9880d681SAndroid Build Coastguard Worker  %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay2)
609*9880d681SAndroid Build Coastguard Worker  ret void
610*9880d681SAndroid Build Coastguard Worker}
611*9880d681SAndroid Build Coastguard Worker
612*9880d681SAndroid Build Coastguard Worker; test5a:  no arrays / no nested arrays
613*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
614*9880d681SAndroid Build Coastguard Worker; Requires no protector.
615*9880d681SAndroid Build Coastguard Workerdefine void @test5a(i8* %a) {
616*9880d681SAndroid Build Coastguard Workerentry:
617*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test5a:
618*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
619*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
620*9880d681SAndroid Build Coastguard Worker
621*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test5a:
622*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
623*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
624*9880d681SAndroid Build Coastguard Worker
625*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test5a:
626*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
627*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
628*9880d681SAndroid Build Coastguard Worker
629*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test5a:
630*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
631*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
632*9880d681SAndroid Build Coastguard Worker
633*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test5a:
634*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
635*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
636*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
637*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
638*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
639*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %0)
640*9880d681SAndroid Build Coastguard Worker  ret void
641*9880d681SAndroid Build Coastguard Worker}
642*9880d681SAndroid Build Coastguard Worker
643*9880d681SAndroid Build Coastguard Worker; test5b:  no arrays / no nested arrays
644*9880d681SAndroid Build Coastguard Worker;          ssp attribute
645*9880d681SAndroid Build Coastguard Worker; Requires no protector.
646*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
647*9880d681SAndroid Build Coastguard Workerdefine void @test5b(i8* %a) #0 {
648*9880d681SAndroid Build Coastguard Workerentry:
649*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test5b:
650*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
651*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
652*9880d681SAndroid Build Coastguard Worker
653*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test5b:
654*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
655*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
656*9880d681SAndroid Build Coastguard Worker
657*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test5b:
658*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
659*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
660*9880d681SAndroid Build Coastguard Worker
661*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test5b:
662*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
663*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
664*9880d681SAndroid Build Coastguard Worker
665*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test5b:
666*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
667*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
668*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
669*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
670*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
671*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %0)
672*9880d681SAndroid Build Coastguard Worker  ret void
673*9880d681SAndroid Build Coastguard Worker}
674*9880d681SAndroid Build Coastguard Worker
675*9880d681SAndroid Build Coastguard Worker; test5c:  no arrays / no nested arrays
676*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
677*9880d681SAndroid Build Coastguard Worker; Requires no protector.
678*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
679*9880d681SAndroid Build Coastguard Workerdefine void @test5c(i8* %a) #1 {
680*9880d681SAndroid Build Coastguard Workerentry:
681*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test5c:
682*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
683*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
684*9880d681SAndroid Build Coastguard Worker
685*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test5c:
686*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
687*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
688*9880d681SAndroid Build Coastguard Worker
689*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test5c:
690*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
691*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
692*9880d681SAndroid Build Coastguard Worker
693*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test5c:
694*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
695*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
696*9880d681SAndroid Build Coastguard Worker
697*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test5c:
698*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
699*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
700*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
701*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
702*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
703*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %0)
704*9880d681SAndroid Build Coastguard Worker  ret void
705*9880d681SAndroid Build Coastguard Worker}
706*9880d681SAndroid Build Coastguard Worker
707*9880d681SAndroid Build Coastguard Worker; test5d:  no arrays / no nested arrays
708*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
709*9880d681SAndroid Build Coastguard Worker; Requires protector.
710*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
711*9880d681SAndroid Build Coastguard Workerdefine void @test5d(i8* %a) #2 {
712*9880d681SAndroid Build Coastguard Workerentry:
713*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test5d:
714*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
715*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
716*9880d681SAndroid Build Coastguard Worker
717*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test5d:
718*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
719*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
720*9880d681SAndroid Build Coastguard Worker
721*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test5d:
722*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
723*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
724*9880d681SAndroid Build Coastguard Worker
725*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test5d:
726*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
727*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
728*9880d681SAndroid Build Coastguard Worker
729*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test5d:
730*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
731*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
732*9880d681SAndroid Build Coastguard Worker  %a.addr = alloca i8*, align 8
733*9880d681SAndroid Build Coastguard Worker  store i8* %a, i8** %a.addr, align 8
734*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %a.addr, align 8
735*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %0)
736*9880d681SAndroid Build Coastguard Worker  ret void
737*9880d681SAndroid Build Coastguard Worker}
738*9880d681SAndroid Build Coastguard Worker
739*9880d681SAndroid Build Coastguard Worker; test6a:  Address-of local taken (j = &a)
740*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
741*9880d681SAndroid Build Coastguard Worker; Requires no protector.
742*9880d681SAndroid Build Coastguard Workerdefine void @test6a() {
743*9880d681SAndroid Build Coastguard Workerentry:
744*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test6a:
745*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
746*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
747*9880d681SAndroid Build Coastguard Worker
748*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test6a:
749*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
750*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
751*9880d681SAndroid Build Coastguard Worker
752*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test6a:
753*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
754*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
755*9880d681SAndroid Build Coastguard Worker
756*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test6a:
757*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
758*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
759*9880d681SAndroid Build Coastguard Worker
760*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test6a:
761*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
762*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
763*9880d681SAndroid Build Coastguard Worker  %retval = alloca i32, align 4
764*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
765*9880d681SAndroid Build Coastguard Worker  %j = alloca i32*, align 8
766*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %retval
767*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %a, align 4
768*9880d681SAndroid Build Coastguard Worker  %add = add nsw i32 %0, 1
769*9880d681SAndroid Build Coastguard Worker  store i32 %add, i32* %a, align 4
770*9880d681SAndroid Build Coastguard Worker  store i32* %a, i32** %j, align 8
771*9880d681SAndroid Build Coastguard Worker  ret void
772*9880d681SAndroid Build Coastguard Worker}
773*9880d681SAndroid Build Coastguard Worker
774*9880d681SAndroid Build Coastguard Worker; test6b:  Address-of local taken (j = &a)
775*9880d681SAndroid Build Coastguard Worker;          ssp attribute
776*9880d681SAndroid Build Coastguard Worker; Requires no protector.
777*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
778*9880d681SAndroid Build Coastguard Workerdefine void @test6b() #0 {
779*9880d681SAndroid Build Coastguard Workerentry:
780*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test6b:
781*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
782*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
783*9880d681SAndroid Build Coastguard Worker
784*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test6b:
785*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
786*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
787*9880d681SAndroid Build Coastguard Worker
788*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test6b:
789*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
790*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
791*9880d681SAndroid Build Coastguard Worker
792*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test6b:
793*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
794*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
795*9880d681SAndroid Build Coastguard Worker
796*9880d681SAndroid Build Coastguard Worker
797*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test6b:
798*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
799*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
800*9880d681SAndroid Build Coastguard Worker  %retval = alloca i32, align 4
801*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
802*9880d681SAndroid Build Coastguard Worker  %j = alloca i32*, align 8
803*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %retval
804*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %a, align 4
805*9880d681SAndroid Build Coastguard Worker  %add = add nsw i32 %0, 1
806*9880d681SAndroid Build Coastguard Worker  store i32 %add, i32* %a, align 4
807*9880d681SAndroid Build Coastguard Worker  store i32* %a, i32** %j, align 8
808*9880d681SAndroid Build Coastguard Worker  ret void
809*9880d681SAndroid Build Coastguard Worker}
810*9880d681SAndroid Build Coastguard Worker
811*9880d681SAndroid Build Coastguard Worker; test6c:  Address-of local taken (j = &a)
812*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
813*9880d681SAndroid Build Coastguard Worker; Requires protector.
814*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
815*9880d681SAndroid Build Coastguard Workerdefine void @test6c() #1 {
816*9880d681SAndroid Build Coastguard Workerentry:
817*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test6c:
818*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
819*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
820*9880d681SAndroid Build Coastguard Worker
821*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test6c:
822*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
823*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
824*9880d681SAndroid Build Coastguard Worker
825*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test6c:
826*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
827*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
828*9880d681SAndroid Build Coastguard Worker
829*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test6c:
830*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
831*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
832*9880d681SAndroid Build Coastguard Worker
833*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test6c:
834*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
835*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
836*9880d681SAndroid Build Coastguard Worker  %retval = alloca i32, align 4
837*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
838*9880d681SAndroid Build Coastguard Worker  %j = alloca i32*, align 8
839*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %retval
840*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %a, align 4
841*9880d681SAndroid Build Coastguard Worker  %add = add nsw i32 %0, 1
842*9880d681SAndroid Build Coastguard Worker  store i32 %add, i32* %a, align 4
843*9880d681SAndroid Build Coastguard Worker  store i32* %a, i32** %j, align 8
844*9880d681SAndroid Build Coastguard Worker  ret void
845*9880d681SAndroid Build Coastguard Worker}
846*9880d681SAndroid Build Coastguard Worker
847*9880d681SAndroid Build Coastguard Worker; test6d:  Address-of local taken (j = &a)
848*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
849*9880d681SAndroid Build Coastguard Worker; Requires protector.
850*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
851*9880d681SAndroid Build Coastguard Workerdefine void @test6d() #2 {
852*9880d681SAndroid Build Coastguard Workerentry:
853*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test6d:
854*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
855*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
856*9880d681SAndroid Build Coastguard Worker
857*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test6d:
858*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
859*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
860*9880d681SAndroid Build Coastguard Worker
861*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test6d:
862*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
863*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
864*9880d681SAndroid Build Coastguard Worker
865*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test6d:
866*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
867*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
868*9880d681SAndroid Build Coastguard Worker
869*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test6d:
870*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
871*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
872*9880d681SAndroid Build Coastguard Worker  %retval = alloca i32, align 4
873*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
874*9880d681SAndroid Build Coastguard Worker  %j = alloca i32*, align 8
875*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %retval
876*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %a, align 4
877*9880d681SAndroid Build Coastguard Worker  %add = add nsw i32 %0, 1
878*9880d681SAndroid Build Coastguard Worker  store i32 %add, i32* %a, align 4
879*9880d681SAndroid Build Coastguard Worker  store i32* %a, i32** %j, align 8
880*9880d681SAndroid Build Coastguard Worker  ret void
881*9880d681SAndroid Build Coastguard Worker}
882*9880d681SAndroid Build Coastguard Worker
883*9880d681SAndroid Build Coastguard Worker; test7a:  PtrToInt Cast
884*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
885*9880d681SAndroid Build Coastguard Worker; Requires no protector.
886*9880d681SAndroid Build Coastguard Workerdefine void @test7a()  {
887*9880d681SAndroid Build Coastguard Workerentry:
888*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test7a:
889*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
890*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
891*9880d681SAndroid Build Coastguard Worker
892*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test7a:
893*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
894*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
895*9880d681SAndroid Build Coastguard Worker
896*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test7a:
897*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
898*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
899*9880d681SAndroid Build Coastguard Worker
900*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test7a:
901*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
902*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
903*9880d681SAndroid Build Coastguard Worker
904*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test7a:
905*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
906*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
907*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
908*9880d681SAndroid Build Coastguard Worker  %0 = ptrtoint i32* %a to i64
909*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 %0)
910*9880d681SAndroid Build Coastguard Worker  ret void
911*9880d681SAndroid Build Coastguard Worker}
912*9880d681SAndroid Build Coastguard Worker
913*9880d681SAndroid Build Coastguard Worker; test7b:  PtrToInt Cast
914*9880d681SAndroid Build Coastguard Worker;          ssp attribute
915*9880d681SAndroid Build Coastguard Worker; Requires no protector.
916*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
917*9880d681SAndroid Build Coastguard Workerdefine void @test7b() #0 {
918*9880d681SAndroid Build Coastguard Workerentry:
919*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test7b:
920*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
921*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
922*9880d681SAndroid Build Coastguard Worker
923*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test7b:
924*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
925*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
926*9880d681SAndroid Build Coastguard Worker
927*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test7b:
928*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
929*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
930*9880d681SAndroid Build Coastguard Worker
931*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test7b:
932*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
933*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
934*9880d681SAndroid Build Coastguard Worker
935*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test7b:
936*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
937*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
938*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
939*9880d681SAndroid Build Coastguard Worker  %0 = ptrtoint i32* %a to i64
940*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 %0)
941*9880d681SAndroid Build Coastguard Worker  ret void
942*9880d681SAndroid Build Coastguard Worker}
943*9880d681SAndroid Build Coastguard Worker
944*9880d681SAndroid Build Coastguard Worker; test7c:  PtrToInt Cast
945*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
946*9880d681SAndroid Build Coastguard Worker; Requires protector.
947*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
948*9880d681SAndroid Build Coastguard Workerdefine void @test7c() #1 {
949*9880d681SAndroid Build Coastguard Workerentry:
950*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test7c:
951*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
952*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
953*9880d681SAndroid Build Coastguard Worker
954*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test7c:
955*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
956*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
957*9880d681SAndroid Build Coastguard Worker
958*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test7c:
959*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
960*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
961*9880d681SAndroid Build Coastguard Worker
962*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test7c:
963*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
964*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
965*9880d681SAndroid Build Coastguard Worker
966*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test7c:
967*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
968*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
969*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
970*9880d681SAndroid Build Coastguard Worker  %0 = ptrtoint i32* %a to i64
971*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 %0)
972*9880d681SAndroid Build Coastguard Worker  ret void
973*9880d681SAndroid Build Coastguard Worker}
974*9880d681SAndroid Build Coastguard Worker
975*9880d681SAndroid Build Coastguard Worker; test7d:  PtrToInt Cast
976*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
977*9880d681SAndroid Build Coastguard Worker; Requires protector.
978*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
979*9880d681SAndroid Build Coastguard Workerdefine void @test7d() #2 {
980*9880d681SAndroid Build Coastguard Workerentry:
981*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test7d:
982*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
983*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
984*9880d681SAndroid Build Coastguard Worker
985*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test7d:
986*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
987*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
988*9880d681SAndroid Build Coastguard Worker
989*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test7d:
990*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
991*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
992*9880d681SAndroid Build Coastguard Worker
993*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test7d:
994*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
995*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
996*9880d681SAndroid Build Coastguard Worker
997*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test7d:
998*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
999*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1000*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
1001*9880d681SAndroid Build Coastguard Worker  %0 = ptrtoint i32* %a to i64
1002*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 %0)
1003*9880d681SAndroid Build Coastguard Worker  ret void
1004*9880d681SAndroid Build Coastguard Worker}
1005*9880d681SAndroid Build Coastguard Worker
1006*9880d681SAndroid Build Coastguard Worker; test8a:  Passing addr-of to function call
1007*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
1008*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1009*9880d681SAndroid Build Coastguard Workerdefine void @test8a() {
1010*9880d681SAndroid Build Coastguard Workerentry:
1011*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test8a:
1012*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1013*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1014*9880d681SAndroid Build Coastguard Worker
1015*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test8a:
1016*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1017*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1018*9880d681SAndroid Build Coastguard Worker
1019*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test8a:
1020*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1021*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1022*9880d681SAndroid Build Coastguard Worker
1023*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test8a:
1024*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1025*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1026*9880d681SAndroid Build Coastguard Worker
1027*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test8a:
1028*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1029*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1030*9880d681SAndroid Build Coastguard Worker  %b = alloca i32, align 4
1031*9880d681SAndroid Build Coastguard Worker  call void @funcall(i32* %b)
1032*9880d681SAndroid Build Coastguard Worker  ret void
1033*9880d681SAndroid Build Coastguard Worker}
1034*9880d681SAndroid Build Coastguard Worker
1035*9880d681SAndroid Build Coastguard Worker; test8b:  Passing addr-of to function call
1036*9880d681SAndroid Build Coastguard Worker;          ssp attribute
1037*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1038*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
1039*9880d681SAndroid Build Coastguard Workerdefine void @test8b() #0 {
1040*9880d681SAndroid Build Coastguard Workerentry:
1041*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test8b:
1042*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1043*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1044*9880d681SAndroid Build Coastguard Worker
1045*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test8b:
1046*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1047*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1048*9880d681SAndroid Build Coastguard Worker
1049*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test8b:
1050*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1051*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1052*9880d681SAndroid Build Coastguard Worker
1053*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test8b:
1054*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1055*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1056*9880d681SAndroid Build Coastguard Worker
1057*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test8b:
1058*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1059*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1060*9880d681SAndroid Build Coastguard Worker  %b = alloca i32, align 4
1061*9880d681SAndroid Build Coastguard Worker  call void @funcall(i32* %b)
1062*9880d681SAndroid Build Coastguard Worker  ret void
1063*9880d681SAndroid Build Coastguard Worker}
1064*9880d681SAndroid Build Coastguard Worker
1065*9880d681SAndroid Build Coastguard Worker; test8c:  Passing addr-of to function call
1066*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
1067*9880d681SAndroid Build Coastguard Worker; Requires protector.
1068*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
1069*9880d681SAndroid Build Coastguard Workerdefine void @test8c() #1 {
1070*9880d681SAndroid Build Coastguard Workerentry:
1071*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test8c:
1072*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1073*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1074*9880d681SAndroid Build Coastguard Worker
1075*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test8c:
1076*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1077*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1078*9880d681SAndroid Build Coastguard Worker
1079*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test8c:
1080*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1081*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1082*9880d681SAndroid Build Coastguard Worker
1083*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test8c:
1084*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1085*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1086*9880d681SAndroid Build Coastguard Worker
1087*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test8c:
1088*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1089*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1090*9880d681SAndroid Build Coastguard Worker  %b = alloca i32, align 4
1091*9880d681SAndroid Build Coastguard Worker  call void @funcall(i32* %b)
1092*9880d681SAndroid Build Coastguard Worker  ret void
1093*9880d681SAndroid Build Coastguard Worker}
1094*9880d681SAndroid Build Coastguard Worker
1095*9880d681SAndroid Build Coastguard Worker; test8d:  Passing addr-of to function call
1096*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
1097*9880d681SAndroid Build Coastguard Worker; Requires protector.
1098*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
1099*9880d681SAndroid Build Coastguard Workerdefine void @test8d() #2 {
1100*9880d681SAndroid Build Coastguard Workerentry:
1101*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test8d:
1102*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1103*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1104*9880d681SAndroid Build Coastguard Worker
1105*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test8d:
1106*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1107*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1108*9880d681SAndroid Build Coastguard Worker
1109*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test8d:
1110*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1111*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1112*9880d681SAndroid Build Coastguard Worker
1113*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test8d:
1114*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1115*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1116*9880d681SAndroid Build Coastguard Worker
1117*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test8d:
1118*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1119*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1120*9880d681SAndroid Build Coastguard Worker  %b = alloca i32, align 4
1121*9880d681SAndroid Build Coastguard Worker  call void @funcall(i32* %b)
1122*9880d681SAndroid Build Coastguard Worker  ret void
1123*9880d681SAndroid Build Coastguard Worker}
1124*9880d681SAndroid Build Coastguard Worker
1125*9880d681SAndroid Build Coastguard Worker; test9a:  Addr-of in select instruction
1126*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
1127*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1128*9880d681SAndroid Build Coastguard Workerdefine void @test9a() {
1129*9880d681SAndroid Build Coastguard Workerentry:
1130*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test9a:
1131*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1132*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1133*9880d681SAndroid Build Coastguard Worker
1134*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test9a:
1135*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1136*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1137*9880d681SAndroid Build Coastguard Worker
1138*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test9a:
1139*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1140*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1141*9880d681SAndroid Build Coastguard Worker
1142*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test9a:
1143*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1144*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1145*9880d681SAndroid Build Coastguard Worker
1146*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test9a:
1147*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1148*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1149*9880d681SAndroid Build Coastguard Worker  %x = alloca double, align 8
1150*9880d681SAndroid Build Coastguard Worker  %call = call double @testi_aux()
1151*9880d681SAndroid Build Coastguard Worker  store double %call, double* %x, align 8
1152*9880d681SAndroid Build Coastguard Worker  %cmp2 = fcmp ogt double %call, 0.000000e+00
1153*9880d681SAndroid Build Coastguard Worker  %y.1 = select i1 %cmp2, double* %x, double* null
1154*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), double* %y.1)
1155*9880d681SAndroid Build Coastguard Worker  ret void
1156*9880d681SAndroid Build Coastguard Worker}
1157*9880d681SAndroid Build Coastguard Worker
1158*9880d681SAndroid Build Coastguard Worker; test9b:  Addr-of in select instruction
1159*9880d681SAndroid Build Coastguard Worker;          ssp attribute
1160*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1161*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
1162*9880d681SAndroid Build Coastguard Workerdefine void @test9b() #0 {
1163*9880d681SAndroid Build Coastguard Workerentry:
1164*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test9b:
1165*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1166*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1167*9880d681SAndroid Build Coastguard Worker
1168*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test9b:
1169*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1170*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1171*9880d681SAndroid Build Coastguard Worker
1172*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test9b:
1173*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1174*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1175*9880d681SAndroid Build Coastguard Worker
1176*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test9b:
1177*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1178*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1179*9880d681SAndroid Build Coastguard Worker
1180*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test9b:
1181*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1182*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1183*9880d681SAndroid Build Coastguard Worker  %x = alloca double, align 8
1184*9880d681SAndroid Build Coastguard Worker  %call = call double @testi_aux()
1185*9880d681SAndroid Build Coastguard Worker  store double %call, double* %x, align 8
1186*9880d681SAndroid Build Coastguard Worker  %cmp2 = fcmp ogt double %call, 0.000000e+00
1187*9880d681SAndroid Build Coastguard Worker  %y.1 = select i1 %cmp2, double* %x, double* null
1188*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), double* %y.1)
1189*9880d681SAndroid Build Coastguard Worker  ret void
1190*9880d681SAndroid Build Coastguard Worker}
1191*9880d681SAndroid Build Coastguard Worker
1192*9880d681SAndroid Build Coastguard Worker; test9c:  Addr-of in select instruction
1193*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
1194*9880d681SAndroid Build Coastguard Worker; Requires protector.
1195*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
1196*9880d681SAndroid Build Coastguard Workerdefine void @test9c() #1 {
1197*9880d681SAndroid Build Coastguard Workerentry:
1198*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test9c:
1199*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1200*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1201*9880d681SAndroid Build Coastguard Worker
1202*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test9c:
1203*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1204*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1205*9880d681SAndroid Build Coastguard Worker
1206*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test9c:
1207*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1208*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1209*9880d681SAndroid Build Coastguard Worker
1210*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test9c:
1211*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1212*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1213*9880d681SAndroid Build Coastguard Worker
1214*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test9c:
1215*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1216*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1217*9880d681SAndroid Build Coastguard Worker  %x = alloca double, align 8
1218*9880d681SAndroid Build Coastguard Worker  %call = call double @testi_aux()
1219*9880d681SAndroid Build Coastguard Worker  store double %call, double* %x, align 8
1220*9880d681SAndroid Build Coastguard Worker  %cmp2 = fcmp ogt double %call, 0.000000e+00
1221*9880d681SAndroid Build Coastguard Worker  %y.1 = select i1 %cmp2, double* %x, double* null
1222*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), double* %y.1)
1223*9880d681SAndroid Build Coastguard Worker  ret void
1224*9880d681SAndroid Build Coastguard Worker}
1225*9880d681SAndroid Build Coastguard Worker
1226*9880d681SAndroid Build Coastguard Worker; test9d:  Addr-of in select instruction
1227*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
1228*9880d681SAndroid Build Coastguard Worker; Requires protector.
1229*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
1230*9880d681SAndroid Build Coastguard Workerdefine void @test9d() #2 {
1231*9880d681SAndroid Build Coastguard Workerentry:
1232*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test9d:
1233*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1234*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1235*9880d681SAndroid Build Coastguard Worker
1236*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test9d:
1237*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1238*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1239*9880d681SAndroid Build Coastguard Worker
1240*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test9d:
1241*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1242*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1243*9880d681SAndroid Build Coastguard Worker
1244*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test9d:
1245*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1246*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1247*9880d681SAndroid Build Coastguard Worker
1248*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test9d:
1249*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1250*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1251*9880d681SAndroid Build Coastguard Worker  %x = alloca double, align 8
1252*9880d681SAndroid Build Coastguard Worker  %call = call double @testi_aux()
1253*9880d681SAndroid Build Coastguard Worker  store double %call, double* %x, align 8
1254*9880d681SAndroid Build Coastguard Worker  %cmp2 = fcmp ogt double %call, 0.000000e+00
1255*9880d681SAndroid Build Coastguard Worker  %y.1 = select i1 %cmp2, double* %x, double* null
1256*9880d681SAndroid Build Coastguard Worker  %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), double* %y.1)
1257*9880d681SAndroid Build Coastguard Worker  ret void
1258*9880d681SAndroid Build Coastguard Worker}
1259*9880d681SAndroid Build Coastguard Worker
1260*9880d681SAndroid Build Coastguard Worker; test10a: Addr-of in phi instruction
1261*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
1262*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1263*9880d681SAndroid Build Coastguard Workerdefine void @test10a() {
1264*9880d681SAndroid Build Coastguard Workerentry:
1265*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test10a:
1266*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1267*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1268*9880d681SAndroid Build Coastguard Worker
1269*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test10a:
1270*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1271*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1272*9880d681SAndroid Build Coastguard Worker
1273*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test10a:
1274*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1275*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1276*9880d681SAndroid Build Coastguard Worker
1277*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test10a:
1278*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1279*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1280*9880d681SAndroid Build Coastguard Worker
1281*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test10a:
1282*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1283*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1284*9880d681SAndroid Build Coastguard Worker  %x = alloca double, align 8
1285*9880d681SAndroid Build Coastguard Worker  %call = call double @testi_aux()
1286*9880d681SAndroid Build Coastguard Worker  store double %call, double* %x, align 8
1287*9880d681SAndroid Build Coastguard Worker  %cmp = fcmp ogt double %call, 3.140000e+00
1288*9880d681SAndroid Build Coastguard Worker  br i1 %cmp, label %if.then, label %if.else
1289*9880d681SAndroid Build Coastguard Worker
1290*9880d681SAndroid Build Coastguard Workerif.then:                                          ; preds = %entry
1291*9880d681SAndroid Build Coastguard Worker  %call1 = call double @testi_aux()
1292*9880d681SAndroid Build Coastguard Worker  store double %call1, double* %x, align 8
1293*9880d681SAndroid Build Coastguard Worker  br label %if.end4
1294*9880d681SAndroid Build Coastguard Worker
1295*9880d681SAndroid Build Coastguard Workerif.else:                                          ; preds = %entry
1296*9880d681SAndroid Build Coastguard Worker  %cmp2 = fcmp ogt double %call, 1.000000e+00
1297*9880d681SAndroid Build Coastguard Worker  br i1 %cmp2, label %if.then3, label %if.end4
1298*9880d681SAndroid Build Coastguard Worker
1299*9880d681SAndroid Build Coastguard Workerif.then3:                                         ; preds = %if.else
1300*9880d681SAndroid Build Coastguard Worker  br label %if.end4
1301*9880d681SAndroid Build Coastguard Worker
1302*9880d681SAndroid Build Coastguard Workerif.end4:                                          ; preds = %if.else, %if.then3, %if.then
1303*9880d681SAndroid Build Coastguard Worker  %y.0 = phi double* [ null, %if.then ], [ %x, %if.then3 ], [ null, %if.else ]
1304*9880d681SAndroid Build Coastguard Worker  %call5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %y.0)
1305*9880d681SAndroid Build Coastguard Worker  ret void
1306*9880d681SAndroid Build Coastguard Worker}
1307*9880d681SAndroid Build Coastguard Worker
1308*9880d681SAndroid Build Coastguard Worker; test10b: Addr-of in phi instruction
1309*9880d681SAndroid Build Coastguard Worker;          ssp attribute
1310*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1311*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
1312*9880d681SAndroid Build Coastguard Workerdefine void @test10b() #0 {
1313*9880d681SAndroid Build Coastguard Workerentry:
1314*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test10b:
1315*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1316*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1317*9880d681SAndroid Build Coastguard Worker
1318*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test10b:
1319*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1320*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1321*9880d681SAndroid Build Coastguard Worker
1322*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test10b:
1323*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1324*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1325*9880d681SAndroid Build Coastguard Worker
1326*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test10b:
1327*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1328*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1329*9880d681SAndroid Build Coastguard Worker
1330*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test10b:
1331*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1332*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1333*9880d681SAndroid Build Coastguard Worker  %x = alloca double, align 8
1334*9880d681SAndroid Build Coastguard Worker  %call = call double @testi_aux()
1335*9880d681SAndroid Build Coastguard Worker  store double %call, double* %x, align 8
1336*9880d681SAndroid Build Coastguard Worker  %cmp = fcmp ogt double %call, 3.140000e+00
1337*9880d681SAndroid Build Coastguard Worker  br i1 %cmp, label %if.then, label %if.else
1338*9880d681SAndroid Build Coastguard Worker
1339*9880d681SAndroid Build Coastguard Workerif.then:                                          ; preds = %entry
1340*9880d681SAndroid Build Coastguard Worker  %call1 = call double @testi_aux()
1341*9880d681SAndroid Build Coastguard Worker  store double %call1, double* %x, align 8
1342*9880d681SAndroid Build Coastguard Worker  br label %if.end4
1343*9880d681SAndroid Build Coastguard Worker
1344*9880d681SAndroid Build Coastguard Workerif.else:                                          ; preds = %entry
1345*9880d681SAndroid Build Coastguard Worker  %cmp2 = fcmp ogt double %call, 1.000000e+00
1346*9880d681SAndroid Build Coastguard Worker  br i1 %cmp2, label %if.then3, label %if.end4
1347*9880d681SAndroid Build Coastguard Worker
1348*9880d681SAndroid Build Coastguard Workerif.then3:                                         ; preds = %if.else
1349*9880d681SAndroid Build Coastguard Worker  br label %if.end4
1350*9880d681SAndroid Build Coastguard Worker
1351*9880d681SAndroid Build Coastguard Workerif.end4:                                          ; preds = %if.else, %if.then3, %if.then
1352*9880d681SAndroid Build Coastguard Worker  %y.0 = phi double* [ null, %if.then ], [ %x, %if.then3 ], [ null, %if.else ]
1353*9880d681SAndroid Build Coastguard Worker  %call5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %y.0)
1354*9880d681SAndroid Build Coastguard Worker  ret void
1355*9880d681SAndroid Build Coastguard Worker}
1356*9880d681SAndroid Build Coastguard Worker
1357*9880d681SAndroid Build Coastguard Worker; test10c: Addr-of in phi instruction
1358*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
1359*9880d681SAndroid Build Coastguard Worker; Requires protector.
1360*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
1361*9880d681SAndroid Build Coastguard Workerdefine void @test10c() #1 {
1362*9880d681SAndroid Build Coastguard Workerentry:
1363*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test10c:
1364*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1365*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1366*9880d681SAndroid Build Coastguard Worker
1367*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test10c:
1368*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1369*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1370*9880d681SAndroid Build Coastguard Worker
1371*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test10c:
1372*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1373*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1374*9880d681SAndroid Build Coastguard Worker
1375*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test10c:
1376*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1377*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1378*9880d681SAndroid Build Coastguard Worker
1379*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test10c:
1380*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1381*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1382*9880d681SAndroid Build Coastguard Worker  %x = alloca double, align 8
1383*9880d681SAndroid Build Coastguard Worker  %call = call double @testi_aux()
1384*9880d681SAndroid Build Coastguard Worker  store double %call, double* %x, align 8
1385*9880d681SAndroid Build Coastguard Worker  %cmp = fcmp ogt double %call, 3.140000e+00
1386*9880d681SAndroid Build Coastguard Worker  br i1 %cmp, label %if.then, label %if.else
1387*9880d681SAndroid Build Coastguard Worker
1388*9880d681SAndroid Build Coastguard Workerif.then:                                          ; preds = %entry
1389*9880d681SAndroid Build Coastguard Worker  %call1 = call double @testi_aux()
1390*9880d681SAndroid Build Coastguard Worker  store double %call1, double* %x, align 8
1391*9880d681SAndroid Build Coastguard Worker  br label %if.end4
1392*9880d681SAndroid Build Coastguard Worker
1393*9880d681SAndroid Build Coastguard Workerif.else:                                          ; preds = %entry
1394*9880d681SAndroid Build Coastguard Worker  %cmp2 = fcmp ogt double %call, 1.000000e+00
1395*9880d681SAndroid Build Coastguard Worker  br i1 %cmp2, label %if.then3, label %if.end4
1396*9880d681SAndroid Build Coastguard Worker
1397*9880d681SAndroid Build Coastguard Workerif.then3:                                         ; preds = %if.else
1398*9880d681SAndroid Build Coastguard Worker  br label %if.end4
1399*9880d681SAndroid Build Coastguard Worker
1400*9880d681SAndroid Build Coastguard Workerif.end4:                                          ; preds = %if.else, %if.then3, %if.then
1401*9880d681SAndroid Build Coastguard Worker  %y.0 = phi double* [ null, %if.then ], [ %x, %if.then3 ], [ null, %if.else ]
1402*9880d681SAndroid Build Coastguard Worker  %call5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %y.0)
1403*9880d681SAndroid Build Coastguard Worker  ret void
1404*9880d681SAndroid Build Coastguard Worker}
1405*9880d681SAndroid Build Coastguard Worker
1406*9880d681SAndroid Build Coastguard Worker; test10d: Addr-of in phi instruction
1407*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
1408*9880d681SAndroid Build Coastguard Worker; Requires protector.
1409*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
1410*9880d681SAndroid Build Coastguard Workerdefine void @test10d() #2 {
1411*9880d681SAndroid Build Coastguard Workerentry:
1412*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test10d:
1413*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1414*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1415*9880d681SAndroid Build Coastguard Worker
1416*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test10d:
1417*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1418*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1419*9880d681SAndroid Build Coastguard Worker
1420*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test10d:
1421*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1422*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1423*9880d681SAndroid Build Coastguard Worker
1424*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test10d:
1425*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1426*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1427*9880d681SAndroid Build Coastguard Worker
1428*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test10d:
1429*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1430*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1431*9880d681SAndroid Build Coastguard Worker  %x = alloca double, align 8
1432*9880d681SAndroid Build Coastguard Worker  %call = call double @testi_aux()
1433*9880d681SAndroid Build Coastguard Worker  store double %call, double* %x, align 8
1434*9880d681SAndroid Build Coastguard Worker  %cmp = fcmp ogt double %call, 3.140000e+00
1435*9880d681SAndroid Build Coastguard Worker  br i1 %cmp, label %if.then, label %if.else
1436*9880d681SAndroid Build Coastguard Worker
1437*9880d681SAndroid Build Coastguard Workerif.then:                                          ; preds = %entry
1438*9880d681SAndroid Build Coastguard Worker  %call1 = call double @testi_aux()
1439*9880d681SAndroid Build Coastguard Worker  store double %call1, double* %x, align 8
1440*9880d681SAndroid Build Coastguard Worker  br label %if.end4
1441*9880d681SAndroid Build Coastguard Worker
1442*9880d681SAndroid Build Coastguard Workerif.else:                                          ; preds = %entry
1443*9880d681SAndroid Build Coastguard Worker  %cmp2 = fcmp ogt double %call, 1.000000e+00
1444*9880d681SAndroid Build Coastguard Worker  br i1 %cmp2, label %if.then3, label %if.end4
1445*9880d681SAndroid Build Coastguard Worker
1446*9880d681SAndroid Build Coastguard Workerif.then3:                                         ; preds = %if.else
1447*9880d681SAndroid Build Coastguard Worker  br label %if.end4
1448*9880d681SAndroid Build Coastguard Worker
1449*9880d681SAndroid Build Coastguard Workerif.end4:                                          ; preds = %if.else, %if.then3, %if.then
1450*9880d681SAndroid Build Coastguard Worker  %y.0 = phi double* [ null, %if.then ], [ %x, %if.then3 ], [ null, %if.else ]
1451*9880d681SAndroid Build Coastguard Worker  %call5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %y.0)
1452*9880d681SAndroid Build Coastguard Worker  ret void
1453*9880d681SAndroid Build Coastguard Worker}
1454*9880d681SAndroid Build Coastguard Worker
1455*9880d681SAndroid Build Coastguard Worker; test11a: Addr-of struct element. (GEP followed by store).
1456*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
1457*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1458*9880d681SAndroid Build Coastguard Workerdefine void @test11a() {
1459*9880d681SAndroid Build Coastguard Workerentry:
1460*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test11a:
1461*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1462*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1463*9880d681SAndroid Build Coastguard Worker
1464*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test11a:
1465*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1466*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1467*9880d681SAndroid Build Coastguard Worker
1468*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test11a:
1469*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1470*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1471*9880d681SAndroid Build Coastguard Worker
1472*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test11a:
1473*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1474*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1475*9880d681SAndroid Build Coastguard Worker
1476*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test11a:
1477*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1478*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1479*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1480*9880d681SAndroid Build Coastguard Worker  %b = alloca i32*, align 8
1481*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 1
1482*9880d681SAndroid Build Coastguard Worker  store i32* %y, i32** %b, align 8
1483*9880d681SAndroid Build Coastguard Worker  %0 = load i32*, i32** %b, align 8
1484*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32* %0)
1485*9880d681SAndroid Build Coastguard Worker  ret void
1486*9880d681SAndroid Build Coastguard Worker}
1487*9880d681SAndroid Build Coastguard Worker
1488*9880d681SAndroid Build Coastguard Worker; test11b: Addr-of struct element. (GEP followed by store).
1489*9880d681SAndroid Build Coastguard Worker;          ssp attribute
1490*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1491*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
1492*9880d681SAndroid Build Coastguard Workerdefine void @test11b() #0 {
1493*9880d681SAndroid Build Coastguard Workerentry:
1494*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test11b:
1495*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1496*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1497*9880d681SAndroid Build Coastguard Worker
1498*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test11b:
1499*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1500*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1501*9880d681SAndroid Build Coastguard Worker
1502*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test11b:
1503*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1504*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1505*9880d681SAndroid Build Coastguard Worker
1506*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test11b:
1507*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1508*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1509*9880d681SAndroid Build Coastguard Worker
1510*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test11b:
1511*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1512*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1513*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1514*9880d681SAndroid Build Coastguard Worker  %b = alloca i32*, align 8
1515*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 1
1516*9880d681SAndroid Build Coastguard Worker  store i32* %y, i32** %b, align 8
1517*9880d681SAndroid Build Coastguard Worker  %0 = load i32*, i32** %b, align 8
1518*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32* %0)
1519*9880d681SAndroid Build Coastguard Worker  ret void
1520*9880d681SAndroid Build Coastguard Worker}
1521*9880d681SAndroid Build Coastguard Worker
1522*9880d681SAndroid Build Coastguard Worker; test11c: Addr-of struct element. (GEP followed by store).
1523*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
1524*9880d681SAndroid Build Coastguard Worker; Requires protector.
1525*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
1526*9880d681SAndroid Build Coastguard Workerdefine void @test11c() #1 {
1527*9880d681SAndroid Build Coastguard Workerentry:
1528*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test11c:
1529*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1530*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1531*9880d681SAndroid Build Coastguard Worker
1532*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test11c:
1533*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1534*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1535*9880d681SAndroid Build Coastguard Worker
1536*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test11c:
1537*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1538*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1539*9880d681SAndroid Build Coastguard Worker
1540*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test11c:
1541*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1542*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1543*9880d681SAndroid Build Coastguard Worker
1544*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test11c:
1545*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1546*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1547*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1548*9880d681SAndroid Build Coastguard Worker  %b = alloca i32*, align 8
1549*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 1
1550*9880d681SAndroid Build Coastguard Worker  store i32* %y, i32** %b, align 8
1551*9880d681SAndroid Build Coastguard Worker  %0 = load i32*, i32** %b, align 8
1552*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32* %0)
1553*9880d681SAndroid Build Coastguard Worker  ret void
1554*9880d681SAndroid Build Coastguard Worker}
1555*9880d681SAndroid Build Coastguard Worker
1556*9880d681SAndroid Build Coastguard Worker; test11d: Addr-of struct element. (GEP followed by store).
1557*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
1558*9880d681SAndroid Build Coastguard Worker; Requires protector.
1559*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
1560*9880d681SAndroid Build Coastguard Workerdefine void @test11d() #2 {
1561*9880d681SAndroid Build Coastguard Workerentry:
1562*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test11d:
1563*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1564*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1565*9880d681SAndroid Build Coastguard Worker
1566*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test11d:
1567*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1568*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1569*9880d681SAndroid Build Coastguard Worker
1570*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test11d:
1571*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1572*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1573*9880d681SAndroid Build Coastguard Worker
1574*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test11d:
1575*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1576*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1577*9880d681SAndroid Build Coastguard Worker
1578*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test11d:
1579*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1580*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1581*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1582*9880d681SAndroid Build Coastguard Worker  %b = alloca i32*, align 8
1583*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 1
1584*9880d681SAndroid Build Coastguard Worker  store i32* %y, i32** %b, align 8
1585*9880d681SAndroid Build Coastguard Worker  %0 = load i32*, i32** %b, align 8
1586*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32* %0)
1587*9880d681SAndroid Build Coastguard Worker  ret void
1588*9880d681SAndroid Build Coastguard Worker}
1589*9880d681SAndroid Build Coastguard Worker
1590*9880d681SAndroid Build Coastguard Worker; test12a: Addr-of struct element, GEP followed by ptrtoint.
1591*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
1592*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1593*9880d681SAndroid Build Coastguard Workerdefine void @test12a() {
1594*9880d681SAndroid Build Coastguard Workerentry:
1595*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test12a:
1596*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1597*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1598*9880d681SAndroid Build Coastguard Worker
1599*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test12a:
1600*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1601*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1602*9880d681SAndroid Build Coastguard Worker
1603*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test12a:
1604*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1605*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1606*9880d681SAndroid Build Coastguard Worker
1607*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test12a:
1608*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1609*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1610*9880d681SAndroid Build Coastguard Worker
1611*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test12a:
1612*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1613*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1614*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1615*9880d681SAndroid Build Coastguard Worker  %b = alloca i32*, align 8
1616*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 1
1617*9880d681SAndroid Build Coastguard Worker  %0 = ptrtoint i32* %y to i64
1618*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 %0)
1619*9880d681SAndroid Build Coastguard Worker  ret void
1620*9880d681SAndroid Build Coastguard Worker}
1621*9880d681SAndroid Build Coastguard Worker
1622*9880d681SAndroid Build Coastguard Worker; test12b: Addr-of struct element, GEP followed by ptrtoint.
1623*9880d681SAndroid Build Coastguard Worker;          ssp attribute
1624*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1625*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
1626*9880d681SAndroid Build Coastguard Workerdefine void @test12b() #0 {
1627*9880d681SAndroid Build Coastguard Workerentry:
1628*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test12b:
1629*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1630*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1631*9880d681SAndroid Build Coastguard Worker
1632*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test12b:
1633*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1634*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1635*9880d681SAndroid Build Coastguard Worker
1636*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test12b:
1637*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1638*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1639*9880d681SAndroid Build Coastguard Worker
1640*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test12b:
1641*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1642*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1643*9880d681SAndroid Build Coastguard Worker
1644*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test12b:
1645*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1646*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1647*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1648*9880d681SAndroid Build Coastguard Worker  %b = alloca i32*, align 8
1649*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 1
1650*9880d681SAndroid Build Coastguard Worker  %0 = ptrtoint i32* %y to i64
1651*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 %0)
1652*9880d681SAndroid Build Coastguard Worker  ret void
1653*9880d681SAndroid Build Coastguard Worker}
1654*9880d681SAndroid Build Coastguard Worker
1655*9880d681SAndroid Build Coastguard Worker; test12c: Addr-of struct element, GEP followed by ptrtoint.
1656*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
1657*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
1658*9880d681SAndroid Build Coastguard Workerdefine void @test12c() #1 {
1659*9880d681SAndroid Build Coastguard Workerentry:
1660*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test12c:
1661*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1662*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1663*9880d681SAndroid Build Coastguard Worker
1664*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test12c:
1665*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1666*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1667*9880d681SAndroid Build Coastguard Worker
1668*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test12c:
1669*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1670*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1671*9880d681SAndroid Build Coastguard Worker
1672*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test12c:
1673*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1674*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1675*9880d681SAndroid Build Coastguard Worker
1676*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test12c:
1677*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1678*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1679*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1680*9880d681SAndroid Build Coastguard Worker  %b = alloca i32*, align 8
1681*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 1
1682*9880d681SAndroid Build Coastguard Worker  %0 = ptrtoint i32* %y to i64
1683*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 %0)
1684*9880d681SAndroid Build Coastguard Worker  ret void
1685*9880d681SAndroid Build Coastguard Worker}
1686*9880d681SAndroid Build Coastguard Worker
1687*9880d681SAndroid Build Coastguard Worker; test12d: Addr-of struct element, GEP followed by ptrtoint.
1688*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
1689*9880d681SAndroid Build Coastguard Worker; Requires protector.
1690*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
1691*9880d681SAndroid Build Coastguard Workerdefine void @test12d() #2 {
1692*9880d681SAndroid Build Coastguard Workerentry:
1693*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test12d:
1694*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1695*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1696*9880d681SAndroid Build Coastguard Worker
1697*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test12d:
1698*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1699*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1700*9880d681SAndroid Build Coastguard Worker
1701*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test12d:
1702*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1703*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1704*9880d681SAndroid Build Coastguard Worker
1705*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test12d:
1706*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1707*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1708*9880d681SAndroid Build Coastguard Worker
1709*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test12d:
1710*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1711*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1712*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1713*9880d681SAndroid Build Coastguard Worker  %b = alloca i32*, align 8
1714*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 1
1715*9880d681SAndroid Build Coastguard Worker  %0 = ptrtoint i32* %y to i64
1716*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 %0)
1717*9880d681SAndroid Build Coastguard Worker  ret void
1718*9880d681SAndroid Build Coastguard Worker}
1719*9880d681SAndroid Build Coastguard Worker
1720*9880d681SAndroid Build Coastguard Worker; test13a: Addr-of struct element, GEP followed by callinst.
1721*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
1722*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1723*9880d681SAndroid Build Coastguard Workerdefine void @test13a() {
1724*9880d681SAndroid Build Coastguard Workerentry:
1725*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test13a:
1726*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1727*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1728*9880d681SAndroid Build Coastguard Worker
1729*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test13a:
1730*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1731*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1732*9880d681SAndroid Build Coastguard Worker
1733*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test13a:
1734*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1735*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1736*9880d681SAndroid Build Coastguard Worker
1737*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test13a:
1738*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1739*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1740*9880d681SAndroid Build Coastguard Worker
1741*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test13a:
1742*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1743*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1744*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1745*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i64 0, i32 1
1746*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %y)
1747*9880d681SAndroid Build Coastguard Worker  ret void
1748*9880d681SAndroid Build Coastguard Worker}
1749*9880d681SAndroid Build Coastguard Worker
1750*9880d681SAndroid Build Coastguard Worker; test13b: Addr-of struct element, GEP followed by callinst.
1751*9880d681SAndroid Build Coastguard Worker;          ssp attribute
1752*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1753*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
1754*9880d681SAndroid Build Coastguard Workerdefine void @test13b() #0 {
1755*9880d681SAndroid Build Coastguard Workerentry:
1756*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test13b:
1757*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1758*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1759*9880d681SAndroid Build Coastguard Worker
1760*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test13b:
1761*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1762*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1763*9880d681SAndroid Build Coastguard Worker
1764*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test13b:
1765*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1766*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1767*9880d681SAndroid Build Coastguard Worker
1768*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test13b:
1769*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1770*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1771*9880d681SAndroid Build Coastguard Worker
1772*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test13b:
1773*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1774*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1775*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1776*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i64 0, i32 1
1777*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %y)
1778*9880d681SAndroid Build Coastguard Worker  ret void
1779*9880d681SAndroid Build Coastguard Worker}
1780*9880d681SAndroid Build Coastguard Worker
1781*9880d681SAndroid Build Coastguard Worker; test13c: Addr-of struct element, GEP followed by callinst.
1782*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
1783*9880d681SAndroid Build Coastguard Worker; Requires protector.
1784*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
1785*9880d681SAndroid Build Coastguard Workerdefine void @test13c() #1 {
1786*9880d681SAndroid Build Coastguard Workerentry:
1787*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test13c:
1788*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1789*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1790*9880d681SAndroid Build Coastguard Worker
1791*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test13c:
1792*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1793*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1794*9880d681SAndroid Build Coastguard Worker
1795*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test13c:
1796*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1797*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1798*9880d681SAndroid Build Coastguard Worker
1799*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test13c:
1800*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1801*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1802*9880d681SAndroid Build Coastguard Worker
1803*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test13c:
1804*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1805*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1806*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1807*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i64 0, i32 1
1808*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %y)
1809*9880d681SAndroid Build Coastguard Worker  ret void
1810*9880d681SAndroid Build Coastguard Worker}
1811*9880d681SAndroid Build Coastguard Worker
1812*9880d681SAndroid Build Coastguard Worker; test13d: Addr-of struct element, GEP followed by callinst.
1813*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
1814*9880d681SAndroid Build Coastguard Worker; Requires protector.
1815*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
1816*9880d681SAndroid Build Coastguard Workerdefine void @test13d() #2 {
1817*9880d681SAndroid Build Coastguard Workerentry:
1818*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test13d:
1819*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1820*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1821*9880d681SAndroid Build Coastguard Worker
1822*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test13d:
1823*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1824*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1825*9880d681SAndroid Build Coastguard Worker
1826*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test13d:
1827*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1828*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1829*9880d681SAndroid Build Coastguard Worker
1830*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test13d:
1831*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1832*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1833*9880d681SAndroid Build Coastguard Worker
1834*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test13d:
1835*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1836*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1837*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
1838*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.pair, %struct.pair* %c, i64 0, i32 1
1839*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %y)
1840*9880d681SAndroid Build Coastguard Worker  ret void
1841*9880d681SAndroid Build Coastguard Worker}
1842*9880d681SAndroid Build Coastguard Worker
1843*9880d681SAndroid Build Coastguard Worker; test14a: Addr-of a local, optimized into a GEP (e.g., &a - 12)
1844*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
1845*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1846*9880d681SAndroid Build Coastguard Workerdefine void @test14a() {
1847*9880d681SAndroid Build Coastguard Workerentry:
1848*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test14a:
1849*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1850*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1851*9880d681SAndroid Build Coastguard Worker
1852*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test14a:
1853*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1854*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1855*9880d681SAndroid Build Coastguard Worker
1856*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test14a:
1857*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1858*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1859*9880d681SAndroid Build Coastguard Worker
1860*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test14a:
1861*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1862*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1863*9880d681SAndroid Build Coastguard Worker
1864*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test14a:
1865*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1866*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1867*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
1868*9880d681SAndroid Build Coastguard Worker  %add.ptr5 = getelementptr inbounds i32, i32* %a, i64 -12
1869*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %add.ptr5)
1870*9880d681SAndroid Build Coastguard Worker  ret void
1871*9880d681SAndroid Build Coastguard Worker}
1872*9880d681SAndroid Build Coastguard Worker
1873*9880d681SAndroid Build Coastguard Worker; test14b: Addr-of a local, optimized into a GEP (e.g., &a - 12)
1874*9880d681SAndroid Build Coastguard Worker;          ssp attribute
1875*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1876*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
1877*9880d681SAndroid Build Coastguard Workerdefine void @test14b() #0 {
1878*9880d681SAndroid Build Coastguard Workerentry:
1879*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test14b:
1880*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1881*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1882*9880d681SAndroid Build Coastguard Worker
1883*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test14b:
1884*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1885*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1886*9880d681SAndroid Build Coastguard Worker
1887*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test14b:
1888*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1889*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1890*9880d681SAndroid Build Coastguard Worker
1891*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test14b:
1892*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1893*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1894*9880d681SAndroid Build Coastguard Worker
1895*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test14b:
1896*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1897*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1898*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
1899*9880d681SAndroid Build Coastguard Worker  %add.ptr5 = getelementptr inbounds i32, i32* %a, i64 -12
1900*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %add.ptr5)
1901*9880d681SAndroid Build Coastguard Worker  ret void
1902*9880d681SAndroid Build Coastguard Worker}
1903*9880d681SAndroid Build Coastguard Worker
1904*9880d681SAndroid Build Coastguard Worker; test14c: Addr-of a local, optimized into a GEP (e.g., &a - 12)
1905*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
1906*9880d681SAndroid Build Coastguard Worker; Requires protector.
1907*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
1908*9880d681SAndroid Build Coastguard Workerdefine void @test14c() #1 {
1909*9880d681SAndroid Build Coastguard Workerentry:
1910*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test14c:
1911*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1912*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1913*9880d681SAndroid Build Coastguard Worker
1914*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test14c:
1915*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1916*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1917*9880d681SAndroid Build Coastguard Worker
1918*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test14c:
1919*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1920*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1921*9880d681SAndroid Build Coastguard Worker
1922*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test14c:
1923*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1924*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1925*9880d681SAndroid Build Coastguard Worker
1926*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test14c:
1927*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1928*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1929*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
1930*9880d681SAndroid Build Coastguard Worker  %add.ptr5 = getelementptr inbounds i32, i32* %a, i64 -12
1931*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %add.ptr5)
1932*9880d681SAndroid Build Coastguard Worker  ret void
1933*9880d681SAndroid Build Coastguard Worker}
1934*9880d681SAndroid Build Coastguard Worker
1935*9880d681SAndroid Build Coastguard Worker; test14d: Addr-of a local, optimized into a GEP (e.g., &a - 12)
1936*9880d681SAndroid Build Coastguard Worker;          sspreq  attribute
1937*9880d681SAndroid Build Coastguard Worker; Requires protector.
1938*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
1939*9880d681SAndroid Build Coastguard Workerdefine void @test14d() #2 {
1940*9880d681SAndroid Build Coastguard Workerentry:
1941*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test14d:
1942*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
1943*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
1944*9880d681SAndroid Build Coastguard Worker
1945*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test14d:
1946*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
1947*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
1948*9880d681SAndroid Build Coastguard Worker
1949*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test14d:
1950*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
1951*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
1952*9880d681SAndroid Build Coastguard Worker
1953*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test14d:
1954*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
1955*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
1956*9880d681SAndroid Build Coastguard Worker
1957*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test14d:
1958*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
1959*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
1960*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
1961*9880d681SAndroid Build Coastguard Worker  %add.ptr5 = getelementptr inbounds i32, i32* %a, i64 -12
1962*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %add.ptr5)
1963*9880d681SAndroid Build Coastguard Worker  ret void
1964*9880d681SAndroid Build Coastguard Worker}
1965*9880d681SAndroid Build Coastguard Worker
1966*9880d681SAndroid Build Coastguard Worker; test15a: Addr-of a local cast to a ptr of a different type
1967*9880d681SAndroid Build Coastguard Worker;           (e.g., int a; ... ; float *b = &a;)
1968*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
1969*9880d681SAndroid Build Coastguard Worker; Requires no protector.
1970*9880d681SAndroid Build Coastguard Workerdefine void @test15a() {
1971*9880d681SAndroid Build Coastguard Workerentry:
1972*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test15a:
1973*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
1974*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
1975*9880d681SAndroid Build Coastguard Worker
1976*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test15a:
1977*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
1978*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
1979*9880d681SAndroid Build Coastguard Worker
1980*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test15a:
1981*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
1982*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
1983*9880d681SAndroid Build Coastguard Worker
1984*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test15a:
1985*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
1986*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
1987*9880d681SAndroid Build Coastguard Worker
1988*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test15a:
1989*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
1990*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
1991*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
1992*9880d681SAndroid Build Coastguard Worker  %b = alloca float*, align 8
1993*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
1994*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32* %a to float*
1995*9880d681SAndroid Build Coastguard Worker  store float* %0, float** %b, align 8
1996*9880d681SAndroid Build Coastguard Worker  %1 = load float*, float** %b, align 8
1997*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), float* %1)
1998*9880d681SAndroid Build Coastguard Worker  ret void
1999*9880d681SAndroid Build Coastguard Worker}
2000*9880d681SAndroid Build Coastguard Worker
2001*9880d681SAndroid Build Coastguard Worker; test15b: Addr-of a local cast to a ptr of a different type
2002*9880d681SAndroid Build Coastguard Worker;           (e.g., int a; ... ; float *b = &a;)
2003*9880d681SAndroid Build Coastguard Worker;          ssp attribute
2004*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2005*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
2006*9880d681SAndroid Build Coastguard Workerdefine void @test15b() #0 {
2007*9880d681SAndroid Build Coastguard Workerentry:
2008*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test15b:
2009*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2010*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2011*9880d681SAndroid Build Coastguard Worker
2012*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test15b:
2013*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2014*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2015*9880d681SAndroid Build Coastguard Worker
2016*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test15b:
2017*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2018*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2019*9880d681SAndroid Build Coastguard Worker
2020*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test15b:
2021*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2022*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2023*9880d681SAndroid Build Coastguard Worker
2024*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test15b:
2025*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2026*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2027*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2028*9880d681SAndroid Build Coastguard Worker  %b = alloca float*, align 8
2029*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2030*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32* %a to float*
2031*9880d681SAndroid Build Coastguard Worker  store float* %0, float** %b, align 8
2032*9880d681SAndroid Build Coastguard Worker  %1 = load float*, float** %b, align 8
2033*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), float* %1)
2034*9880d681SAndroid Build Coastguard Worker  ret void
2035*9880d681SAndroid Build Coastguard Worker}
2036*9880d681SAndroid Build Coastguard Worker
2037*9880d681SAndroid Build Coastguard Worker; test15c: Addr-of a local cast to a ptr of a different type
2038*9880d681SAndroid Build Coastguard Worker;           (e.g., int a; ... ; float *b = &a;)
2039*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
2040*9880d681SAndroid Build Coastguard Worker; Requires protector.
2041*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
2042*9880d681SAndroid Build Coastguard Workerdefine void @test15c() #1 {
2043*9880d681SAndroid Build Coastguard Workerentry:
2044*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test15c:
2045*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2046*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2047*9880d681SAndroid Build Coastguard Worker
2048*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test15c:
2049*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2050*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2051*9880d681SAndroid Build Coastguard Worker
2052*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test15c:
2053*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2054*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2055*9880d681SAndroid Build Coastguard Worker
2056*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test15c:
2057*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2058*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2059*9880d681SAndroid Build Coastguard Worker
2060*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test15c:
2061*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2062*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2063*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2064*9880d681SAndroid Build Coastguard Worker  %b = alloca float*, align 8
2065*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2066*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32* %a to float*
2067*9880d681SAndroid Build Coastguard Worker  store float* %0, float** %b, align 8
2068*9880d681SAndroid Build Coastguard Worker  %1 = load float*, float** %b, align 8
2069*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), float* %1)
2070*9880d681SAndroid Build Coastguard Worker  ret void
2071*9880d681SAndroid Build Coastguard Worker}
2072*9880d681SAndroid Build Coastguard Worker
2073*9880d681SAndroid Build Coastguard Worker; test15d: Addr-of a local cast to a ptr of a different type
2074*9880d681SAndroid Build Coastguard Worker;           (e.g., int a; ... ; float *b = &a;)
2075*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
2076*9880d681SAndroid Build Coastguard Worker; Requires protector.
2077*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
2078*9880d681SAndroid Build Coastguard Workerdefine void @test15d() #2 {
2079*9880d681SAndroid Build Coastguard Workerentry:
2080*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test15d:
2081*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2082*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2083*9880d681SAndroid Build Coastguard Worker
2084*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test15d:
2085*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2086*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2087*9880d681SAndroid Build Coastguard Worker
2088*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test15d:
2089*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2090*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2091*9880d681SAndroid Build Coastguard Worker
2092*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test15d:
2093*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2094*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2095*9880d681SAndroid Build Coastguard Worker
2096*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test15d:
2097*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2098*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2099*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2100*9880d681SAndroid Build Coastguard Worker  %b = alloca float*, align 8
2101*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2102*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32* %a to float*
2103*9880d681SAndroid Build Coastguard Worker  store float* %0, float** %b, align 8
2104*9880d681SAndroid Build Coastguard Worker  %1 = load float*, float** %b, align 8
2105*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), float* %1)
2106*9880d681SAndroid Build Coastguard Worker  ret void
2107*9880d681SAndroid Build Coastguard Worker}
2108*9880d681SAndroid Build Coastguard Worker
2109*9880d681SAndroid Build Coastguard Worker; test16a: Addr-of a local cast to a ptr of a different type (optimized)
2110*9880d681SAndroid Build Coastguard Worker;           (e.g., int a; ... ; float *b = &a;)
2111*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
2112*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2113*9880d681SAndroid Build Coastguard Workerdefine void @test16a() {
2114*9880d681SAndroid Build Coastguard Workerentry:
2115*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test16a:
2116*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2117*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2118*9880d681SAndroid Build Coastguard Worker
2119*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test16a:
2120*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2121*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2122*9880d681SAndroid Build Coastguard Worker
2123*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test16a:
2124*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2125*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2126*9880d681SAndroid Build Coastguard Worker
2127*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test16a:
2128*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2129*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2130*9880d681SAndroid Build Coastguard Worker
2131*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test16a:
2132*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2133*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2134*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2135*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2136*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32* %a to float*
2137*9880d681SAndroid Build Coastguard Worker  call void @funfloat(float* %0)
2138*9880d681SAndroid Build Coastguard Worker  ret void
2139*9880d681SAndroid Build Coastguard Worker}
2140*9880d681SAndroid Build Coastguard Worker
2141*9880d681SAndroid Build Coastguard Worker; test16b: Addr-of a local cast to a ptr of a different type (optimized)
2142*9880d681SAndroid Build Coastguard Worker;           (e.g., int a; ... ; float *b = &a;)
2143*9880d681SAndroid Build Coastguard Worker;          ssp attribute
2144*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2145*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
2146*9880d681SAndroid Build Coastguard Workerdefine void @test16b() #0 {
2147*9880d681SAndroid Build Coastguard Workerentry:
2148*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test16b:
2149*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2150*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2151*9880d681SAndroid Build Coastguard Worker
2152*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test16b:
2153*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2154*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2155*9880d681SAndroid Build Coastguard Worker
2156*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test16b:
2157*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2158*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2159*9880d681SAndroid Build Coastguard Worker
2160*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test16b:
2161*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2162*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2163*9880d681SAndroid Build Coastguard Worker
2164*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test16b:
2165*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2166*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2167*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2168*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2169*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32* %a to float*
2170*9880d681SAndroid Build Coastguard Worker  call void @funfloat(float* %0)
2171*9880d681SAndroid Build Coastguard Worker  ret void
2172*9880d681SAndroid Build Coastguard Worker}
2173*9880d681SAndroid Build Coastguard Worker
2174*9880d681SAndroid Build Coastguard Worker; test16c: Addr-of a local cast to a ptr of a different type (optimized)
2175*9880d681SAndroid Build Coastguard Worker;           (e.g., int a; ... ; float *b = &a;)
2176*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
2177*9880d681SAndroid Build Coastguard Worker; Requires protector.
2178*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
2179*9880d681SAndroid Build Coastguard Workerdefine void @test16c() #1 {
2180*9880d681SAndroid Build Coastguard Workerentry:
2181*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test16c:
2182*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2183*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2184*9880d681SAndroid Build Coastguard Worker
2185*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test16c:
2186*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2187*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2188*9880d681SAndroid Build Coastguard Worker
2189*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test16c:
2190*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2191*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2192*9880d681SAndroid Build Coastguard Worker
2193*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test16c:
2194*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2195*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2196*9880d681SAndroid Build Coastguard Worker
2197*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test16c:
2198*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2199*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2200*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2201*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2202*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32* %a to float*
2203*9880d681SAndroid Build Coastguard Worker  call void @funfloat(float* %0)
2204*9880d681SAndroid Build Coastguard Worker  ret void
2205*9880d681SAndroid Build Coastguard Worker}
2206*9880d681SAndroid Build Coastguard Worker
2207*9880d681SAndroid Build Coastguard Worker; test16d: Addr-of a local cast to a ptr of a different type (optimized)
2208*9880d681SAndroid Build Coastguard Worker;           (e.g., int a; ... ; float *b = &a;)
2209*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
2210*9880d681SAndroid Build Coastguard Worker; Requires protector.
2211*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
2212*9880d681SAndroid Build Coastguard Workerdefine void @test16d() #2 {
2213*9880d681SAndroid Build Coastguard Workerentry:
2214*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test16d:
2215*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2216*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2217*9880d681SAndroid Build Coastguard Worker
2218*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test16d:
2219*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2220*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2221*9880d681SAndroid Build Coastguard Worker
2222*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test16d:
2223*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2224*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2225*9880d681SAndroid Build Coastguard Worker
2226*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test16d:
2227*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2228*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2229*9880d681SAndroid Build Coastguard Worker
2230*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test16d:
2231*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2232*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2233*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2234*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2235*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32* %a to float*
2236*9880d681SAndroid Build Coastguard Worker  call void @funfloat(float* %0)
2237*9880d681SAndroid Build Coastguard Worker  ret void
2238*9880d681SAndroid Build Coastguard Worker}
2239*9880d681SAndroid Build Coastguard Worker
2240*9880d681SAndroid Build Coastguard Worker; test17a: Addr-of a vector nested in a struct
2241*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
2242*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2243*9880d681SAndroid Build Coastguard Workerdefine void @test17a() {
2244*9880d681SAndroid Build Coastguard Workerentry:
2245*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test17a:
2246*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2247*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2248*9880d681SAndroid Build Coastguard Worker
2249*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test17a:
2250*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2251*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2252*9880d681SAndroid Build Coastguard Worker
2253*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test17a:
2254*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2255*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2256*9880d681SAndroid Build Coastguard Worker
2257*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test17a:
2258*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2259*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2260*9880d681SAndroid Build Coastguard Worker
2261*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test17a:
2262*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2263*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2264*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.vec, align 16
2265*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.vec, %struct.vec* %c, i64 0, i32 0
2266*9880d681SAndroid Build Coastguard Worker  %add.ptr = getelementptr inbounds <4 x i32>, <4 x i32>* %y, i64 -12
2267*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), <4 x i32>* %add.ptr)
2268*9880d681SAndroid Build Coastguard Worker  ret void
2269*9880d681SAndroid Build Coastguard Worker}
2270*9880d681SAndroid Build Coastguard Worker
2271*9880d681SAndroid Build Coastguard Worker; test17b: Addr-of a vector nested in a struct
2272*9880d681SAndroid Build Coastguard Worker;          ssp attribute
2273*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2274*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
2275*9880d681SAndroid Build Coastguard Workerdefine void @test17b() #0 {
2276*9880d681SAndroid Build Coastguard Workerentry:
2277*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test17b:
2278*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2279*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2280*9880d681SAndroid Build Coastguard Worker
2281*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test17b:
2282*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2283*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2284*9880d681SAndroid Build Coastguard Worker
2285*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test17b:
2286*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2287*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2288*9880d681SAndroid Build Coastguard Worker
2289*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test17b:
2290*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2291*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2292*9880d681SAndroid Build Coastguard Worker
2293*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test17b:
2294*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2295*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2296*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.vec, align 16
2297*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.vec, %struct.vec* %c, i64 0, i32 0
2298*9880d681SAndroid Build Coastguard Worker  %add.ptr = getelementptr inbounds <4 x i32>, <4 x i32>* %y, i64 -12
2299*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), <4 x i32>* %add.ptr)
2300*9880d681SAndroid Build Coastguard Worker  ret void
2301*9880d681SAndroid Build Coastguard Worker}
2302*9880d681SAndroid Build Coastguard Worker
2303*9880d681SAndroid Build Coastguard Worker; test17c: Addr-of a vector nested in a struct
2304*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
2305*9880d681SAndroid Build Coastguard Worker; Requires protector.
2306*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
2307*9880d681SAndroid Build Coastguard Workerdefine void @test17c() #1 {
2308*9880d681SAndroid Build Coastguard Workerentry:
2309*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test17c:
2310*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2311*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2312*9880d681SAndroid Build Coastguard Worker
2313*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test17c:
2314*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2315*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2316*9880d681SAndroid Build Coastguard Worker
2317*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test17c:
2318*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2319*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2320*9880d681SAndroid Build Coastguard Worker
2321*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test17c:
2322*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2323*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2324*9880d681SAndroid Build Coastguard Worker
2325*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test17c:
2326*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2327*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2328*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.vec, align 16
2329*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.vec, %struct.vec* %c, i64 0, i32 0
2330*9880d681SAndroid Build Coastguard Worker  %add.ptr = getelementptr inbounds <4 x i32>, <4 x i32>* %y, i64 -12
2331*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), <4 x i32>* %add.ptr)
2332*9880d681SAndroid Build Coastguard Worker  ret void
2333*9880d681SAndroid Build Coastguard Worker}
2334*9880d681SAndroid Build Coastguard Worker
2335*9880d681SAndroid Build Coastguard Worker; test17d: Addr-of a vector nested in a struct
2336*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
2337*9880d681SAndroid Build Coastguard Worker; Requires protector.
2338*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
2339*9880d681SAndroid Build Coastguard Workerdefine void @test17d() #2 {
2340*9880d681SAndroid Build Coastguard Workerentry:
2341*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test17d:
2342*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2343*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2344*9880d681SAndroid Build Coastguard Worker
2345*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test17d:
2346*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2347*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2348*9880d681SAndroid Build Coastguard Worker
2349*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test17d:
2350*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2351*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2352*9880d681SAndroid Build Coastguard Worker
2353*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test17d:
2354*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2355*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2356*9880d681SAndroid Build Coastguard Worker
2357*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test17d:
2358*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2359*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2360*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.vec, align 16
2361*9880d681SAndroid Build Coastguard Worker  %y = getelementptr inbounds %struct.vec, %struct.vec* %c, i64 0, i32 0
2362*9880d681SAndroid Build Coastguard Worker  %add.ptr = getelementptr inbounds <4 x i32>, <4 x i32>* %y, i64 -12
2363*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), <4 x i32>* %add.ptr)
2364*9880d681SAndroid Build Coastguard Worker  ret void
2365*9880d681SAndroid Build Coastguard Worker}
2366*9880d681SAndroid Build Coastguard Worker
2367*9880d681SAndroid Build Coastguard Worker; test18a: Addr-of a variable passed into an invoke instruction.
2368*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
2369*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2370*9880d681SAndroid Build Coastguard Workerdefine i32 @test18a() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2371*9880d681SAndroid Build Coastguard Workerentry:
2372*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test18a:
2373*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2374*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2375*9880d681SAndroid Build Coastguard Worker
2376*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test18a:
2377*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2378*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2379*9880d681SAndroid Build Coastguard Worker
2380*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test18a:
2381*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2382*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2383*9880d681SAndroid Build Coastguard Worker
2384*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test18a:
2385*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2386*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2387*9880d681SAndroid Build Coastguard Worker
2388*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test18a:
2389*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2390*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2391*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2392*9880d681SAndroid Build Coastguard Worker  %exn.slot = alloca i8*
2393*9880d681SAndroid Build Coastguard Worker  %ehselector.slot = alloca i32
2394*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2395*9880d681SAndroid Build Coastguard Worker  invoke void @_Z3exceptPi(i32* %a)
2396*9880d681SAndroid Build Coastguard Worker          to label %invoke.cont unwind label %lpad
2397*9880d681SAndroid Build Coastguard Worker
2398*9880d681SAndroid Build Coastguard Workerinvoke.cont:
2399*9880d681SAndroid Build Coastguard Worker  ret i32 0
2400*9880d681SAndroid Build Coastguard Worker
2401*9880d681SAndroid Build Coastguard Workerlpad:
2402*9880d681SAndroid Build Coastguard Worker  %0 = landingpad { i8*, i32 }
2403*9880d681SAndroid Build Coastguard Worker          catch i8* null
2404*9880d681SAndroid Build Coastguard Worker  ret i32 0
2405*9880d681SAndroid Build Coastguard Worker}
2406*9880d681SAndroid Build Coastguard Worker
2407*9880d681SAndroid Build Coastguard Worker; test18b: Addr-of a variable passed into an invoke instruction.
2408*9880d681SAndroid Build Coastguard Worker;          ssp attribute
2409*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2410*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
2411*9880d681SAndroid Build Coastguard Workerdefine i32 @test18b() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2412*9880d681SAndroid Build Coastguard Workerentry:
2413*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test18b:
2414*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2415*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2416*9880d681SAndroid Build Coastguard Worker
2417*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test18b:
2418*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2419*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2420*9880d681SAndroid Build Coastguard Worker
2421*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test18b:
2422*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2423*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2424*9880d681SAndroid Build Coastguard Worker
2425*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test18b:
2426*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2427*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2428*9880d681SAndroid Build Coastguard Worker
2429*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test18b:
2430*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2431*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2432*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2433*9880d681SAndroid Build Coastguard Worker  %exn.slot = alloca i8*
2434*9880d681SAndroid Build Coastguard Worker  %ehselector.slot = alloca i32
2435*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2436*9880d681SAndroid Build Coastguard Worker  invoke void @_Z3exceptPi(i32* %a)
2437*9880d681SAndroid Build Coastguard Worker          to label %invoke.cont unwind label %lpad
2438*9880d681SAndroid Build Coastguard Worker
2439*9880d681SAndroid Build Coastguard Workerinvoke.cont:
2440*9880d681SAndroid Build Coastguard Worker  ret i32 0
2441*9880d681SAndroid Build Coastguard Worker
2442*9880d681SAndroid Build Coastguard Workerlpad:
2443*9880d681SAndroid Build Coastguard Worker  %0 = landingpad { i8*, i32 }
2444*9880d681SAndroid Build Coastguard Worker          catch i8* null
2445*9880d681SAndroid Build Coastguard Worker  ret i32 0
2446*9880d681SAndroid Build Coastguard Worker}
2447*9880d681SAndroid Build Coastguard Worker
2448*9880d681SAndroid Build Coastguard Worker; test18c: Addr-of a variable passed into an invoke instruction.
2449*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
2450*9880d681SAndroid Build Coastguard Worker; Requires protector.
2451*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
2452*9880d681SAndroid Build Coastguard Workerdefine i32 @test18c() #1 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2453*9880d681SAndroid Build Coastguard Workerentry:
2454*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test18c:
2455*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2456*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2457*9880d681SAndroid Build Coastguard Worker
2458*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test18c:
2459*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2460*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2461*9880d681SAndroid Build Coastguard Worker
2462*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test18c:
2463*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2464*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2465*9880d681SAndroid Build Coastguard Worker
2466*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test18c:
2467*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2468*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2469*9880d681SAndroid Build Coastguard Worker
2470*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test18c:
2471*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2472*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2473*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2474*9880d681SAndroid Build Coastguard Worker  %exn.slot = alloca i8*
2475*9880d681SAndroid Build Coastguard Worker  %ehselector.slot = alloca i32
2476*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2477*9880d681SAndroid Build Coastguard Worker  invoke void @_Z3exceptPi(i32* %a)
2478*9880d681SAndroid Build Coastguard Worker          to label %invoke.cont unwind label %lpad
2479*9880d681SAndroid Build Coastguard Worker
2480*9880d681SAndroid Build Coastguard Workerinvoke.cont:
2481*9880d681SAndroid Build Coastguard Worker  ret i32 0
2482*9880d681SAndroid Build Coastguard Worker
2483*9880d681SAndroid Build Coastguard Workerlpad:
2484*9880d681SAndroid Build Coastguard Worker  %0 = landingpad { i8*, i32 }
2485*9880d681SAndroid Build Coastguard Worker          catch i8* null
2486*9880d681SAndroid Build Coastguard Worker  ret i32 0
2487*9880d681SAndroid Build Coastguard Worker}
2488*9880d681SAndroid Build Coastguard Worker
2489*9880d681SAndroid Build Coastguard Worker; test18d: Addr-of a variable passed into an invoke instruction.
2490*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
2491*9880d681SAndroid Build Coastguard Worker; Requires protector.
2492*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
2493*9880d681SAndroid Build Coastguard Workerdefine i32 @test18d() #2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2494*9880d681SAndroid Build Coastguard Workerentry:
2495*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test18d:
2496*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2497*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2498*9880d681SAndroid Build Coastguard Worker
2499*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test18d:
2500*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2501*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2502*9880d681SAndroid Build Coastguard Worker
2503*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test18d:
2504*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2505*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2506*9880d681SAndroid Build Coastguard Worker
2507*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test18d:
2508*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2509*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2510*9880d681SAndroid Build Coastguard Worker
2511*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test18d:
2512*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2513*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2514*9880d681SAndroid Build Coastguard Worker  %a = alloca i32, align 4
2515*9880d681SAndroid Build Coastguard Worker  %exn.slot = alloca i8*
2516*9880d681SAndroid Build Coastguard Worker  %ehselector.slot = alloca i32
2517*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2518*9880d681SAndroid Build Coastguard Worker  invoke void @_Z3exceptPi(i32* %a)
2519*9880d681SAndroid Build Coastguard Worker          to label %invoke.cont unwind label %lpad
2520*9880d681SAndroid Build Coastguard Worker
2521*9880d681SAndroid Build Coastguard Workerinvoke.cont:
2522*9880d681SAndroid Build Coastguard Worker  ret i32 0
2523*9880d681SAndroid Build Coastguard Worker
2524*9880d681SAndroid Build Coastguard Workerlpad:
2525*9880d681SAndroid Build Coastguard Worker  %0 = landingpad { i8*, i32 }
2526*9880d681SAndroid Build Coastguard Worker          catch i8* null
2527*9880d681SAndroid Build Coastguard Worker  ret i32 0
2528*9880d681SAndroid Build Coastguard Worker}
2529*9880d681SAndroid Build Coastguard Worker; test19a: Addr-of a struct element passed into an invoke instruction.
2530*9880d681SAndroid Build Coastguard Worker;           (GEP followed by an invoke)
2531*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
2532*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2533*9880d681SAndroid Build Coastguard Workerdefine i32 @test19a() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2534*9880d681SAndroid Build Coastguard Workerentry:
2535*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test19a:
2536*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2537*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2538*9880d681SAndroid Build Coastguard Worker
2539*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test19a:
2540*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2541*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2542*9880d681SAndroid Build Coastguard Worker
2543*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test19a:
2544*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2545*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2546*9880d681SAndroid Build Coastguard Worker
2547*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test19a:
2548*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2549*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2550*9880d681SAndroid Build Coastguard Worker
2551*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test19a:
2552*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2553*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2554*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
2555*9880d681SAndroid Build Coastguard Worker  %exn.slot = alloca i8*
2556*9880d681SAndroid Build Coastguard Worker  %ehselector.slot = alloca i32
2557*9880d681SAndroid Build Coastguard Worker  %a = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 0
2558*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2559*9880d681SAndroid Build Coastguard Worker  %a1 = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 0
2560*9880d681SAndroid Build Coastguard Worker  invoke void @_Z3exceptPi(i32* %a1)
2561*9880d681SAndroid Build Coastguard Worker          to label %invoke.cont unwind label %lpad
2562*9880d681SAndroid Build Coastguard Worker
2563*9880d681SAndroid Build Coastguard Workerinvoke.cont:
2564*9880d681SAndroid Build Coastguard Worker  ret i32 0
2565*9880d681SAndroid Build Coastguard Worker
2566*9880d681SAndroid Build Coastguard Workerlpad:
2567*9880d681SAndroid Build Coastguard Worker  %0 = landingpad { i8*, i32 }
2568*9880d681SAndroid Build Coastguard Worker          catch i8* null
2569*9880d681SAndroid Build Coastguard Worker  ret i32 0
2570*9880d681SAndroid Build Coastguard Worker}
2571*9880d681SAndroid Build Coastguard Worker
2572*9880d681SAndroid Build Coastguard Worker; test19b: Addr-of a struct element passed into an invoke instruction.
2573*9880d681SAndroid Build Coastguard Worker;           (GEP followed by an invoke)
2574*9880d681SAndroid Build Coastguard Worker;          ssp attribute
2575*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2576*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
2577*9880d681SAndroid Build Coastguard Workerdefine i32 @test19b() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2578*9880d681SAndroid Build Coastguard Workerentry:
2579*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test19b:
2580*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2581*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2582*9880d681SAndroid Build Coastguard Worker
2583*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test19b:
2584*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2585*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2586*9880d681SAndroid Build Coastguard Worker
2587*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test19b:
2588*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2589*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2590*9880d681SAndroid Build Coastguard Worker
2591*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test19b:
2592*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2593*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2594*9880d681SAndroid Build Coastguard Worker
2595*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test19b:
2596*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2597*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2598*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
2599*9880d681SAndroid Build Coastguard Worker  %exn.slot = alloca i8*
2600*9880d681SAndroid Build Coastguard Worker  %ehselector.slot = alloca i32
2601*9880d681SAndroid Build Coastguard Worker  %a = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 0
2602*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2603*9880d681SAndroid Build Coastguard Worker  %a1 = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 0
2604*9880d681SAndroid Build Coastguard Worker  invoke void @_Z3exceptPi(i32* %a1)
2605*9880d681SAndroid Build Coastguard Worker          to label %invoke.cont unwind label %lpad
2606*9880d681SAndroid Build Coastguard Worker
2607*9880d681SAndroid Build Coastguard Workerinvoke.cont:
2608*9880d681SAndroid Build Coastguard Worker  ret i32 0
2609*9880d681SAndroid Build Coastguard Worker
2610*9880d681SAndroid Build Coastguard Workerlpad:
2611*9880d681SAndroid Build Coastguard Worker  %0 = landingpad { i8*, i32 }
2612*9880d681SAndroid Build Coastguard Worker          catch i8* null
2613*9880d681SAndroid Build Coastguard Worker  ret i32 0
2614*9880d681SAndroid Build Coastguard Worker}
2615*9880d681SAndroid Build Coastguard Worker
2616*9880d681SAndroid Build Coastguard Worker; test19c: Addr-of a struct element passed into an invoke instruction.
2617*9880d681SAndroid Build Coastguard Worker;           (GEP followed by an invoke)
2618*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
2619*9880d681SAndroid Build Coastguard Worker; Requires protector.
2620*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
2621*9880d681SAndroid Build Coastguard Workerdefine i32 @test19c() #1 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2622*9880d681SAndroid Build Coastguard Workerentry:
2623*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test19c:
2624*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2625*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2626*9880d681SAndroid Build Coastguard Worker
2627*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test19c:
2628*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2629*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2630*9880d681SAndroid Build Coastguard Worker
2631*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test19c:
2632*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2633*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2634*9880d681SAndroid Build Coastguard Worker
2635*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test19c:
2636*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2637*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2638*9880d681SAndroid Build Coastguard Worker
2639*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test19c:
2640*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2641*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2642*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
2643*9880d681SAndroid Build Coastguard Worker  %exn.slot = alloca i8*
2644*9880d681SAndroid Build Coastguard Worker  %ehselector.slot = alloca i32
2645*9880d681SAndroid Build Coastguard Worker  %a = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 0
2646*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2647*9880d681SAndroid Build Coastguard Worker  %a1 = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 0
2648*9880d681SAndroid Build Coastguard Worker  invoke void @_Z3exceptPi(i32* %a1)
2649*9880d681SAndroid Build Coastguard Worker          to label %invoke.cont unwind label %lpad
2650*9880d681SAndroid Build Coastguard Worker
2651*9880d681SAndroid Build Coastguard Workerinvoke.cont:
2652*9880d681SAndroid Build Coastguard Worker  ret i32 0
2653*9880d681SAndroid Build Coastguard Worker
2654*9880d681SAndroid Build Coastguard Workerlpad:
2655*9880d681SAndroid Build Coastguard Worker  %0 = landingpad { i8*, i32 }
2656*9880d681SAndroid Build Coastguard Worker          catch i8* null
2657*9880d681SAndroid Build Coastguard Worker  ret i32 0
2658*9880d681SAndroid Build Coastguard Worker}
2659*9880d681SAndroid Build Coastguard Worker
2660*9880d681SAndroid Build Coastguard Worker; test19d: Addr-of a struct element passed into an invoke instruction.
2661*9880d681SAndroid Build Coastguard Worker;           (GEP followed by an invoke)
2662*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
2663*9880d681SAndroid Build Coastguard Worker; Requires protector.
2664*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
2665*9880d681SAndroid Build Coastguard Workerdefine i32 @test19d() #2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2666*9880d681SAndroid Build Coastguard Workerentry:
2667*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test19d:
2668*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2669*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2670*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2671*9880d681SAndroid Build Coastguard Worker
2672*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test19d:
2673*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2674*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2675*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2676*9880d681SAndroid Build Coastguard Worker
2677*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test19d:
2678*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2679*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2680*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq ___stack_chk_fail
2681*9880d681SAndroid Build Coastguard Worker
2682*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test19d:
2683*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2684*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2685*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2686*9880d681SAndroid Build Coastguard Worker
2687*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test19d:
2688*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2689*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2690*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.pair, align 4
2691*9880d681SAndroid Build Coastguard Worker  %exn.slot = alloca i8*
2692*9880d681SAndroid Build Coastguard Worker  %ehselector.slot = alloca i32
2693*9880d681SAndroid Build Coastguard Worker  %a = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 0
2694*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %a, align 4
2695*9880d681SAndroid Build Coastguard Worker  %a1 = getelementptr inbounds %struct.pair, %struct.pair* %c, i32 0, i32 0
2696*9880d681SAndroid Build Coastguard Worker  invoke void @_Z3exceptPi(i32* %a1)
2697*9880d681SAndroid Build Coastguard Worker          to label %invoke.cont unwind label %lpad
2698*9880d681SAndroid Build Coastguard Worker
2699*9880d681SAndroid Build Coastguard Workerinvoke.cont:
2700*9880d681SAndroid Build Coastguard Worker  ret i32 0
2701*9880d681SAndroid Build Coastguard Worker
2702*9880d681SAndroid Build Coastguard Workerlpad:
2703*9880d681SAndroid Build Coastguard Worker  %0 = landingpad { i8*, i32 }
2704*9880d681SAndroid Build Coastguard Worker          catch i8* null
2705*9880d681SAndroid Build Coastguard Worker  ret i32 0
2706*9880d681SAndroid Build Coastguard Worker}
2707*9880d681SAndroid Build Coastguard Worker
2708*9880d681SAndroid Build Coastguard Worker; test20a: Addr-of a pointer
2709*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
2710*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2711*9880d681SAndroid Build Coastguard Workerdefine void @test20a() {
2712*9880d681SAndroid Build Coastguard Workerentry:
2713*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test20a:
2714*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2715*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2716*9880d681SAndroid Build Coastguard Worker
2717*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test20a:
2718*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2719*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2720*9880d681SAndroid Build Coastguard Worker
2721*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test20a:
2722*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2723*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2724*9880d681SAndroid Build Coastguard Worker
2725*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test20a:
2726*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2727*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2728*9880d681SAndroid Build Coastguard Worker
2729*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test20a:
2730*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2731*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2732*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
2733*9880d681SAndroid Build Coastguard Worker  %b = alloca i32**, align 8
2734*9880d681SAndroid Build Coastguard Worker  %call = call i32* @getp()
2735*9880d681SAndroid Build Coastguard Worker  store i32* %call, i32** %a, align 8
2736*9880d681SAndroid Build Coastguard Worker  store i32** %a, i32*** %b, align 8
2737*9880d681SAndroid Build Coastguard Worker  %0 = load i32**, i32*** %b, align 8
2738*9880d681SAndroid Build Coastguard Worker  call void @funcall2(i32** %0)
2739*9880d681SAndroid Build Coastguard Worker  ret void
2740*9880d681SAndroid Build Coastguard Worker}
2741*9880d681SAndroid Build Coastguard Worker
2742*9880d681SAndroid Build Coastguard Worker; test20b: Addr-of a pointer
2743*9880d681SAndroid Build Coastguard Worker;          ssp attribute
2744*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2745*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
2746*9880d681SAndroid Build Coastguard Workerdefine void @test20b() #0 {
2747*9880d681SAndroid Build Coastguard Workerentry:
2748*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test20b:
2749*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2750*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2751*9880d681SAndroid Build Coastguard Worker
2752*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test20b:
2753*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2754*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2755*9880d681SAndroid Build Coastguard Worker
2756*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test20b:
2757*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2758*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2759*9880d681SAndroid Build Coastguard Worker
2760*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test20b:
2761*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2762*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2763*9880d681SAndroid Build Coastguard Worker
2764*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test20b:
2765*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2766*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2767*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
2768*9880d681SAndroid Build Coastguard Worker  %b = alloca i32**, align 8
2769*9880d681SAndroid Build Coastguard Worker  %call = call i32* @getp()
2770*9880d681SAndroid Build Coastguard Worker  store i32* %call, i32** %a, align 8
2771*9880d681SAndroid Build Coastguard Worker  store i32** %a, i32*** %b, align 8
2772*9880d681SAndroid Build Coastguard Worker  %0 = load i32**, i32*** %b, align 8
2773*9880d681SAndroid Build Coastguard Worker  call void @funcall2(i32** %0)
2774*9880d681SAndroid Build Coastguard Worker  ret void
2775*9880d681SAndroid Build Coastguard Worker}
2776*9880d681SAndroid Build Coastguard Worker
2777*9880d681SAndroid Build Coastguard Worker; test20c: Addr-of a pointer
2778*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
2779*9880d681SAndroid Build Coastguard Worker; Requires protector.
2780*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
2781*9880d681SAndroid Build Coastguard Workerdefine void @test20c() #1 {
2782*9880d681SAndroid Build Coastguard Workerentry:
2783*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test20c:
2784*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2785*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2786*9880d681SAndroid Build Coastguard Worker
2787*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test20c:
2788*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2789*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2790*9880d681SAndroid Build Coastguard Worker
2791*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test20c:
2792*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2793*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2794*9880d681SAndroid Build Coastguard Worker
2795*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test20c:
2796*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2797*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2798*9880d681SAndroid Build Coastguard Worker
2799*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test20c:
2800*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2801*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2802*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
2803*9880d681SAndroid Build Coastguard Worker  %b = alloca i32**, align 8
2804*9880d681SAndroid Build Coastguard Worker  %call = call i32* @getp()
2805*9880d681SAndroid Build Coastguard Worker  store i32* %call, i32** %a, align 8
2806*9880d681SAndroid Build Coastguard Worker  store i32** %a, i32*** %b, align 8
2807*9880d681SAndroid Build Coastguard Worker  %0 = load i32**, i32*** %b, align 8
2808*9880d681SAndroid Build Coastguard Worker  call void @funcall2(i32** %0)
2809*9880d681SAndroid Build Coastguard Worker  ret void
2810*9880d681SAndroid Build Coastguard Worker}
2811*9880d681SAndroid Build Coastguard Worker
2812*9880d681SAndroid Build Coastguard Worker; test20d: Addr-of a pointer
2813*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
2814*9880d681SAndroid Build Coastguard Worker; Requires protector.
2815*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
2816*9880d681SAndroid Build Coastguard Workerdefine void @test20d() #2 {
2817*9880d681SAndroid Build Coastguard Workerentry:
2818*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test20d:
2819*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2820*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2821*9880d681SAndroid Build Coastguard Worker
2822*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test20d:
2823*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2824*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2825*9880d681SAndroid Build Coastguard Worker
2826*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test20d:
2827*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2828*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2829*9880d681SAndroid Build Coastguard Worker
2830*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test20d:
2831*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2832*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2833*9880d681SAndroid Build Coastguard Worker
2834*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test20d:
2835*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2836*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2837*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
2838*9880d681SAndroid Build Coastguard Worker  %b = alloca i32**, align 8
2839*9880d681SAndroid Build Coastguard Worker  %call = call i32* @getp()
2840*9880d681SAndroid Build Coastguard Worker  store i32* %call, i32** %a, align 8
2841*9880d681SAndroid Build Coastguard Worker  store i32** %a, i32*** %b, align 8
2842*9880d681SAndroid Build Coastguard Worker  %0 = load i32**, i32*** %b, align 8
2843*9880d681SAndroid Build Coastguard Worker  call void @funcall2(i32** %0)
2844*9880d681SAndroid Build Coastguard Worker  ret void
2845*9880d681SAndroid Build Coastguard Worker}
2846*9880d681SAndroid Build Coastguard Worker
2847*9880d681SAndroid Build Coastguard Worker; test21a: Addr-of a casted pointer
2848*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
2849*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2850*9880d681SAndroid Build Coastguard Workerdefine void @test21a() {
2851*9880d681SAndroid Build Coastguard Workerentry:
2852*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test21a:
2853*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2854*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2855*9880d681SAndroid Build Coastguard Worker
2856*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test21a:
2857*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2858*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2859*9880d681SAndroid Build Coastguard Worker
2860*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test21a:
2861*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2862*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2863*9880d681SAndroid Build Coastguard Worker
2864*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test21a:
2865*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2866*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2867*9880d681SAndroid Build Coastguard Worker
2868*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test21a:
2869*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2870*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2871*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
2872*9880d681SAndroid Build Coastguard Worker  %b = alloca float**, align 8
2873*9880d681SAndroid Build Coastguard Worker  %call = call i32* @getp()
2874*9880d681SAndroid Build Coastguard Worker  store i32* %call, i32** %a, align 8
2875*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32** %a to float**
2876*9880d681SAndroid Build Coastguard Worker  store float** %0, float*** %b, align 8
2877*9880d681SAndroid Build Coastguard Worker  %1 = load float**, float*** %b, align 8
2878*9880d681SAndroid Build Coastguard Worker  call void @funfloat2(float** %1)
2879*9880d681SAndroid Build Coastguard Worker  ret void
2880*9880d681SAndroid Build Coastguard Worker}
2881*9880d681SAndroid Build Coastguard Worker
2882*9880d681SAndroid Build Coastguard Worker; test21b: Addr-of a casted pointer
2883*9880d681SAndroid Build Coastguard Worker;          ssp attribute
2884*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2885*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
2886*9880d681SAndroid Build Coastguard Workerdefine void @test21b() #0 {
2887*9880d681SAndroid Build Coastguard Workerentry:
2888*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test21b:
2889*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2890*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2891*9880d681SAndroid Build Coastguard Worker
2892*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test21b:
2893*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
2894*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
2895*9880d681SAndroid Build Coastguard Worker
2896*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test21b:
2897*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
2898*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
2899*9880d681SAndroid Build Coastguard Worker
2900*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test21b:
2901*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
2902*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
2903*9880d681SAndroid Build Coastguard Worker
2904*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test21b:
2905*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
2906*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
2907*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
2908*9880d681SAndroid Build Coastguard Worker  %b = alloca float**, align 8
2909*9880d681SAndroid Build Coastguard Worker  %call = call i32* @getp()
2910*9880d681SAndroid Build Coastguard Worker  store i32* %call, i32** %a, align 8
2911*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32** %a to float**
2912*9880d681SAndroid Build Coastguard Worker  store float** %0, float*** %b, align 8
2913*9880d681SAndroid Build Coastguard Worker  %1 = load float**, float*** %b, align 8
2914*9880d681SAndroid Build Coastguard Worker  call void @funfloat2(float** %1)
2915*9880d681SAndroid Build Coastguard Worker  ret void
2916*9880d681SAndroid Build Coastguard Worker}
2917*9880d681SAndroid Build Coastguard Worker
2918*9880d681SAndroid Build Coastguard Worker; test21c: Addr-of a casted pointer
2919*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
2920*9880d681SAndroid Build Coastguard Worker; Requires protector.
2921*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
2922*9880d681SAndroid Build Coastguard Workerdefine void @test21c() #1 {
2923*9880d681SAndroid Build Coastguard Workerentry:
2924*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test21c:
2925*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2926*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2927*9880d681SAndroid Build Coastguard Worker
2928*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test21c:
2929*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2930*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2931*9880d681SAndroid Build Coastguard Worker
2932*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test21c:
2933*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2934*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2935*9880d681SAndroid Build Coastguard Worker
2936*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test21c:
2937*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2938*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2939*9880d681SAndroid Build Coastguard Worker
2940*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test21c:
2941*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2942*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2943*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
2944*9880d681SAndroid Build Coastguard Worker  %b = alloca float**, align 8
2945*9880d681SAndroid Build Coastguard Worker  %call = call i32* @getp()
2946*9880d681SAndroid Build Coastguard Worker  store i32* %call, i32** %a, align 8
2947*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32** %a to float**
2948*9880d681SAndroid Build Coastguard Worker  store float** %0, float*** %b, align 8
2949*9880d681SAndroid Build Coastguard Worker  %1 = load float**, float*** %b, align 8
2950*9880d681SAndroid Build Coastguard Worker  call void @funfloat2(float** %1)
2951*9880d681SAndroid Build Coastguard Worker  ret void
2952*9880d681SAndroid Build Coastguard Worker}
2953*9880d681SAndroid Build Coastguard Worker
2954*9880d681SAndroid Build Coastguard Worker; test21d: Addr-of a casted pointer
2955*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
2956*9880d681SAndroid Build Coastguard Worker; Requires protector.
2957*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
2958*9880d681SAndroid Build Coastguard Workerdefine void @test21d() #2 {
2959*9880d681SAndroid Build Coastguard Workerentry:
2960*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test21d:
2961*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
2962*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
2963*9880d681SAndroid Build Coastguard Worker
2964*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test21d:
2965*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
2966*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
2967*9880d681SAndroid Build Coastguard Worker
2968*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test21d:
2969*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
2970*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
2971*9880d681SAndroid Build Coastguard Worker
2972*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test21d:
2973*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
2974*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
2975*9880d681SAndroid Build Coastguard Worker
2976*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test21d:
2977*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
2978*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
2979*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
2980*9880d681SAndroid Build Coastguard Worker  %b = alloca float**, align 8
2981*9880d681SAndroid Build Coastguard Worker  %call = call i32* @getp()
2982*9880d681SAndroid Build Coastguard Worker  store i32* %call, i32** %a, align 8
2983*9880d681SAndroid Build Coastguard Worker  %0 = bitcast i32** %a to float**
2984*9880d681SAndroid Build Coastguard Worker  store float** %0, float*** %b, align 8
2985*9880d681SAndroid Build Coastguard Worker  %1 = load float**, float*** %b, align 8
2986*9880d681SAndroid Build Coastguard Worker  call void @funfloat2(float** %1)
2987*9880d681SAndroid Build Coastguard Worker  ret void
2988*9880d681SAndroid Build Coastguard Worker}
2989*9880d681SAndroid Build Coastguard Worker
2990*9880d681SAndroid Build Coastguard Worker; test22a: [2 x i8] in a class
2991*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
2992*9880d681SAndroid Build Coastguard Worker; Requires no protector.
2993*9880d681SAndroid Build Coastguard Workerdefine signext i8 @test22a() {
2994*9880d681SAndroid Build Coastguard Workerentry:
2995*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test22a:
2996*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
2997*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
2998*9880d681SAndroid Build Coastguard Worker
2999*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test22a:
3000*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3001*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3002*9880d681SAndroid Build Coastguard Worker
3003*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test22a:
3004*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3005*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3006*9880d681SAndroid Build Coastguard Worker
3007*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test22a:
3008*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3009*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3010*9880d681SAndroid Build Coastguard Worker
3011*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test22a:
3012*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3013*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3014*9880d681SAndroid Build Coastguard Worker  %a = alloca %class.A, align 1
3015*9880d681SAndroid Build Coastguard Worker  %array = getelementptr inbounds %class.A, %class.A* %a, i32 0, i32 0
3016*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %array, i32 0, i64 0
3017*9880d681SAndroid Build Coastguard Worker  %0 = load i8, i8* %arrayidx, align 1
3018*9880d681SAndroid Build Coastguard Worker  ret i8 %0
3019*9880d681SAndroid Build Coastguard Worker}
3020*9880d681SAndroid Build Coastguard Worker
3021*9880d681SAndroid Build Coastguard Worker; test22b: [2 x i8] in a class
3022*9880d681SAndroid Build Coastguard Worker;          ssp attribute
3023*9880d681SAndroid Build Coastguard Worker; Requires no protector.
3024*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
3025*9880d681SAndroid Build Coastguard Workerdefine signext i8 @test22b() #0 {
3026*9880d681SAndroid Build Coastguard Workerentry:
3027*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test22b:
3028*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3029*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3030*9880d681SAndroid Build Coastguard Worker
3031*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test22b:
3032*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3033*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3034*9880d681SAndroid Build Coastguard Worker
3035*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test22b:
3036*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3037*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3038*9880d681SAndroid Build Coastguard Worker
3039*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test22b:
3040*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3041*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3042*9880d681SAndroid Build Coastguard Worker
3043*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test22b:
3044*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3045*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3046*9880d681SAndroid Build Coastguard Worker  %a = alloca %class.A, align 1
3047*9880d681SAndroid Build Coastguard Worker  %array = getelementptr inbounds %class.A, %class.A* %a, i32 0, i32 0
3048*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %array, i32 0, i64 0
3049*9880d681SAndroid Build Coastguard Worker  %0 = load i8, i8* %arrayidx, align 1
3050*9880d681SAndroid Build Coastguard Worker  ret i8 %0
3051*9880d681SAndroid Build Coastguard Worker}
3052*9880d681SAndroid Build Coastguard Worker
3053*9880d681SAndroid Build Coastguard Worker; test22c: [2 x i8] in a class
3054*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
3055*9880d681SAndroid Build Coastguard Worker; Requires protector.
3056*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
3057*9880d681SAndroid Build Coastguard Workerdefine signext i8 @test22c() #1 {
3058*9880d681SAndroid Build Coastguard Workerentry:
3059*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test22c:
3060*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3061*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3062*9880d681SAndroid Build Coastguard Worker
3063*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test22c:
3064*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3065*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3066*9880d681SAndroid Build Coastguard Worker
3067*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test22c:
3068*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3069*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3070*9880d681SAndroid Build Coastguard Worker
3071*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test22c:
3072*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3073*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3074*9880d681SAndroid Build Coastguard Worker
3075*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test22c:
3076*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3077*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3078*9880d681SAndroid Build Coastguard Worker  %a = alloca %class.A, align 1
3079*9880d681SAndroid Build Coastguard Worker  %array = getelementptr inbounds %class.A, %class.A* %a, i32 0, i32 0
3080*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %array, i32 0, i64 0
3081*9880d681SAndroid Build Coastguard Worker  %0 = load i8, i8* %arrayidx, align 1
3082*9880d681SAndroid Build Coastguard Worker  ret i8 %0
3083*9880d681SAndroid Build Coastguard Worker}
3084*9880d681SAndroid Build Coastguard Worker
3085*9880d681SAndroid Build Coastguard Worker; test22d: [2 x i8] in a class
3086*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
3087*9880d681SAndroid Build Coastguard Worker; Requires protector.
3088*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
3089*9880d681SAndroid Build Coastguard Workerdefine signext i8 @test22d() #2 {
3090*9880d681SAndroid Build Coastguard Workerentry:
3091*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test22d:
3092*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3093*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3094*9880d681SAndroid Build Coastguard Worker
3095*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test22d:
3096*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3097*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3098*9880d681SAndroid Build Coastguard Worker
3099*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test22d:
3100*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3101*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3102*9880d681SAndroid Build Coastguard Worker
3103*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test22d:
3104*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3105*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3106*9880d681SAndroid Build Coastguard Worker
3107*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test22d:
3108*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3109*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3110*9880d681SAndroid Build Coastguard Worker  %a = alloca %class.A, align 1
3111*9880d681SAndroid Build Coastguard Worker  %array = getelementptr inbounds %class.A, %class.A* %a, i32 0, i32 0
3112*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %array, i32 0, i64 0
3113*9880d681SAndroid Build Coastguard Worker  %0 = load i8, i8* %arrayidx, align 1
3114*9880d681SAndroid Build Coastguard Worker  ret i8 %0
3115*9880d681SAndroid Build Coastguard Worker}
3116*9880d681SAndroid Build Coastguard Worker
3117*9880d681SAndroid Build Coastguard Worker; test23a: [2 x i8] nested in several layers of structs and unions
3118*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
3119*9880d681SAndroid Build Coastguard Worker; Requires no protector.
3120*9880d681SAndroid Build Coastguard Workerdefine signext i8 @test23a() {
3121*9880d681SAndroid Build Coastguard Workerentry:
3122*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test23a:
3123*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3124*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3125*9880d681SAndroid Build Coastguard Worker
3126*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test23a:
3127*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3128*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3129*9880d681SAndroid Build Coastguard Worker
3130*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test23a:
3131*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3132*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3133*9880d681SAndroid Build Coastguard Worker
3134*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test23a:
3135*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3136*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3137*9880d681SAndroid Build Coastguard Worker
3138*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test23a:
3139*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3140*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3141*9880d681SAndroid Build Coastguard Worker  %x = alloca %struct.deep, align 1
3142*9880d681SAndroid Build Coastguard Worker  %b = getelementptr inbounds %struct.deep, %struct.deep* %x, i32 0, i32 0
3143*9880d681SAndroid Build Coastguard Worker  %c = bitcast %union.anon* %b to %struct.anon*
3144*9880d681SAndroid Build Coastguard Worker  %d = getelementptr inbounds %struct.anon, %struct.anon* %c, i32 0, i32 0
3145*9880d681SAndroid Build Coastguard Worker  %e = getelementptr inbounds %struct.anon.0, %struct.anon.0* %d, i32 0, i32 0
3146*9880d681SAndroid Build Coastguard Worker  %array = bitcast %union.anon.1* %e to [2 x i8]*
3147*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %array, i32 0, i64 0
3148*9880d681SAndroid Build Coastguard Worker  %0 = load i8, i8* %arrayidx, align 1
3149*9880d681SAndroid Build Coastguard Worker  ret i8 %0
3150*9880d681SAndroid Build Coastguard Worker}
3151*9880d681SAndroid Build Coastguard Worker
3152*9880d681SAndroid Build Coastguard Worker; test23b: [2 x i8] nested in several layers of structs and unions
3153*9880d681SAndroid Build Coastguard Worker;          ssp attribute
3154*9880d681SAndroid Build Coastguard Worker; Requires no protector.
3155*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
3156*9880d681SAndroid Build Coastguard Workerdefine signext i8 @test23b() #0 {
3157*9880d681SAndroid Build Coastguard Workerentry:
3158*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test23b:
3159*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3160*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3161*9880d681SAndroid Build Coastguard Worker
3162*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test23b:
3163*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3164*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3165*9880d681SAndroid Build Coastguard Worker
3166*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test23b:
3167*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3168*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3169*9880d681SAndroid Build Coastguard Worker
3170*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test23b:
3171*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3172*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3173*9880d681SAndroid Build Coastguard Worker
3174*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test23b:
3175*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3176*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3177*9880d681SAndroid Build Coastguard Worker  %x = alloca %struct.deep, align 1
3178*9880d681SAndroid Build Coastguard Worker  %b = getelementptr inbounds %struct.deep, %struct.deep* %x, i32 0, i32 0
3179*9880d681SAndroid Build Coastguard Worker  %c = bitcast %union.anon* %b to %struct.anon*
3180*9880d681SAndroid Build Coastguard Worker  %d = getelementptr inbounds %struct.anon, %struct.anon* %c, i32 0, i32 0
3181*9880d681SAndroid Build Coastguard Worker  %e = getelementptr inbounds %struct.anon.0, %struct.anon.0* %d, i32 0, i32 0
3182*9880d681SAndroid Build Coastguard Worker  %array = bitcast %union.anon.1* %e to [2 x i8]*
3183*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %array, i32 0, i64 0
3184*9880d681SAndroid Build Coastguard Worker  %0 = load i8, i8* %arrayidx, align 1
3185*9880d681SAndroid Build Coastguard Worker  ret i8 %0
3186*9880d681SAndroid Build Coastguard Worker}
3187*9880d681SAndroid Build Coastguard Worker
3188*9880d681SAndroid Build Coastguard Worker; test23c: [2 x i8] nested in several layers of structs and unions
3189*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
3190*9880d681SAndroid Build Coastguard Worker; Requires protector.
3191*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
3192*9880d681SAndroid Build Coastguard Workerdefine signext i8 @test23c() #1 {
3193*9880d681SAndroid Build Coastguard Workerentry:
3194*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test23c:
3195*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3196*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3197*9880d681SAndroid Build Coastguard Worker
3198*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test23c:
3199*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3200*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3201*9880d681SAndroid Build Coastguard Worker
3202*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test23c:
3203*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3204*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3205*9880d681SAndroid Build Coastguard Worker
3206*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test23c:
3207*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3208*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3209*9880d681SAndroid Build Coastguard Worker
3210*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test23c:
3211*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3212*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3213*9880d681SAndroid Build Coastguard Worker  %x = alloca %struct.deep, align 1
3214*9880d681SAndroid Build Coastguard Worker  %b = getelementptr inbounds %struct.deep, %struct.deep* %x, i32 0, i32 0
3215*9880d681SAndroid Build Coastguard Worker  %c = bitcast %union.anon* %b to %struct.anon*
3216*9880d681SAndroid Build Coastguard Worker  %d = getelementptr inbounds %struct.anon, %struct.anon* %c, i32 0, i32 0
3217*9880d681SAndroid Build Coastguard Worker  %e = getelementptr inbounds %struct.anon.0, %struct.anon.0* %d, i32 0, i32 0
3218*9880d681SAndroid Build Coastguard Worker  %array = bitcast %union.anon.1* %e to [2 x i8]*
3219*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %array, i32 0, i64 0
3220*9880d681SAndroid Build Coastguard Worker  %0 = load i8, i8* %arrayidx, align 1
3221*9880d681SAndroid Build Coastguard Worker  ret i8 %0
3222*9880d681SAndroid Build Coastguard Worker}
3223*9880d681SAndroid Build Coastguard Worker
3224*9880d681SAndroid Build Coastguard Worker; test23d: [2 x i8] nested in several layers of structs and unions
3225*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
3226*9880d681SAndroid Build Coastguard Worker; Requires protector.
3227*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
3228*9880d681SAndroid Build Coastguard Workerdefine signext i8 @test23d() #2 {
3229*9880d681SAndroid Build Coastguard Workerentry:
3230*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test23d:
3231*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3232*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3233*9880d681SAndroid Build Coastguard Worker
3234*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test23d:
3235*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3236*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3237*9880d681SAndroid Build Coastguard Worker
3238*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test23d:
3239*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3240*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3241*9880d681SAndroid Build Coastguard Worker
3242*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test23d:
3243*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3244*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3245*9880d681SAndroid Build Coastguard Worker
3246*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test23d:
3247*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3248*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3249*9880d681SAndroid Build Coastguard Worker  %x = alloca %struct.deep, align 1
3250*9880d681SAndroid Build Coastguard Worker  %b = getelementptr inbounds %struct.deep, %struct.deep* %x, i32 0, i32 0
3251*9880d681SAndroid Build Coastguard Worker  %c = bitcast %union.anon* %b to %struct.anon*
3252*9880d681SAndroid Build Coastguard Worker  %d = getelementptr inbounds %struct.anon, %struct.anon* %c, i32 0, i32 0
3253*9880d681SAndroid Build Coastguard Worker  %e = getelementptr inbounds %struct.anon.0, %struct.anon.0* %d, i32 0, i32 0
3254*9880d681SAndroid Build Coastguard Worker  %array = bitcast %union.anon.1* %e to [2 x i8]*
3255*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %array, i32 0, i64 0
3256*9880d681SAndroid Build Coastguard Worker  %0 = load i8, i8* %arrayidx, align 1
3257*9880d681SAndroid Build Coastguard Worker  ret i8 %0
3258*9880d681SAndroid Build Coastguard Worker}
3259*9880d681SAndroid Build Coastguard Worker
3260*9880d681SAndroid Build Coastguard Worker; test24a: Variable sized alloca
3261*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
3262*9880d681SAndroid Build Coastguard Worker; Requires no protector.
3263*9880d681SAndroid Build Coastguard Workerdefine void @test24a(i32 %n) {
3264*9880d681SAndroid Build Coastguard Workerentry:
3265*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test24a:
3266*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3267*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3268*9880d681SAndroid Build Coastguard Worker
3269*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test24a:
3270*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3271*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3272*9880d681SAndroid Build Coastguard Worker
3273*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test24a:
3274*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3275*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3276*9880d681SAndroid Build Coastguard Worker
3277*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test24a:
3278*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3279*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3280*9880d681SAndroid Build Coastguard Worker
3281*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test24a:
3282*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3283*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3284*9880d681SAndroid Build Coastguard Worker  %n.addr = alloca i32, align 4
3285*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
3286*9880d681SAndroid Build Coastguard Worker  store i32 %n, i32* %n.addr, align 4
3287*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %n.addr, align 4
3288*9880d681SAndroid Build Coastguard Worker  %conv = sext i32 %0 to i64
3289*9880d681SAndroid Build Coastguard Worker  %1 = alloca i8, i64 %conv
3290*9880d681SAndroid Build Coastguard Worker  %2 = bitcast i8* %1 to i32*
3291*9880d681SAndroid Build Coastguard Worker  store i32* %2, i32** %a, align 8
3292*9880d681SAndroid Build Coastguard Worker  ret void
3293*9880d681SAndroid Build Coastguard Worker}
3294*9880d681SAndroid Build Coastguard Worker
3295*9880d681SAndroid Build Coastguard Worker; test24b: Variable sized alloca
3296*9880d681SAndroid Build Coastguard Worker;          ssp attribute
3297*9880d681SAndroid Build Coastguard Worker; Requires protector.
3298*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
3299*9880d681SAndroid Build Coastguard Workerdefine void @test24b(i32 %n) #0 {
3300*9880d681SAndroid Build Coastguard Workerentry:
3301*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test24b:
3302*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3303*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3304*9880d681SAndroid Build Coastguard Worker
3305*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test24b:
3306*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3307*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3308*9880d681SAndroid Build Coastguard Worker
3309*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test24b:
3310*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3311*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3312*9880d681SAndroid Build Coastguard Worker
3313*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test24b:
3314*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3315*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3316*9880d681SAndroid Build Coastguard Worker
3317*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test24b:
3318*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3319*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3320*9880d681SAndroid Build Coastguard Worker  %n.addr = alloca i32, align 4
3321*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
3322*9880d681SAndroid Build Coastguard Worker  store i32 %n, i32* %n.addr, align 4
3323*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %n.addr, align 4
3324*9880d681SAndroid Build Coastguard Worker  %conv = sext i32 %0 to i64
3325*9880d681SAndroid Build Coastguard Worker  %1 = alloca i8, i64 %conv
3326*9880d681SAndroid Build Coastguard Worker  %2 = bitcast i8* %1 to i32*
3327*9880d681SAndroid Build Coastguard Worker  store i32* %2, i32** %a, align 8
3328*9880d681SAndroid Build Coastguard Worker  ret void
3329*9880d681SAndroid Build Coastguard Worker}
3330*9880d681SAndroid Build Coastguard Worker
3331*9880d681SAndroid Build Coastguard Worker; test24c: Variable sized alloca
3332*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
3333*9880d681SAndroid Build Coastguard Worker; Requires protector.
3334*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
3335*9880d681SAndroid Build Coastguard Workerdefine void @test24c(i32 %n) #1 {
3336*9880d681SAndroid Build Coastguard Workerentry:
3337*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test24c:
3338*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3339*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3340*9880d681SAndroid Build Coastguard Worker
3341*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test24c:
3342*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3343*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3344*9880d681SAndroid Build Coastguard Worker
3345*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test24c:
3346*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3347*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3348*9880d681SAndroid Build Coastguard Worker
3349*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test24c:
3350*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3351*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3352*9880d681SAndroid Build Coastguard Worker
3353*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test24c:
3354*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3355*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3356*9880d681SAndroid Build Coastguard Worker  %n.addr = alloca i32, align 4
3357*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
3358*9880d681SAndroid Build Coastguard Worker  store i32 %n, i32* %n.addr, align 4
3359*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %n.addr, align 4
3360*9880d681SAndroid Build Coastguard Worker  %conv = sext i32 %0 to i64
3361*9880d681SAndroid Build Coastguard Worker  %1 = alloca i8, i64 %conv
3362*9880d681SAndroid Build Coastguard Worker  %2 = bitcast i8* %1 to i32*
3363*9880d681SAndroid Build Coastguard Worker  store i32* %2, i32** %a, align 8
3364*9880d681SAndroid Build Coastguard Worker  ret void
3365*9880d681SAndroid Build Coastguard Worker}
3366*9880d681SAndroid Build Coastguard Worker
3367*9880d681SAndroid Build Coastguard Worker; test24d: Variable sized alloca
3368*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
3369*9880d681SAndroid Build Coastguard Worker; Requires protector.
3370*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
3371*9880d681SAndroid Build Coastguard Workerdefine void @test24d(i32 %n) #2 {
3372*9880d681SAndroid Build Coastguard Workerentry:
3373*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test24d:
3374*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3375*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3376*9880d681SAndroid Build Coastguard Worker
3377*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test24d:
3378*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3379*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3380*9880d681SAndroid Build Coastguard Worker
3381*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test24d:
3382*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3383*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3384*9880d681SAndroid Build Coastguard Worker
3385*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test24d:
3386*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3387*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3388*9880d681SAndroid Build Coastguard Worker
3389*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test24d:
3390*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3391*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3392*9880d681SAndroid Build Coastguard Worker  %n.addr = alloca i32, align 4
3393*9880d681SAndroid Build Coastguard Worker  %a = alloca i32*, align 8
3394*9880d681SAndroid Build Coastguard Worker  store i32 %n, i32* %n.addr, align 4
3395*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %n.addr, align 4
3396*9880d681SAndroid Build Coastguard Worker  %conv = sext i32 %0 to i64
3397*9880d681SAndroid Build Coastguard Worker  %1 = alloca i8, i64 %conv
3398*9880d681SAndroid Build Coastguard Worker  %2 = bitcast i8* %1 to i32*
3399*9880d681SAndroid Build Coastguard Worker  store i32* %2, i32** %a, align 8
3400*9880d681SAndroid Build Coastguard Worker  ret void
3401*9880d681SAndroid Build Coastguard Worker}
3402*9880d681SAndroid Build Coastguard Worker
3403*9880d681SAndroid Build Coastguard Worker; test25a: array of [4 x i32]
3404*9880d681SAndroid Build Coastguard Worker;          no ssp attribute
3405*9880d681SAndroid Build Coastguard Worker; Requires no protector.
3406*9880d681SAndroid Build Coastguard Workerdefine i32 @test25a() {
3407*9880d681SAndroid Build Coastguard Workerentry:
3408*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test25a:
3409*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3410*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3411*9880d681SAndroid Build Coastguard Worker
3412*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test25a:
3413*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3414*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3415*9880d681SAndroid Build Coastguard Worker
3416*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test25a:
3417*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3418*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3419*9880d681SAndroid Build Coastguard Worker
3420*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test25a:
3421*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3422*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3423*9880d681SAndroid Build Coastguard Worker
3424*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test25a:
3425*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3426*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3427*9880d681SAndroid Build Coastguard Worker  %a = alloca [4 x i32], align 16
3428*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [4 x i32], [4 x i32]* %a, i32 0, i64 0
3429*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %arrayidx, align 4
3430*9880d681SAndroid Build Coastguard Worker  ret i32 %0
3431*9880d681SAndroid Build Coastguard Worker}
3432*9880d681SAndroid Build Coastguard Worker
3433*9880d681SAndroid Build Coastguard Worker; test25b: array of [4 x i32]
3434*9880d681SAndroid Build Coastguard Worker;          ssp attribute
3435*9880d681SAndroid Build Coastguard Worker; Requires no protector, except for Darwin which _does_ require a protector.
3436*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp
3437*9880d681SAndroid Build Coastguard Workerdefine i32 @test25b() #0 {
3438*9880d681SAndroid Build Coastguard Workerentry:
3439*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test25b:
3440*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3441*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3442*9880d681SAndroid Build Coastguard Worker
3443*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test25b:
3444*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3445*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3446*9880d681SAndroid Build Coastguard Worker
3447*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test25b:
3448*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3449*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3450*9880d681SAndroid Build Coastguard Worker
3451*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test25b:
3452*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3453*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3454*9880d681SAndroid Build Coastguard Worker
3455*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test25b:
3456*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3457*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3458*9880d681SAndroid Build Coastguard Worker  %a = alloca [4 x i32], align 16
3459*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [4 x i32], [4 x i32]* %a, i32 0, i64 0
3460*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %arrayidx, align 4
3461*9880d681SAndroid Build Coastguard Worker  ret i32 %0
3462*9880d681SAndroid Build Coastguard Worker}
3463*9880d681SAndroid Build Coastguard Worker
3464*9880d681SAndroid Build Coastguard Worker; test25c: array of [4 x i32]
3465*9880d681SAndroid Build Coastguard Worker;          sspstrong attribute
3466*9880d681SAndroid Build Coastguard Worker; Requires protector.
3467*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
3468*9880d681SAndroid Build Coastguard Workerdefine i32 @test25c() #1 {
3469*9880d681SAndroid Build Coastguard Workerentry:
3470*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test25c:
3471*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3472*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3473*9880d681SAndroid Build Coastguard Worker
3474*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test25c:
3475*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3476*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3477*9880d681SAndroid Build Coastguard Worker
3478*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test25c:
3479*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3480*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3481*9880d681SAndroid Build Coastguard Worker
3482*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test25c:
3483*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3484*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3485*9880d681SAndroid Build Coastguard Worker
3486*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test25c:
3487*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3488*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3489*9880d681SAndroid Build Coastguard Worker  %a = alloca [4 x i32], align 16
3490*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [4 x i32], [4 x i32]* %a, i32 0, i64 0
3491*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %arrayidx, align 4
3492*9880d681SAndroid Build Coastguard Worker  ret i32 %0
3493*9880d681SAndroid Build Coastguard Worker}
3494*9880d681SAndroid Build Coastguard Worker
3495*9880d681SAndroid Build Coastguard Worker; test25d: array of [4 x i32]
3496*9880d681SAndroid Build Coastguard Worker;          sspreq attribute
3497*9880d681SAndroid Build Coastguard Worker; Requires protector.
3498*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspreq
3499*9880d681SAndroid Build Coastguard Workerdefine i32 @test25d() #2 {
3500*9880d681SAndroid Build Coastguard Workerentry:
3501*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test25d:
3502*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3503*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3504*9880d681SAndroid Build Coastguard Worker
3505*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test25d:
3506*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3507*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3508*9880d681SAndroid Build Coastguard Worker
3509*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test25d:
3510*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3511*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3512*9880d681SAndroid Build Coastguard Worker
3513*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test25d:
3514*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3515*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3516*9880d681SAndroid Build Coastguard Worker
3517*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test25d:
3518*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3519*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3520*9880d681SAndroid Build Coastguard Worker  %a = alloca [4 x i32], align 16
3521*9880d681SAndroid Build Coastguard Worker  %arrayidx = getelementptr inbounds [4 x i32], [4 x i32]* %a, i32 0, i64 0
3522*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %arrayidx, align 4
3523*9880d681SAndroid Build Coastguard Worker  ret i32 %0
3524*9880d681SAndroid Build Coastguard Worker}
3525*9880d681SAndroid Build Coastguard Worker
3526*9880d681SAndroid Build Coastguard Worker; test26: Nested structure, no arrays, no address-of expressions.
3527*9880d681SAndroid Build Coastguard Worker;         Verify that the resulting gep-of-gep does not incorrectly trigger
3528*9880d681SAndroid Build Coastguard Worker;         a stack protector.
3529*9880d681SAndroid Build Coastguard Worker;         ssptrong attribute
3530*9880d681SAndroid Build Coastguard Worker; Requires no protector.
3531*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
3532*9880d681SAndroid Build Coastguard Workerdefine void @test26() #1 {
3533*9880d681SAndroid Build Coastguard Workerentry:
3534*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test26:
3535*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3536*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3537*9880d681SAndroid Build Coastguard Worker
3538*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test26:
3539*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3540*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3541*9880d681SAndroid Build Coastguard Worker
3542*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test26:
3543*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3544*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3545*9880d681SAndroid Build Coastguard Worker
3546*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test26:
3547*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3548*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3549*9880d681SAndroid Build Coastguard Worker
3550*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test26:
3551*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3552*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3553*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.nest, align 4
3554*9880d681SAndroid Build Coastguard Worker  %b = getelementptr inbounds %struct.nest, %struct.nest* %c, i32 0, i32 1
3555*9880d681SAndroid Build Coastguard Worker  %_a = getelementptr inbounds %struct.pair, %struct.pair* %b, i32 0, i32 0
3556*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %_a, align 4
3557*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %0)
3558*9880d681SAndroid Build Coastguard Worker  ret void
3559*9880d681SAndroid Build Coastguard Worker}
3560*9880d681SAndroid Build Coastguard Worker
3561*9880d681SAndroid Build Coastguard Worker; test27: Address-of a structure taken in a function with a loop where
3562*9880d681SAndroid Build Coastguard Worker;         the alloca is an incoming value to a PHI node and a use of that PHI
3563*9880d681SAndroid Build Coastguard Worker;         node is also an incoming value.
3564*9880d681SAndroid Build Coastguard Worker;         Verify that the address-of analysis does not get stuck in infinite
3565*9880d681SAndroid Build Coastguard Worker;         recursion when chasing the alloca through the PHI nodes.
3566*9880d681SAndroid Build Coastguard Worker; Requires protector.
3567*9880d681SAndroid Build Coastguard Worker; Function Attrs: sspstrong
3568*9880d681SAndroid Build Coastguard Workerdefine i32 @test27(i32 %arg) #1 {
3569*9880d681SAndroid Build Coastguard Workerbb:
3570*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test27:
3571*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3572*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3573*9880d681SAndroid Build Coastguard Worker
3574*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test27:
3575*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3576*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3577*9880d681SAndroid Build Coastguard Worker
3578*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test27:
3579*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3580*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3581*9880d681SAndroid Build Coastguard Worker
3582*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test27:
3583*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3584*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3585*9880d681SAndroid Build Coastguard Worker
3586*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test27:
3587*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3588*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3589*9880d681SAndroid Build Coastguard Worker  %tmp = alloca %struct.small*, align 8
3590*9880d681SAndroid Build Coastguard Worker  %tmp1 = call i32 (...) @dummy(%struct.small** %tmp)
3591*9880d681SAndroid Build Coastguard Worker  %tmp2 = load %struct.small*, %struct.small** %tmp, align 8
3592*9880d681SAndroid Build Coastguard Worker  %tmp3 = ptrtoint %struct.small* %tmp2 to i64
3593*9880d681SAndroid Build Coastguard Worker  %tmp4 = trunc i64 %tmp3 to i32
3594*9880d681SAndroid Build Coastguard Worker  %tmp5 = icmp sgt i32 %tmp4, 0
3595*9880d681SAndroid Build Coastguard Worker  br i1 %tmp5, label %bb6, label %bb21
3596*9880d681SAndroid Build Coastguard Worker
3597*9880d681SAndroid Build Coastguard Workerbb6:                                              ; preds = %bb17, %bb
3598*9880d681SAndroid Build Coastguard Worker  %tmp7 = phi %struct.small* [ %tmp19, %bb17 ], [ %tmp2, %bb ]
3599*9880d681SAndroid Build Coastguard Worker  %tmp8 = phi i64 [ %tmp20, %bb17 ], [ 1, %bb ]
3600*9880d681SAndroid Build Coastguard Worker  %tmp9 = phi i32 [ %tmp14, %bb17 ], [ %tmp1, %bb ]
3601*9880d681SAndroid Build Coastguard Worker  %tmp10 = getelementptr inbounds %struct.small, %struct.small* %tmp7, i64 0, i32 0
3602*9880d681SAndroid Build Coastguard Worker  %tmp11 = load i8, i8* %tmp10, align 1
3603*9880d681SAndroid Build Coastguard Worker  %tmp12 = icmp eq i8 %tmp11, 1
3604*9880d681SAndroid Build Coastguard Worker  %tmp13 = add nsw i32 %tmp9, 8
3605*9880d681SAndroid Build Coastguard Worker  %tmp14 = select i1 %tmp12, i32 %tmp13, i32 %tmp9
3606*9880d681SAndroid Build Coastguard Worker  %tmp15 = trunc i64 %tmp8 to i32
3607*9880d681SAndroid Build Coastguard Worker  %tmp16 = icmp eq i32 %tmp15, %tmp4
3608*9880d681SAndroid Build Coastguard Worker  br i1 %tmp16, label %bb21, label %bb17
3609*9880d681SAndroid Build Coastguard Worker
3610*9880d681SAndroid Build Coastguard Workerbb17:                                             ; preds = %bb6
3611*9880d681SAndroid Build Coastguard Worker  %tmp18 = getelementptr inbounds %struct.small*, %struct.small** %tmp, i64 %tmp8
3612*9880d681SAndroid Build Coastguard Worker  %tmp19 = load %struct.small*, %struct.small** %tmp18, align 8
3613*9880d681SAndroid Build Coastguard Worker  %tmp20 = add i64 %tmp8, 1
3614*9880d681SAndroid Build Coastguard Worker  br label %bb6
3615*9880d681SAndroid Build Coastguard Worker
3616*9880d681SAndroid Build Coastguard Workerbb21:                                             ; preds = %bb6, %bb
3617*9880d681SAndroid Build Coastguard Worker  %tmp22 = phi i32 [ %tmp1, %bb ], [ %tmp14, %bb6 ]
3618*9880d681SAndroid Build Coastguard Worker  %tmp23 = call i32 (...) @dummy(i32 %tmp22)
3619*9880d681SAndroid Build Coastguard Worker  ret i32 undef
3620*9880d681SAndroid Build Coastguard Worker}
3621*9880d681SAndroid Build Coastguard Worker
3622*9880d681SAndroid Build Coastguard Worker; test28a: An array of [32 x i8] and a requested ssp-buffer-size of 33.
3623*9880d681SAndroid Build Coastguard Worker; Requires no protector.
3624*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp stack-protector-buffer-size=33
3625*9880d681SAndroid Build Coastguard Workerdefine i32 @test28a() #3 {
3626*9880d681SAndroid Build Coastguard Workerentry:
3627*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test28a:
3628*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3629*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3630*9880d681SAndroid Build Coastguard Worker
3631*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test28a:
3632*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3633*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3634*9880d681SAndroid Build Coastguard Worker
3635*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test28a:
3636*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3637*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3638*9880d681SAndroid Build Coastguard Worker
3639*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test28a:
3640*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3641*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3642*9880d681SAndroid Build Coastguard Worker
3643*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test28a:
3644*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3645*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3646*9880d681SAndroid Build Coastguard Worker  %test = alloca [32 x i8], align 16
3647*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [32 x i8], [32 x i8]* %test, i32 0, i32 0
3648*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay)
3649*9880d681SAndroid Build Coastguard Worker  ret i32 %call
3650*9880d681SAndroid Build Coastguard Worker}
3651*9880d681SAndroid Build Coastguard Worker
3652*9880d681SAndroid Build Coastguard Worker; test28b: An array of [33 x i8] and a requested ssp-buffer-size of 33.
3653*9880d681SAndroid Build Coastguard Worker; Requires protector.
3654*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp stack-protector-buffer-size=33
3655*9880d681SAndroid Build Coastguard Workerdefine i32 @test28b() #3 {
3656*9880d681SAndroid Build Coastguard Workerentry:
3657*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test28b:
3658*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3659*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3660*9880d681SAndroid Build Coastguard Worker
3661*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test28b:
3662*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3663*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3664*9880d681SAndroid Build Coastguard Worker
3665*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test28b:
3666*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3667*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3668*9880d681SAndroid Build Coastguard Worker
3669*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test28b:
3670*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3671*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3672*9880d681SAndroid Build Coastguard Worker
3673*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test28b:
3674*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3675*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3676*9880d681SAndroid Build Coastguard Worker  %test = alloca [33 x i8], align 16
3677*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [33 x i8], [33 x i8]* %test, i32 0, i32 0
3678*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay)
3679*9880d681SAndroid Build Coastguard Worker  ret i32 %call
3680*9880d681SAndroid Build Coastguard Worker}
3681*9880d681SAndroid Build Coastguard Worker
3682*9880d681SAndroid Build Coastguard Worker; test29a: An array of [4 x i8] and a requested ssp-buffer-size of 5.
3683*9880d681SAndroid Build Coastguard Worker; Requires no protector.
3684*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp stack-protector-buffer-size=5
3685*9880d681SAndroid Build Coastguard Workerdefine i32 @test29a() #4 {
3686*9880d681SAndroid Build Coastguard Workerentry:
3687*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test29a:
3688*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3689*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3690*9880d681SAndroid Build Coastguard Worker
3691*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test29a:
3692*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3693*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3694*9880d681SAndroid Build Coastguard Worker
3695*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test29a:
3696*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3697*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3698*9880d681SAndroid Build Coastguard Worker
3699*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test29a:
3700*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3701*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3702*9880d681SAndroid Build Coastguard Worker
3703*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test29a:
3704*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3705*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3706*9880d681SAndroid Build Coastguard Worker  %test = alloca [4 x i8], align 1
3707*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [4 x i8], [4 x i8]* %test, i32 0, i32 0
3708*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay)
3709*9880d681SAndroid Build Coastguard Worker  ret i32 %call
3710*9880d681SAndroid Build Coastguard Worker}
3711*9880d681SAndroid Build Coastguard Worker
3712*9880d681SAndroid Build Coastguard Worker; test29b: An array of [5 x i8] and a requested ssp-buffer-size of 5.
3713*9880d681SAndroid Build Coastguard Worker; Requires protector.
3714*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp stack-protector-buffer-size=5
3715*9880d681SAndroid Build Coastguard Workerdefine i32 @test29b() #4 {
3716*9880d681SAndroid Build Coastguard Workerentry:
3717*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test29b:
3718*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3719*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3720*9880d681SAndroid Build Coastguard Worker
3721*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test29b:
3722*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3723*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3724*9880d681SAndroid Build Coastguard Worker
3725*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test29b:
3726*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3727*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3728*9880d681SAndroid Build Coastguard Worker
3729*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test29b:
3730*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3731*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3732*9880d681SAndroid Build Coastguard Worker
3733*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test29b:
3734*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3735*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3736*9880d681SAndroid Build Coastguard Worker  %test = alloca [5 x i8], align 1
3737*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [5 x i8], [5 x i8]* %test, i32 0, i32 0
3738*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %arraydecay)
3739*9880d681SAndroid Build Coastguard Worker  ret i32 %call
3740*9880d681SAndroid Build Coastguard Worker}
3741*9880d681SAndroid Build Coastguard Worker
3742*9880d681SAndroid Build Coastguard Worker; test30a: An structure containing an i32 and an array of [5 x i8].
3743*9880d681SAndroid Build Coastguard Worker;          Requested ssp-buffer-size of 6.
3744*9880d681SAndroid Build Coastguard Worker; Requires no protector.
3745*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp stack-protector-buffer-size=6
3746*9880d681SAndroid Build Coastguard Workerdefine i32 @test30a() #5 {
3747*9880d681SAndroid Build Coastguard Workerentry:
3748*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test30a:
3749*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3750*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3751*9880d681SAndroid Build Coastguard Worker
3752*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test30a:
3753*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3754*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3755*9880d681SAndroid Build Coastguard Worker
3756*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test30a:
3757*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3758*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3759*9880d681SAndroid Build Coastguard Worker
3760*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test30a:
3761*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3762*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3763*9880d681SAndroid Build Coastguard Worker
3764*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test30a:
3765*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3766*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3767*9880d681SAndroid Build Coastguard Worker  %test = alloca %struct.small_char, align 4
3768*9880d681SAndroid Build Coastguard Worker  %test.coerce = alloca { i64, i8 }
3769*9880d681SAndroid Build Coastguard Worker  %0 = bitcast { i64, i8 }* %test.coerce to i8*
3770*9880d681SAndroid Build Coastguard Worker  %1 = bitcast %struct.small_char* %test to i8*
3771*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 12, i32 0, i1 false)
3772*9880d681SAndroid Build Coastguard Worker  %2 = getelementptr { i64, i8 }, { i64, i8 }* %test.coerce, i32 0, i32 0
3773*9880d681SAndroid Build Coastguard Worker  %3 = load i64, i64* %2, align 1
3774*9880d681SAndroid Build Coastguard Worker  %4 = getelementptr { i64, i8 }, { i64, i8 }* %test.coerce, i32 0, i32 1
3775*9880d681SAndroid Build Coastguard Worker  %5 = load i8, i8* %4, align 1
3776*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 %3, i8 %5)
3777*9880d681SAndroid Build Coastguard Worker  ret i32 %call
3778*9880d681SAndroid Build Coastguard Worker}
3779*9880d681SAndroid Build Coastguard Worker
3780*9880d681SAndroid Build Coastguard Worker; test30b: An structure containing an i32 and an array of [5 x i8].
3781*9880d681SAndroid Build Coastguard Worker;          Requested ssp-buffer-size of 5.
3782*9880d681SAndroid Build Coastguard Worker; Requires protector.
3783*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp stack-protector-buffer-size=5
3784*9880d681SAndroid Build Coastguard Workerdefine i32 @test30b() #4 {
3785*9880d681SAndroid Build Coastguard Workerentry:
3786*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test30b:
3787*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3788*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3789*9880d681SAndroid Build Coastguard Worker
3790*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test30b:
3791*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3792*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3793*9880d681SAndroid Build Coastguard Worker
3794*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test30b:
3795*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3796*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3797*9880d681SAndroid Build Coastguard Worker
3798*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test30b:
3799*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3800*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3801*9880d681SAndroid Build Coastguard Worker
3802*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test30b:
3803*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3804*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3805*9880d681SAndroid Build Coastguard Worker  %test = alloca %struct.small_char, align 4
3806*9880d681SAndroid Build Coastguard Worker  %test.coerce = alloca { i64, i8 }
3807*9880d681SAndroid Build Coastguard Worker  %0 = bitcast { i64, i8 }* %test.coerce to i8*
3808*9880d681SAndroid Build Coastguard Worker  %1 = bitcast %struct.small_char* %test to i8*
3809*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 12, i32 0, i1 false)
3810*9880d681SAndroid Build Coastguard Worker  %2 = getelementptr { i64, i8 }, { i64, i8 }* %test.coerce, i32 0, i32 0
3811*9880d681SAndroid Build Coastguard Worker  %3 = load i64, i64* %2, align 1
3812*9880d681SAndroid Build Coastguard Worker  %4 = getelementptr { i64, i8 }, { i64, i8 }* %test.coerce, i32 0, i32 1
3813*9880d681SAndroid Build Coastguard Worker  %5 = load i8, i8* %4, align 1
3814*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 %3, i8 %5)
3815*9880d681SAndroid Build Coastguard Worker  ret i32 %call
3816*9880d681SAndroid Build Coastguard Worker}
3817*9880d681SAndroid Build Coastguard Worker
3818*9880d681SAndroid Build Coastguard Worker; test31a: An alloca of size 5.
3819*9880d681SAndroid Build Coastguard Worker;          Requested ssp-buffer-size of 6.
3820*9880d681SAndroid Build Coastguard Worker; Requires no protector.
3821*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp stack-protector-buffer-size=6
3822*9880d681SAndroid Build Coastguard Workerdefine i32 @test31a() #5 {
3823*9880d681SAndroid Build Coastguard Workerentry:
3824*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test31a:
3825*9880d681SAndroid Build Coastguard Worker; LINUX-I386-NOT: calll __stack_chk_fail
3826*9880d681SAndroid Build Coastguard Worker; LINUX-I386: .cfi_endproc
3827*9880d681SAndroid Build Coastguard Worker
3828*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test31a:
3829*9880d681SAndroid Build Coastguard Worker; LINUX-X64-NOT: callq __stack_chk_fail
3830*9880d681SAndroid Build Coastguard Worker; LINUX-X64: .cfi_endproc
3831*9880d681SAndroid Build Coastguard Worker
3832*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test31a:
3833*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-NOT: callq __stack_chk_fail
3834*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: .cfi_endproc
3835*9880d681SAndroid Build Coastguard Worker
3836*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test31a:
3837*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-NOT: callq ___stack_chk_fail
3838*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: .cfi_endproc
3839*9880d681SAndroid Build Coastguard Worker
3840*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test31a:
3841*9880d681SAndroid Build Coastguard Worker; MSVC-I386-NOT: calll @__security_check_cookie@4
3842*9880d681SAndroid Build Coastguard Worker; MSVC-I386: retl
3843*9880d681SAndroid Build Coastguard Worker  %test = alloca i8*, align 8
3844*9880d681SAndroid Build Coastguard Worker  %0 = alloca i8, i64 4
3845*9880d681SAndroid Build Coastguard Worker  store i8* %0, i8** %test, align 8
3846*9880d681SAndroid Build Coastguard Worker  %1 = load i8*, i8** %test, align 8
3847*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %1)
3848*9880d681SAndroid Build Coastguard Worker  ret i32 %call
3849*9880d681SAndroid Build Coastguard Worker}
3850*9880d681SAndroid Build Coastguard Worker
3851*9880d681SAndroid Build Coastguard Worker; test31b: An alloca of size 5.
3852*9880d681SAndroid Build Coastguard Worker;          Requested ssp-buffer-size of 5.
3853*9880d681SAndroid Build Coastguard Worker; Requires protector.
3854*9880d681SAndroid Build Coastguard Workerdefine i32 @test31b() #4 {
3855*9880d681SAndroid Build Coastguard Workerentry:
3856*9880d681SAndroid Build Coastguard Worker; LINUX-I386-LABEL: test31b:
3857*9880d681SAndroid Build Coastguard Worker; LINUX-I386: mov{{l|q}} %gs:
3858*9880d681SAndroid Build Coastguard Worker; LINUX-I386: calll __stack_chk_fail
3859*9880d681SAndroid Build Coastguard Worker
3860*9880d681SAndroid Build Coastguard Worker; LINUX-X64-LABEL: test31b:
3861*9880d681SAndroid Build Coastguard Worker; LINUX-X64: mov{{l|q}} %fs:
3862*9880d681SAndroid Build Coastguard Worker; LINUX-X64: callq __stack_chk_fail
3863*9880d681SAndroid Build Coastguard Worker
3864*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64-LABEL: test31b:
3865*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: mov{{l|q}} %gs:
3866*9880d681SAndroid Build Coastguard Worker; LINUX-KERNEL-X64: callq __stack_chk_fail
3867*9880d681SAndroid Build Coastguard Worker
3868*9880d681SAndroid Build Coastguard Worker; DARWIN-X64-LABEL: test31b:
3869*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: mov{{l|q}} ___stack_chk_guard
3870*9880d681SAndroid Build Coastguard Worker; DARWIN-X64: callq ___stack_chk_fail
3871*9880d681SAndroid Build Coastguard Worker
3872*9880d681SAndroid Build Coastguard Worker; MSVC-I386-LABEL: test31b:
3873*9880d681SAndroid Build Coastguard Worker; MSVC-I386: movl ___security_cookie,
3874*9880d681SAndroid Build Coastguard Worker; MSVC-I386: calll @__security_check_cookie@4
3875*9880d681SAndroid Build Coastguard Worker  %test = alloca i8*, align 8
3876*9880d681SAndroid Build Coastguard Worker  %0 = alloca i8, i64 5
3877*9880d681SAndroid Build Coastguard Worker  store i8* %0, i8** %test, align 8
3878*9880d681SAndroid Build Coastguard Worker  %1 = load i8*, i8** %test, align 8
3879*9880d681SAndroid Build Coastguard Worker  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* %1)
3880*9880d681SAndroid Build Coastguard Worker  ret i32 %call
3881*9880d681SAndroid Build Coastguard Worker}
3882*9880d681SAndroid Build Coastguard Worker
3883*9880d681SAndroid Build Coastguard Workerdefine void @__stack_chk_fail() #1 !dbg !6 {
3884*9880d681SAndroid Build Coastguard Workerentry:
3885*9880d681SAndroid Build Coastguard Worker  ret void
3886*9880d681SAndroid Build Coastguard Worker}
3887*9880d681SAndroid Build Coastguard Worker
3888*9880d681SAndroid Build Coastguard Workerdefine void @test32() #1 !dbg !7 {
3889*9880d681SAndroid Build Coastguard Workerentry:
3890*9880d681SAndroid Build Coastguard Worker  %0 = alloca [5 x i8], align 1
3891*9880d681SAndroid Build Coastguard Worker  ret void
3892*9880d681SAndroid Build Coastguard Worker}
3893*9880d681SAndroid Build Coastguard Worker
3894*9880d681SAndroid Build Coastguard Workerdeclare double @testi_aux()
3895*9880d681SAndroid Build Coastguard Workerdeclare i8* @strcpy(i8*, i8*)
3896*9880d681SAndroid Build Coastguard Workerdeclare i32 @printf(i8*, ...)
3897*9880d681SAndroid Build Coastguard Workerdeclare void @funcall(i32*)
3898*9880d681SAndroid Build Coastguard Workerdeclare void @funcall2(i32**)
3899*9880d681SAndroid Build Coastguard Workerdeclare void @funfloat(float*)
3900*9880d681SAndroid Build Coastguard Workerdeclare void @funfloat2(float**)
3901*9880d681SAndroid Build Coastguard Workerdeclare void @_Z3exceptPi(i32*)
3902*9880d681SAndroid Build Coastguard Workerdeclare i32 @__gxx_personality_v0(...)
3903*9880d681SAndroid Build Coastguard Workerdeclare i32* @getp()
3904*9880d681SAndroid Build Coastguard Workerdeclare i32 @dummy(...)
3905*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1)
3906*9880d681SAndroid Build Coastguard Worker
3907*9880d681SAndroid Build Coastguard Workerattributes #0 = { ssp }
3908*9880d681SAndroid Build Coastguard Workerattributes #1 = { sspstrong }
3909*9880d681SAndroid Build Coastguard Workerattributes #2 = { sspreq }
3910*9880d681SAndroid Build Coastguard Workerattributes #3 = { ssp "stack-protector-buffer-size"="33" }
3911*9880d681SAndroid Build Coastguard Workerattributes #4 = { ssp "stack-protector-buffer-size"="5" }
3912*9880d681SAndroid Build Coastguard Workerattributes #5 = { ssp "stack-protector-buffer-size"="6" }
3913*9880d681SAndroid Build Coastguard Worker
3914*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0}
3915*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!3, !4}
3916*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!5}
3917*9880d681SAndroid Build Coastguard Worker
3918*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)
3919*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "test.c", directory: "/tmp")
3920*9880d681SAndroid Build Coastguard Worker!2 = !{}
3921*9880d681SAndroid Build Coastguard Worker!3 = !{i32 2, !"Dwarf Version", i32 4}
3922*9880d681SAndroid Build Coastguard Worker!4 = !{i32 2, !"Debug Info Version", i32 3}
3923*9880d681SAndroid Build Coastguard Worker!5 = !{!"clang version x.y.z"}
3924*9880d681SAndroid Build Coastguard Worker!6 = distinct !DISubprogram(name: "__stack_chk_fail", scope: !1, unit: !0)
3925*9880d681SAndroid Build Coastguard Worker!7 = distinct !DISubprogram(name: "foo", scope: !1, unit: !0)
3926