• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // gate-test-abi_thiscall
2 // needs-llvm-components: x86
3 // compile-flags: --target=i686-pc-windows-msvc --crate-type=rlib
4 #![no_core]
5 #![feature(no_core, lang_items)]
6 #[lang="sized"]
7 trait Sized { }
8 
9 // Test that the "thiscall" ABI is feature-gated, and cannot be used when
10 // the `abi_thiscall` feature gate is not used.
11 
fu()12 extern "thiscall-unwind" fn fu() {} //~ ERROR thiscall-unwind ABI is experimental
f()13 extern "thiscall" fn f() {} //~ ERROR thiscall is experimental
14 
15 trait T {
m()16     extern "thiscall" fn m(); //~ ERROR thiscall is experimental
mu()17     extern "thiscall-unwind" fn mu(); //~ ERROR thiscall-unwind ABI is experimental
18 
dm()19     extern "thiscall" fn dm() {} //~ ERROR thiscall is experimental
dmu()20     extern "thiscall-unwind" fn dmu() {} //~ ERROR thiscall-unwind ABI is experimental
21 }
22 
23 struct S;
24 impl T for S {
m()25     extern "thiscall" fn m() {} //~ ERROR thiscall is experimental
mu()26     extern "thiscall-unwind" fn mu() {} //~ ERROR thiscall-unwind ABI is experimental
27 }
28 
29 impl S {
im()30     extern "thiscall" fn im() {} //~ ERROR thiscall is experimental
imu()31     extern "thiscall-unwind" fn imu() {} //~ ERROR thiscall-unwind ABI is experimental
32 }
33 
34 type TA = extern "thiscall" fn(); //~ ERROR thiscall is experimental
35 type TAU = extern "thiscall-unwind" fn(); //~ ERROR thiscall-unwind ABI is experimental
36 
37 extern "thiscall" {} //~ ERROR thiscall is experimental
38 extern "thiscall-unwind" {} //~ ERROR thiscall-unwind ABI is experimental
39