1- //@ revisions: all strong basic none missing
1+ //@ revisions: all strong none missing
22//@ assembly-output: emit-asm
33//@ only-windows
44//@ only-msvc
55//@ ignore-32bit 64-bit table based SEH has slightly different behaviors than classic SEH
66//@ [all] compile-flags: -C stack-protector=all
77//@ [strong] compile-flags: -C stack-protector=strong
8- //@ [basic] compile-flags: -C stack-protector=basic
98//@ [none] compile-flags: -C stack-protector=none
109//@ compile-flags: -C opt-level=2 -Z merge-functions=disabled
1110
1716pub fn emptyfn ( ) {
1817 // all: __security_check_cookie
1918 // strong-NOT: __security_check_cookie
20- // basic-NOT: __security_check_cookie
2119 // none-NOT: __security_check_cookie
2220 // missing-NOT: __security_check_cookie
2321}
@@ -35,7 +33,6 @@ pub fn array_char(f: fn(*const char)) {
3533
3634 // all: __security_check_cookie
3735 // strong: __security_check_cookie
38- // basic: __security_check_cookie
3936 // none-NOT: __security_check_cookie
4037 // missing-NOT: __security_check_cookie
4138}
@@ -51,7 +48,6 @@ pub fn array_u8_1(f: fn(*const u8)) {
5148
5249 // all: __security_check_cookie
5350 // strong: __security_check_cookie
54- // basic-NOT: __security_check_cookie
5551 // none-NOT: __security_check_cookie
5652 // missing-NOT: __security_check_cookie
5753}
@@ -65,10 +61,10 @@ pub fn array_u8_small(f: fn(*const u8)) {
6561 f ( & b as * const _ ) ;
6662
6763 // Small arrays do not lead to stack protection by the 'basic' heuristic.
64+ // (basic is not currently supported, leaving the test anyway).
6865
6966 // all: __security_check_cookie
7067 // strong: __security_check_cookie
71- // basic-NOT: __security_check_cookie
7268 // none-NOT: __security_check_cookie
7369 // missing-NOT: __security_check_cookie
7470}
@@ -81,10 +77,10 @@ pub fn array_u8_large(f: fn(*const u8)) {
8177
8278 // Since `a` is a byte array with size greater than 8, the basic heuristic
8379 // will also protect this function.
80+ // (basic is not currently supported, leaving the test anyway).
8481
8582 // all: __security_check_cookie
8683 // strong: __security_check_cookie
87- // basic: __security_check_cookie
8884 // none-NOT: __security_check_cookie
8985 // missing-NOT: __security_check_cookie
9086}
@@ -100,10 +96,10 @@ pub fn array_bytesizednewtype_9(f: fn(*const ByteSizedNewtype)) {
10096
10197 // Since `a` is a byte array in the LLVM output, the basic heuristic will
10298 // also protect this function.
99+ // (basic is not currently supported, leaving the test anyway).
103100
104101 // all: __security_check_cookie
105102 // strong: __security_check_cookie
106- // basic: __security_check_cookie
107103 // none-NOT: __security_check_cookie
108104 // missing-NOT: __security_check_cookie
109105}
@@ -130,7 +126,6 @@ pub fn local_var_addr_used_indirectly(f: fn(bool)) {
130126
131127 // all: __security_check_cookie
132128 // strong: __security_check_cookie
133- // basic-NOT: __security_check_cookie
134129 // none-NOT: __security_check_cookie
135130 // missing-NOT: __security_check_cookie
136131}
@@ -158,7 +153,6 @@ pub fn local_string_addr_taken(f: fn(&String)) {
158153 // }
159154 // EOF
160155 // ```
161- //
162156
163157 // We should have a __security_check_cookie call in `all` and `strong` modes but
164158 // LLVM does not support generating stack protectors in functions with funclet
@@ -167,7 +161,6 @@ pub fn local_string_addr_taken(f: fn(&String)) {
167161 // all-NOT: __security_check_cookie
168162 // strong-NOT: __security_check_cookie
169163
170- // basic-NOT: __security_check_cookie
171164 // none-NOT: __security_check_cookie
172165 // missing-NOT: __security_check_cookie
173166
@@ -198,7 +191,6 @@ pub fn local_var_addr_taken_used_locally_only(factory: fn() -> i32, sink: fn(i32
198191
199192 // all: __security_check_cookie
200193 // strong-NOT: __security_check_cookie
201- // basic-NOT: __security_check_cookie
202194 // none-NOT: __security_check_cookie
203195 // missing-NOT: __security_check_cookie
204196}
@@ -235,7 +227,6 @@ pub fn local_large_var_moved(f: fn(Gigastruct)) {
235227
236228 // all: __security_check_cookie
237229 // strong: __security_check_cookie
238- // basic: __security_check_cookie
239230 // none-NOT: __security_check_cookie
240231 // missing-NOT: __security_check_cookie
241232}
@@ -264,7 +255,6 @@ pub fn local_large_var_cloned(f: fn(Gigastruct)) {
264255
265256 // all: __security_check_cookie
266257 // strong: __security_check_cookie
267- // basic: __security_check_cookie
268258 // none-NOT: __security_check_cookie
269259 // missing-NOT: __security_check_cookie
270260}
@@ -304,7 +294,6 @@ pub fn alloca_small_compile_time_constant_arg(f: fn(*mut ())) {
304294
305295 // all: __security_check_cookie
306296 // strong-NOT: __security_check_cookie
307- // basic-NOT: __security_check_cookie
308297 // none-NOT: __security_check_cookie
309298 // missing-NOT: __security_check_cookie
310299}
@@ -316,7 +305,6 @@ pub fn alloca_large_compile_time_constant_arg(f: fn(*mut ())) {
316305
317306 // all: __security_check_cookie
318307 // strong-NOT: __security_check_cookie
319- // basic-NOT: __security_check_cookie
320308 // none-NOT: __security_check_cookie
321309 // missing-NOT: __security_check_cookie
322310}
@@ -328,7 +316,6 @@ pub fn alloca_dynamic_arg(f: fn(*mut ()), n: usize) {
328316
329317 // all: __security_check_cookie
330318 // strong-NOT: __security_check_cookie
331- // basic-NOT: __security_check_cookie
332319 // none-NOT: __security_check_cookie
333320 // missing-NOT: __security_check_cookie
334321}
@@ -360,7 +347,6 @@ pub fn unsized_fn_param(s: [u8], l: bool, f: fn([u8])) {
360347 // all-NOT: __security_check_cookie
361348 // strong-NOT: __security_check_cookie
362349
363- // basic-NOT: __security_check_cookie
364350 // none-NOT: __security_check_cookie
365351 // missing-NOT: __security_check_cookie
366352}
0 commit comments