File tree 3 files changed +32
-0
lines changed
3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ // This test checks that the "ignore-cfg" compiletest option is evaluated
2
+ // based on the "--target" option in "compile-flags", rather than
3
+ // the default platform.
4
+ //
5
+ // compile-flags: --target x86_64-unknown-linux-gnu
6
+ // needs-llvm-components: x86
7
+ // ignore-cfg: target_os=linux
8
+ // check-pass
9
+
10
+ compile_error ! ( "this should never be compiled" ) ;
11
+
12
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ // This test checks that the "ignore-cfg" compiletest option matches
2
+ // up with rustc's builtin evaluation of cfgs.
3
+ //
4
+ // ignore-cfg: target_family=unix
5
+ // check-pass
6
+
7
+ #[ cfg( target_family = "unix" ) ]
8
+ compile_error ! ( "this shouldn't be compiled on unix" ) ;
9
+
10
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ // This test checks that the "ignore-cfg" compiletest option matches
2
+ // up with rustc's builtin evaluation of cfgs.
3
+ //
4
+ // only-cfg: target_family=unix
5
+ // check-pass
6
+
7
+ #[ cfg( not( target_family = "unix" ) ) ]
8
+ compile_error ! ( "this should only be compiled on unix" ) ;
9
+
10
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments