File tree 4 files changed +63
-0
lines changed
4 files changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+ // Checks that we leave the target alone MACOSX_DEPLOYMENT_TARGET is unset.
3
+ // See issue #60235.
4
+
5
+ // compile-flags: -O --target=i686-apple-darwin --crate-type=rlib
6
+ // unset-rustc-env:MACOSX_DEPLOYMENT_TARGET
7
+ #![ feature( no_core, lang_items) ]
8
+ #![ no_core]
9
+
10
+ #[ lang="sized" ]
11
+ trait Sized { }
12
+ #[ lang="freeze" ]
13
+ trait Freeze { }
14
+ #[ lang="copy" ]
15
+ trait Copy { }
16
+
17
+ #[ repr( C ) ]
18
+ pub struct Bool {
19
+ b : bool ,
20
+ }
21
+
22
+ // CHECK: target triple = "i686-apple-darwin"
23
+ #[ no_mangle]
24
+ pub extern "C" fn structbool ( ) -> Bool {
25
+ Bool { b : true }
26
+ }
Original file line number Diff line number Diff line change
1
+ //
2
+ // Checks that we leave the target alone when MACOSX_DEPLOYMENT_TARGET is unset.
3
+ // See issue #60235.
4
+
5
+ // compile-flags: -O --target=x86_64-apple-darwin --crate-type=rlib
6
+ // unset-rustc-env:MACOSX_DEPLOYMENT_TARGET
7
+ #![ feature( no_core, lang_items) ]
8
+ #![ no_core]
9
+
10
+ #[ lang="sized" ]
11
+ trait Sized { }
12
+ #[ lang="freeze" ]
13
+ trait Freeze { }
14
+ #[ lang="copy" ]
15
+ trait Copy { }
16
+
17
+ #[ repr( C ) ]
18
+ pub struct Bool {
19
+ b : bool ,
20
+ }
21
+
22
+ // CHECK: target triple = "x86_64-apple-darwin"
23
+ #[ no_mangle]
24
+ pub extern "C" fn structbool ( ) -> Bool {
25
+ Bool { b : true }
26
+ }
Original file line number Diff line number Diff line change @@ -305,6 +305,9 @@ pub struct TestProps {
305
305
pub extern_private : Vec < String > ,
306
306
// Environment settings to use for compiling
307
307
pub rustc_env : Vec < ( String , String ) > ,
308
+ // Environment variables to unset prior to compiling.
309
+ // Variables are unset before applying 'rustc_env'.
310
+ pub unset_rustc_env : Vec < String > ,
308
311
// Environment settings to use during execution
309
312
pub exec_env : Vec < ( String , String ) > ,
310
313
// Lines to check if they appear in the expected debugger output
@@ -373,6 +376,7 @@ impl TestProps {
373
376
extern_private : vec ! [ ] ,
374
377
revisions : vec ! [ ] ,
375
378
rustc_env : vec ! [ ] ,
379
+ unset_rustc_env : vec ! [ ] ,
376
380
exec_env : vec ! [ ] ,
377
381
check_lines : vec ! [ ] ,
378
382
build_aux_docs : false ,
@@ -499,6 +503,10 @@ impl TestProps {
499
503
self . rustc_env . push ( ee) ;
500
504
}
501
505
506
+ if let Some ( ev) = config. parse_name_value_directive ( ln, "unset-rustc-env" ) {
507
+ self . unset_rustc_env . push ( ev) ;
508
+ }
509
+
502
510
if let Some ( cl) = config. parse_check_line ( ln) {
503
511
self . check_lines . push ( cl) ;
504
512
}
Original file line number Diff line number Diff line change @@ -1692,6 +1692,9 @@ impl<'test> TestCx<'test> {
1692
1692
add_extern_priv ( & private_lib, true ) ;
1693
1693
}
1694
1694
1695
+ self . props . unset_rustc_env . clone ( )
1696
+ . iter ( )
1697
+ . fold ( & mut rustc, |rustc, v| rustc. env_remove ( v) ) ;
1695
1698
rustc. envs ( self . props . rustc_env . clone ( ) ) ;
1696
1699
self . compose_and_run (
1697
1700
rustc,
You can’t perform that action at this time.
0 commit comments