File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -468,7 +468,13 @@ impl<'test> TestCx<'test> {
468468
469469 if let Some ( revision) = self . revision {
470470 let normalized_revision = normalize_revision ( revision) ;
471- cmd. args ( & [ "--cfg" , & normalized_revision] ) ;
471+ let cfg_arg = [ "--cfg" , & normalized_revision] ;
472+ if self . props . compile_flags . windows ( 2 ) . any ( |args| args == cfg_arg) {
473+ panic ! (
474+ "warning: redundant cfg argument `{normalized_revision}` is already created by the revision"
475+ ) ;
476+ }
477+ cmd. args ( cfg_arg) ;
472478 }
473479
474480 if !self . props . no_auto_check_cfg {
Original file line number Diff line number Diff line change 22//@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes
33//@ error-pattern: unsafe precondition(s) violated: Layout::from_size_align_unchecked requires
44//@ revisions: toolarge badalign
5- //@[toolarge] compile-flags: --cfg toolarge
6- //@[badalign] compile-flags: --cfg badalign
75
86fn main ( ) {
97 unsafe {
Original file line number Diff line number Diff line change 55//@ revisions: address cfi kcfi leak memory thread
66//@compile-flags: -Ctarget-feature=-crt-static
77//@[address]needs-sanitizer-address
8- //@[address]compile-flags: -Zsanitizer=address --cfg address
8+ //@[address]compile-flags: -Zsanitizer=address
99//@[cfi]needs-sanitizer-cfi
10- //@[cfi]compile-flags: -Zsanitizer=cfi --cfg cfi
10+ //@[cfi]compile-flags: -Zsanitizer=cfi
1111//@[cfi]compile-flags: -Clto -Ccodegen-units=1
1212//@[kcfi]needs-llvm-components: x86
13- //@[kcfi]compile-flags: -Zsanitizer=kcfi --cfg kcfi --target x86_64-unknown-none
13+ //@[kcfi]compile-flags: -Zsanitizer=kcfi --target x86_64-unknown-none
1414//@[kcfi]compile-flags: -C panic=abort
1515//@[leak]needs-sanitizer-leak
16- //@[leak]compile-flags: -Zsanitizer=leak --cfg leak
16+ //@[leak]compile-flags: -Zsanitizer=leak
1717//@[memory]needs-sanitizer-memory
18- //@[memory]compile-flags: -Zsanitizer=memory --cfg memory
18+ //@[memory]compile-flags: -Zsanitizer=memory
1919//@[thread]needs-sanitizer-thread
20- //@[thread]compile-flags: -Zsanitizer=thread --cfg thread
20+ //@[thread]compile-flags: -Zsanitizer=thread
2121
2222#![ feature( cfg_sanitize, no_core, lang_items) ]
2323#![ crate_type="lib" ]
You can’t perform that action at this time.
0 commit comments