//@ revisions: z10 z13_no_vector z13_soft_float //@ build-fail //@[z10] compile-flags: --target s390x-unknown-linux-gnu //@[z10] needs-llvm-components: systemz //@[z13_no_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector //@[z13_no_vector] needs-llvm-components: systemz // FIXME: +soft-float itself doesn't set -vector //@[z13_soft_float] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector,+soft-float //@[z13_soft_float] needs-llvm-components: systemz #![feature(no_core, lang_items, repr_simd, s390x_target_feature)] #![no_core] #![crate_type = "lib"] #![allow(non_camel_case_types, improper_ctypes_definitions)] #![deny(abi_unsupported_vector_types)] #[lang = "sized"] pub trait Sized {} #[lang = "copy"] pub trait Copy {} #[lang = "freeze"] pub trait Freeze {} impl Copy for [T; N] {} #[repr(simd)] pub struct i8x8([i8; 8]); #[repr(simd)] pub struct i8x16([i8; 16]); #[repr(simd)] pub struct i8x32([i8; 32]); #[repr(C)] pub struct Wrapper(T); #[repr(transparent)] pub struct TransparentWrapper(T); impl Copy for i8 {} impl Copy for i64 {} impl Copy for i8x8 {} impl Copy for i8x16 {} impl Copy for i8x32 {} impl Copy for Wrapper {} impl Copy for TransparentWrapper {} #[no_mangle] extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 { //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled //~^^ WARN this was previously accepted *x } #[no_mangle] extern "C" fn vector_ret(x: &i8x16) -> i8x16 { //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled //~^^ WARN this was previously accepted *x } #[no_mangle] extern "C" fn vector_ret_large(x: &i8x32) -> i8x32 { // Ok *x } #[no_mangle] #[target_feature(enable = "vector")] unsafe extern "C" fn vector_ret_target_feature_small(x: &i8x8) -> i8x8 { // Ok *x } #[no_mangle] #[target_feature(enable = "vector")] unsafe extern "C" fn vector_target_feature_ret(x: &i8x16) -> i8x16 { // Ok *x } #[no_mangle] #[target_feature(enable = "vector")] unsafe extern "C" fn vector_ret_target_feature_large(x: &i8x32) -> i8x32 { // Ok *x } #[no_mangle] extern "C" fn vector_wrapper_ret_small(x: &Wrapper) -> Wrapper { // Ok *x } #[no_mangle] extern "C" fn vector_wrapper_ret(x: &Wrapper) -> Wrapper { // Ok *x } #[no_mangle] extern "C" fn vector_wrapper_ret_large(x: &Wrapper) -> Wrapper { // Ok *x } #[no_mangle] extern "C" fn vector_transparent_wrapper_ret_small( x: &TransparentWrapper, ) -> TransparentWrapper { //~^^^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled //~^^^^ WARN this was previously accepted *x } #[no_mangle] extern "C" fn vector_transparent_wrapper_ret( x: &TransparentWrapper, ) -> TransparentWrapper { //~^^^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled //~^^^^ WARN this was previously accepted *x } #[no_mangle] extern "C" fn vector_transparent_wrapper_ret_large( x: &TransparentWrapper, ) -> TransparentWrapper { // Ok *x } #[no_mangle] extern "C" fn vector_arg_small(x: i8x8) -> i64 { //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled //~^^ WARN this was previously accepted unsafe { *(&x as *const i8x8 as *const i64) } } #[no_mangle] extern "C" fn vector_arg(x: i8x16) -> i64 { //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled //~^^ WARN this was previously accepted unsafe { *(&x as *const i8x16 as *const i64) } } #[no_mangle] extern "C" fn vector_arg_large(x: i8x32) -> i64 { // Ok unsafe { *(&x as *const i8x32 as *const i64) } } #[no_mangle] extern "C" fn vector_wrapper_arg_small(x: Wrapper) -> i64 { //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled //~^^ WARN this was previously accepted unsafe { *(&x as *const Wrapper as *const i64) } } #[no_mangle] extern "C" fn vector_wrapper_arg(x: Wrapper) -> i64 { //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled //~^^ WARN this was previously accepted unsafe { *(&x as *const Wrapper as *const i64) } } #[no_mangle] extern "C" fn vector_wrapper_arg_large(x: Wrapper) -> i64 { // Ok unsafe { *(&x as *const Wrapper as *const i64) } } #[no_mangle] extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper) -> i64 { //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled //~^^ WARN this was previously accepted unsafe { *(&x as *const TransparentWrapper as *const i64) } } #[no_mangle] extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper) -> i64 { //~^ ERROR this function definition uses a SIMD vector type that (with the chosen ABI) requires the `vector` target feature, which is not enabled //~^^ WARN this was previously accepted unsafe { *(&x as *const TransparentWrapper as *const i64) } } #[no_mangle] extern "C" fn vector_transparent_wrapper_arg_large(x: TransparentWrapper) -> i64 { // Ok unsafe { *(&x as *const TransparentWrapper as *const i64) } }