1
- //@ revisions: all strong basic none missing
1
+ //@ revisions: all strong none missing
2
2
//@ assembly-output: emit-asm
3
3
//@ only-windows
4
4
//@ only-msvc
5
5
//@ ignore-32bit 64-bit table based SEH has slightly different behaviors than classic SEH
6
6
//@ [all] compile-flags: -C stack-protector=all
7
7
//@ [strong] compile-flags: -C stack-protector=strong
8
- //@ [basic] compile-flags: -C stack-protector=basic
9
8
//@ [none] compile-flags: -C stack-protector=none
10
9
//@ compile-flags: -C opt-level=2 -Z merge-functions=disabled
11
10
17
16
pub fn emptyfn ( ) {
18
17
// all: __security_check_cookie
19
18
// strong-NOT: __security_check_cookie
20
- // basic-NOT: __security_check_cookie
21
19
// none-NOT: __security_check_cookie
22
20
// missing-NOT: __security_check_cookie
23
21
}
@@ -35,7 +33,6 @@ pub fn array_char(f: fn(*const char)) {
35
33
36
34
// all: __security_check_cookie
37
35
// strong: __security_check_cookie
38
- // basic: __security_check_cookie
39
36
// none-NOT: __security_check_cookie
40
37
// missing-NOT: __security_check_cookie
41
38
}
@@ -51,7 +48,6 @@ pub fn array_u8_1(f: fn(*const u8)) {
51
48
52
49
// all: __security_check_cookie
53
50
// strong: __security_check_cookie
54
- // basic-NOT: __security_check_cookie
55
51
// none-NOT: __security_check_cookie
56
52
// missing-NOT: __security_check_cookie
57
53
}
@@ -65,10 +61,10 @@ pub fn array_u8_small(f: fn(*const u8)) {
65
61
f ( & b as * const _ ) ;
66
62
67
63
// Small arrays do not lead to stack protection by the 'basic' heuristic.
64
+ // (basic is not currently supported, leaving the test anyway).
68
65
69
66
// all: __security_check_cookie
70
67
// strong: __security_check_cookie
71
- // basic-NOT: __security_check_cookie
72
68
// none-NOT: __security_check_cookie
73
69
// missing-NOT: __security_check_cookie
74
70
}
@@ -81,10 +77,10 @@ pub fn array_u8_large(f: fn(*const u8)) {
81
77
82
78
// Since `a` is a byte array with size greater than 8, the basic heuristic
83
79
// will also protect this function.
80
+ // (basic is not currently supported, leaving the test anyway).
84
81
85
82
// all: __security_check_cookie
86
83
// strong: __security_check_cookie
87
- // basic: __security_check_cookie
88
84
// none-NOT: __security_check_cookie
89
85
// missing-NOT: __security_check_cookie
90
86
}
@@ -100,10 +96,10 @@ pub fn array_bytesizednewtype_9(f: fn(*const ByteSizedNewtype)) {
100
96
101
97
// Since `a` is a byte array in the LLVM output, the basic heuristic will
102
98
// also protect this function.
99
+ // (basic is not currently supported, leaving the test anyway).
103
100
104
101
// all: __security_check_cookie
105
102
// strong: __security_check_cookie
106
- // basic: __security_check_cookie
107
103
// none-NOT: __security_check_cookie
108
104
// missing-NOT: __security_check_cookie
109
105
}
@@ -130,7 +126,6 @@ pub fn local_var_addr_used_indirectly(f: fn(bool)) {
130
126
131
127
// all: __security_check_cookie
132
128
// strong: __security_check_cookie
133
- // basic-NOT: __security_check_cookie
134
129
// none-NOT: __security_check_cookie
135
130
// missing-NOT: __security_check_cookie
136
131
}
@@ -158,7 +153,6 @@ pub fn local_string_addr_taken(f: fn(&String)) {
158
153
// }
159
154
// EOF
160
155
// ```
161
- //
162
156
163
157
// We should have a __security_check_cookie call in `all` and `strong` modes but
164
158
// LLVM does not support generating stack protectors in functions with funclet
@@ -167,7 +161,6 @@ pub fn local_string_addr_taken(f: fn(&String)) {
167
161
// all-NOT: __security_check_cookie
168
162
// strong-NOT: __security_check_cookie
169
163
170
- // basic-NOT: __security_check_cookie
171
164
// none-NOT: __security_check_cookie
172
165
// missing-NOT: __security_check_cookie
173
166
@@ -198,7 +191,6 @@ pub fn local_var_addr_taken_used_locally_only(factory: fn() -> i32, sink: fn(i32
198
191
199
192
// all: __security_check_cookie
200
193
// strong-NOT: __security_check_cookie
201
- // basic-NOT: __security_check_cookie
202
194
// none-NOT: __security_check_cookie
203
195
// missing-NOT: __security_check_cookie
204
196
}
@@ -235,7 +227,6 @@ pub fn local_large_var_moved(f: fn(Gigastruct)) {
235
227
236
228
// all: __security_check_cookie
237
229
// strong: __security_check_cookie
238
- // basic: __security_check_cookie
239
230
// none-NOT: __security_check_cookie
240
231
// missing-NOT: __security_check_cookie
241
232
}
@@ -264,7 +255,6 @@ pub fn local_large_var_cloned(f: fn(Gigastruct)) {
264
255
265
256
// all: __security_check_cookie
266
257
// strong: __security_check_cookie
267
- // basic: __security_check_cookie
268
258
// none-NOT: __security_check_cookie
269
259
// missing-NOT: __security_check_cookie
270
260
}
@@ -304,7 +294,6 @@ pub fn alloca_small_compile_time_constant_arg(f: fn(*mut ())) {
304
294
305
295
// all: __security_check_cookie
306
296
// strong-NOT: __security_check_cookie
307
- // basic-NOT: __security_check_cookie
308
297
// none-NOT: __security_check_cookie
309
298
// missing-NOT: __security_check_cookie
310
299
}
@@ -316,7 +305,6 @@ pub fn alloca_large_compile_time_constant_arg(f: fn(*mut ())) {
316
305
317
306
// all: __security_check_cookie
318
307
// strong-NOT: __security_check_cookie
319
- // basic-NOT: __security_check_cookie
320
308
// none-NOT: __security_check_cookie
321
309
// missing-NOT: __security_check_cookie
322
310
}
@@ -328,7 +316,6 @@ pub fn alloca_dynamic_arg(f: fn(*mut ()), n: usize) {
328
316
329
317
// all: __security_check_cookie
330
318
// strong-NOT: __security_check_cookie
331
- // basic-NOT: __security_check_cookie
332
319
// none-NOT: __security_check_cookie
333
320
// missing-NOT: __security_check_cookie
334
321
}
@@ -360,7 +347,6 @@ pub fn unsized_fn_param(s: [u8], l: bool, f: fn([u8])) {
360
347
// all-NOT: __security_check_cookie
361
348
// strong-NOT: __security_check_cookie
362
349
363
- // basic-NOT: __security_check_cookie
364
350
// none-NOT: __security_check_cookie
365
351
// missing-NOT: __security_check_cookie
366
352
}
0 commit comments