Only add cfguard module flag on windows-msvc

This commit is contained in:
Andrew Paverd 2020-07-06 16:10:42 +01:00
parent e1beee4992
commit 1ca7bfe481
7 changed files with 36 additions and 19 deletions

View file

@ -1,4 +1,5 @@
// compile-flags: -Z control-flow-guard=checks
// only-msvc
#![crate_type = "lib"]

View file

@ -1,4 +1,5 @@
// compile-flags: -Z control-flow-guard=no
// only-msvc
#![crate_type = "lib"]

View file

@ -1,4 +1,5 @@
// compile-flags: -Z control-flow-guard=nochecks
// only-msvc
#![crate_type = "lib"]

View file

@ -0,0 +1,11 @@
// compile-flags: -Z control-flow-guard
// ignore-msvc
#![crate_type = "lib"]
// A basic test function.
pub fn test() {
}
// Ensure the cfguard module flag is not added for non-MSVC targets.
// CHECK-NOT: !"cfguard"

View file

@ -0,0 +1,6 @@
// run-pass
// compile-flags: -Z control-flow-guard
pub fn main() {
println!("hello, world");
}