]> git.lizzy.rs Git - rust.git/blob - tests/codegen/stack-protector.rs
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / codegen / stack-protector.rs
1 // revisions: all strong basic none
2 // ignore-nvptx64 stack protector not supported
3 // [all] compile-flags: -Z stack-protector=all
4 // [strong] compile-flags: -Z stack-protector=strong
5 // [basic] compile-flags: -Z stack-protector=basic
6
7 #![crate_type = "lib"]
8
9 #[no_mangle]
10 pub fn foo() {
11     // CHECK: @foo() unnamed_addr #0
12
13     // all-NOT: attributes #0 = { {{.*}} sspstrong {{.*}} }
14     // all-NOT: attributes #0 = { {{.*}} ssp {{.*}} }
15     // all: attributes #0 = { {{.*}} sspreq {{.*}} }
16     // all-NOT: attributes #0 = { {{.*}} sspstrong {{.*}} }
17     // all-NOT: attributes #0 = { {{.*}} ssp {{.*}} }
18
19     // strong-NOT: attributes #0 = { {{.*}} sspreq {{.*}} }
20     // strong-NOT: attributes #0 = { {{.*}} ssp {{.*}} }
21     // strong: attributes #0 = { {{.*}} sspstrong {{.*}} }
22     // strong-NOT: attributes #0 = { {{.*}} sspreq {{.*}} }
23     // strong-NOT: attributes #0 = { {{.*}} ssp {{.*}} }
24
25     // basic-NOT: attributes #0 = { {{.*}} sspreq {{.*}} }
26     // basic-NOT: attributes #0 = { {{.*}} sspstrong {{.*}} }
27     // basic: attributes #0 = { {{.*}} ssp {{.*}} }
28     // basic-NOT: attributes #0 = { {{.*}} sspreq {{.*}} }
29     // basic-NOT: attributes #0 = { {{.*}} sspstrong {{.*}} }
30
31     // none-NOT: attributes #0 = { {{.*}} sspreq {{.*}} }
32     // none-NOT: attributes #0 = { {{.*}} sspstrong {{.*}} }
33     // none-NOT: attributes #0 = { {{.*}} ssp {{.*}} }
34 }