Skip to content

Commit

Permalink
Rollup merge of rust-lang#40168 - topecongiro:compile-fail-test-abi-p…
Browse files Browse the repository at this point in the history
…tx, r=petrochenkov

Add compile fail test for abi_ptx

Issue rust-lang#39059.
  • Loading branch information
GuillaumeGomez authored Mar 2, 2017
2 parents b1bd60b + 9141b7b commit 418a776
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/test/compile-fail/feature-gate-abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
// gate-test-intrinsics
// gate-test-platform_intrinsics
// gate-test-abi_vectorcall
// gate-test-abi_ptx

// Functions
extern "rust-intrinsic" fn f1() {} //~ ERROR intrinsics are subject to change
extern "platform-intrinsic" fn f2() {} //~ ERROR platform intrinsics are experimental
extern "vectorcall" fn f3() {} //~ ERROR vectorcall is experimental and subject to change
extern "rust-call" fn f4() {} //~ ERROR rust-call ABI is subject to change
extern "msp430-interrupt" fn f5() {} //~ ERROR msp430-interrupt ABI is experimental
extern "ptx-kernel" fn f6() {} //~ ERROR PTX ABIs are experimental and subject to change

// Methods in trait definition
trait Tr {
Expand All @@ -26,12 +28,14 @@ trait Tr {
extern "vectorcall" fn m3(); //~ ERROR vectorcall is experimental and subject to change
extern "rust-call" fn m4(); //~ ERROR rust-call ABI is subject to change
extern "msp430-interrupt" fn m5(); //~ ERROR msp430-interrupt ABI is experimental
extern "ptx-kernel" fn m6(); //~ ERROR PTX ABIs are experimental and subject to change

extern "rust-intrinsic" fn dm1() {} //~ ERROR intrinsics are subject to change
extern "platform-intrinsic" fn dm2() {} //~ ERROR platform intrinsics are experimental
extern "vectorcall" fn dm3() {} //~ ERROR vectorcall is experimental and subject to change
extern "rust-call" fn dm4() {} //~ ERROR rust-call ABI is subject to change
extern "msp430-interrupt" fn dm5() {} //~ ERROR msp430-interrupt ABI is experimental
extern "ptx-kernel" fn dm6() {} //~ ERROR PTX ABIs are experimental and subject to change
}

struct S;
Expand All @@ -43,6 +47,7 @@ impl Tr for S {
extern "vectorcall" fn m3() {} //~ ERROR vectorcall is experimental and subject to change
extern "rust-call" fn m4() {} //~ ERROR rust-call ABI is subject to change
extern "msp430-interrupt" fn m5() {} //~ ERROR msp430-interrupt ABI is experimental
extern "ptx-kernel" fn m6() {} //~ ERROR PTX ABIs are experimental and subject to change
}

// Methods in inherent impl
Expand All @@ -52,6 +57,7 @@ impl S {
extern "vectorcall" fn im3() {} //~ ERROR vectorcall is experimental and subject to change
extern "rust-call" fn im4() {} //~ ERROR rust-call ABI is subject to change
extern "msp430-interrupt" fn im5() {} //~ ERROR msp430-interrupt ABI is experimental
extern "ptx-kernel" fn im6() {} //~ ERROR PTX ABIs are experimental and subject to change
}

// Function pointer types
Expand All @@ -60,12 +66,14 @@ type A2 = extern "platform-intrinsic" fn(); //~ ERROR platform intrinsics are ex
type A3 = extern "vectorcall" fn(); //~ ERROR vectorcall is experimental and subject to change
type A4 = extern "rust-call" fn(); //~ ERROR rust-call ABI is subject to change
type A5 = extern "msp430-interrupt" fn(); //~ ERROR msp430-interrupt ABI is experimental
type A6 = extern "ptx-kernel" fn (); //~ ERROR PTX ABIs are experimental and subject to change

// Foreign modules
extern "rust-intrinsic" {} //~ ERROR intrinsics are subject to change
extern "platform-intrinsic" {} //~ ERROR platform intrinsics are experimental
extern "vectorcall" {} //~ ERROR vectorcall is experimental and subject to change
extern "rust-call" {} //~ ERROR rust-call ABI is subject to change
extern "msp430-interrupt" {} //~ ERROR msp430-interrupt ABI is experimental
extern "ptx-kernel" {} //~ ERROR PTX ABIs are experimental and subject to change

fn main() {}
2 changes: 1 addition & 1 deletion src/tools/tidy/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub fn check(path: &Path, bad: &mut bool) {

// FIXME get this whitelist empty.
let whitelist = vec![
"abi_ptx", "simd",
"simd",
"stmt_expr_attributes",
"cfg_target_thread_local", "unwind_attributes",
];
Expand Down

0 comments on commit 418a776

Please sign in to comment.