-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add negative tests for OS X LLVM target changes
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// Checks that we leave the target alone MACOSX_DEPLOYMENT_TARGET is unset. | ||
// See issue #60235. | ||
|
||
// compile-flags: -O --target=i686-apple-darwin --crate-type=rlib | ||
// unset-rustc-env:MACOSX_DEPLOYMENT_TARGET | ||
#![feature(no_core, lang_items)] | ||
#![no_core] | ||
|
||
#[lang="sized"] | ||
trait Sized { } | ||
#[lang="freeze"] | ||
trait Freeze { } | ||
#[lang="copy"] | ||
trait Copy { } | ||
|
||
#[repr(C)] | ||
pub struct Bool { | ||
b: bool, | ||
} | ||
|
||
// CHECK: target triple = "i686-apple-darwin" | ||
#[no_mangle] | ||
pub extern "C" fn structbool() -> Bool { | ||
Bool { b: true } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// Checks that we leave the target alone when MACOSX_DEPLOYMENT_TARGET is unset. | ||
// See issue #60235. | ||
|
||
// compile-flags: -O --target=x86_64-apple-darwin --crate-type=rlib | ||
// unset-rustc-env:MACOSX_DEPLOYMENT_TARGET | ||
#![feature(no_core, lang_items)] | ||
#![no_core] | ||
|
||
#[lang="sized"] | ||
trait Sized { } | ||
#[lang="freeze"] | ||
trait Freeze { } | ||
#[lang="copy"] | ||
trait Copy { } | ||
|
||
#[repr(C)] | ||
pub struct Bool { | ||
b: bool, | ||
} | ||
|
||
// CHECK: target triple = "x86_64-apple-darwin" | ||
#[no_mangle] | ||
pub extern "C" fn structbool() -> Bool { | ||
Bool { b: true } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters