File tree 9 files changed +43
-104
lines changed
tests/ui/target_modifiers
9 files changed +43
-104
lines changed Original file line number Diff line number Diff line change 1
- //@ compile-flags: --target i686-unknown-linux-gnu -Cpanic=abort
2
- // Auxiliary build problems with aarch64-apple:
3
- // Shared library linking cc seems to convert "-m32" flag into -arch armv4t
4
- // Auxiliary build problems with i686-mingw: linker `cc` not found
5
- //@ only-x86
6
- //@ ignore-windows
7
- //@ ignore-apple
1
+ //@ no-prefer-dynamic
2
+ //@ compile-flags: --target i686-unknown-linux-gnu
8
3
//@ needs-llvm-components: x86
4
+
5
+ #![ feature( no_core) ]
9
6
#![ crate_type = "rlib" ]
10
7
#![ no_core]
11
- #![ feature( no_core, lang_items, repr_simd) ]
12
-
13
- #[ lang = "sized" ]
14
- trait Sized { }
15
- #[ lang = "copy" ]
16
- trait Copy { }
17
-
18
- pub fn somefun ( ) { }
19
-
20
- pub struct S ;
Original file line number Diff line number Diff line change 1
- //@ compile-flags: --target i686-unknown-linux-gnu -Zregparm=2 -Cpanic=abort
2
- // Auxiliary build problems with aarch64-apple:
3
- // Shared library linking cc seems to convert "-m32" flag into -arch armv4t
4
- // Auxiliary build problems with i686-mingw: linker `cc` not found
5
- //@ only-x86
6
- //@ ignore-windows
7
- //@ ignore-apple
1
+ //@ no-prefer-dynamic
2
+ //@ compile-flags: --target i686-unknown-linux-gnu -Zregparm=2
8
3
//@ needs-llvm-components: x86
4
+
5
+ #![ feature( no_core) ]
9
6
#![ crate_type = "rlib" ]
10
7
#![ no_core]
11
- #![ feature( no_core, lang_items, repr_simd) ]
12
-
13
- #[ lang = "sized" ]
14
- trait Sized { }
15
- #[ lang = "copy" ]
16
- trait Copy { }
17
-
18
- pub fn somefun ( ) { }
19
-
20
- pub struct S ;
Original file line number Diff line number Diff line change 1
- //@ compile-flags: --target i686-unknown-linux-gnu -Zregparm=2 -Zreg-struct-return=true -Cpanic=abort
2
- // Auxiliary build problems with aarch64-apple:
3
- // Shared library linking cc seems to convert "-m32" flag into -arch armv4t
4
- // Auxiliary build problems with i686-mingw: linker `cc` not found
5
- //@ only-x86
6
- //@ ignore-windows
7
- //@ ignore-apple
1
+ //@ no-prefer-dynamic
2
+ //@ compile-flags: --target i686-unknown-linux-gnu -Zregparm=2 -Zreg-struct-return=true
8
3
//@ needs-llvm-components: x86
4
+
5
+ #![ feature( no_core) ]
9
6
#![ crate_type = "rlib" ]
10
7
#![ no_core]
11
- #![ feature( no_core, lang_items, repr_simd) ]
12
-
13
- #[ lang = "sized" ]
14
- trait Sized { }
15
- #[ lang = "copy" ]
16
- trait Copy { }
17
-
18
- pub fn somefun ( ) { }
19
-
20
- pub struct S ;
Original file line number Diff line number Diff line change 1
1
error: mixing `-Zreg-struct-return` will cause an ABI mismatch in crate `defaults_check`
2
- --> $DIR/defaults_check.rs:20 :1
2
+ --> $DIR/defaults_check.rs:15 :1
3
3
|
4
- LL | #![crate_type = "rlib" ]
4
+ LL | #![feature(no_core) ]
5
5
| ^
6
6
|
7
7
= help: the `-Zreg-struct-return` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
Original file line number Diff line number Diff line change 1
1
// Tests that default unspecified target modifier value in dependency crate is ok linked
2
2
// with the same value, explicitly specified
3
- //@ aux-crate:default_reg_struct_return=default_reg_struct_return.rs
3
+
4
+ //@ aux-build:default_reg_struct_return.rs
4
5
//@ compile-flags: --target i686-unknown-linux-gnu -Cpanic=abort
5
- //@ revisions:error ok ok_explicit
6
+ //@ needs-llvm-components: x86
7
+
8
+ //@ revisions: ok ok_explicit error
6
9
//@[ok] compile-flags:
7
10
//@[ok_explicit] compile-flags: -Zreg-struct-return=false
8
11
//@[error] compile-flags: -Zreg-struct-return=true
12
+ //@[ok] check-pass
13
+ //@[ok_explicit] check-pass
9
14
10
- // Auxiliary build problems with aarch64-apple:
11
- // Shared library linking cc seems to convert "-m32" flag into -arch armv4t
12
- // Auxiliary build problems with i686-mingw: linker `cc` not found
13
- //@ only-x86
14
- //@ ignore-windows
15
- //@ ignore-apple
16
- //@ needs-llvm-components: x86
17
- //@[ok] build-pass
18
- //@[ok_explicit] build-pass
19
-
20
- #![ crate_type = "rlib" ]
15
+ #![ feature( no_core) ]
21
16
//[error]~^ ERROR mixing `-Zreg-struct-return` will cause an ABI mismatch in crate `defaults_check`
17
+ #![ crate_type = "rlib" ]
22
18
#![ no_core]
23
- #![ feature( no_core, lang_items, repr_simd) ]
24
19
25
- fn foo ( ) {
26
- default_reg_struct_return:: somefun ( ) ;
27
- }
20
+ extern crate default_reg_struct_return;
Original file line number Diff line number Diff line change 1
1
error: mixing `-Zregparm` will cause an ABI mismatch in crate `incompatible_regparm`
2
- --> $DIR/incompatible_regparm.rs:16 :1
2
+ --> $DIR/incompatible_regparm.rs:11 :1
3
3
|
4
- LL | #![crate_type = "rlib" ]
4
+ LL | #![feature(no_core) ]
5
5
| ^
6
6
|
7
7
= help: the `-Zregparm` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
Original file line number Diff line number Diff line change 1
- //@ aux-crate:wrong_regparm=wrong_regparm.rs
2
- //@ compile-flags: --target i686-unknown-linux-gnu -Zregparm=1 -Cpanic=abort
3
- // Auxiliary build problems with aarch64-apple:
4
- // Shared library linking cc seems to convert "-m32" flag into -arch armv4t
5
- // Auxiliary build problems with i686-mingw: linker `cc` not found
6
- //@ only-x86
7
- //@ ignore-windows
8
- //@ ignore-apple
1
+ //@ aux-build:wrong_regparm.rs
2
+ //@ compile-flags: --target i686-unknown-linux-gnu -Zregparm=1
9
3
//@ needs-llvm-components: x86
10
- //@ revisions:error_generated allow_regparm_mismatch allow_no_value
11
4
5
+ //@ revisions:allow_regparm_mismatch allow_no_value error_generated
12
6
//@[allow_regparm_mismatch] compile-flags: -Cunsafe-allow-abi-mismatch=regparm
13
- //@[allow_regparm_mismatch] build-pass
14
7
//@[allow_no_value] compile-flags: -Cunsafe-allow-abi-mismatch
8
+ //@[error_generated] compile-flags:
9
+ //@[allow_regparm_mismatch] check-pass
15
10
16
- #![ crate_type = "rlib" ]
11
+ #![ feature ( no_core ) ]
17
12
//[error_generated]~^ ERROR mixing `-Zregparm` will cause an ABI mismatch in crate `incompatible_regparm`
13
+ #![ crate_type = "rlib" ]
18
14
#![ no_core]
19
- #![ feature( no_core, lang_items, repr_simd) ]
20
15
21
- fn foo ( ) {
22
- wrong_regparm:: somefun ( ) ;
23
- }
16
+ extern crate wrong_regparm;
Original file line number Diff line number Diff line change 1
- //@ aux-crate:wrong_regparm_and_ret=wrong_regparm_and_ret.rs
2
- //@ compile-flags: --target i686-unknown-linux-gnu -Cpanic=abort
3
- // Auxiliary build problems with aarch64-apple:
4
- // Shared library linking cc seems to convert "-m32" flag into -arch armv4t
5
- // Auxiliary build problems with i686-mingw: linker `cc` not found
6
- //@ only-x86
7
- //@ ignore-windows
8
- //@ ignore-apple
1
+ //@ aux-build:wrong_regparm_and_ret.rs
2
+ //@ compile-flags: --target i686-unknown-linux-gnu
9
3
//@ needs-llvm-components: x86
10
- //@ revisions:two_allowed unknown_allowed
11
4
5
+ //@ revisions:two_allowed unknown_allowed
12
6
//@[two_allowed] compile-flags: -Cunsafe-allow-abi-mismatch=regparm,reg-struct-return
13
- //@[two_allowed] build-pass
14
7
//@[unknown_allowed] compile-flags: -Cunsafe-allow-abi-mismatch=unknown_flag -Zregparm=2 -Zreg-struct-return=true
8
+ //@[two_allowed] check-pass
15
9
16
- #![ crate_type = "rlib" ]
10
+ #![ feature ( no_core ) ]
17
11
//[unknown_allowed]~^ ERROR unknown target modifier `unknown_flag`, requested by `-Cunsafe-allow-abi-mismatch=unknown_flag`
12
+ #![ crate_type = "rlib" ]
18
13
#![ no_core]
19
- #![ feature( no_core, lang_items, repr_simd) ]
20
14
21
- fn foo ( ) {
22
- wrong_regparm_and_ret:: somefun ( ) ;
23
- }
15
+ extern crate wrong_regparm_and_ret;
Original file line number Diff line number Diff line change 1
1
error: unknown target modifier `unknown_flag`, requested by `-Cunsafe-allow-abi-mismatch=unknown_flag`
2
- --> $DIR/two_flags.rs:16 :1
2
+ --> $DIR/two_flags.rs:10 :1
3
3
|
4
- LL | #![crate_type = "rlib" ]
4
+ LL | #![feature(no_core) ]
5
5
| ^
6
6
7
7
error: aborting due to 1 previous error
You can’t perform that action at this time.
0 commit comments