rust/tests/debuginfo/simd.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
2.3 KiB
Rust
Raw Permalink Normal View History

// Need a fix for LLDB first...
//@ ignore-lldb
2014-02-19 20:54:19 +08:00
Add s390x support This adds support for building the Rust compiler and standard library for s390x-linux, allowing a full cross-bootstrap sequence to complete. This includes: - Makefile/configure changes to allow native s390x builds - Full Rust compiler support for the s390x C ABI (only the non-vector ABI is supported at this point) - Port of the standard library to s390x - Update the liblibc submodule to a version including s390x support - Testsuite fixes to allow clean "make check" on s390x Caveats: - Resets base cpu to "z10" to bring support in sync with the default behaviour of other compilers on the platforms. (Usually, upstream supports all older processors; a distribution build may then chose to require a more recent base version.) (Also, using zEC12 causes failures in the valgrind tests since valgrind doesn't fully support this CPU yet.) - z13 vector ABI is not yet supported. To ensure compatible code generation, the -vector feature is passed to LLVM. Note that this means that even when compiling for z13, no vector instructions will be used. In the future, support for the vector ABI should be added (this will require common code support for different ABIs that need different data_layout strings on the same platform). - Two test cases are (temporarily) ignored on s390x to allow passing the test suite. The underlying issues still need to be fixed: * debuginfo/simd.rs fails because of incorrect debug information. This seems to be a LLVM bug (also seen with C code). * run-pass/union/union-basic.rs simply seems to be incorrect for all big-endian platforms. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-10 05:00:23 +08:00
// FIXME: LLVM generates invalid debug info for variables requiring
// dynamic stack realignment, which is the case on s390x for vector
// types with non-vector ABI.
Add s390x support This adds support for building the Rust compiler and standard library for s390x-linux, allowing a full cross-bootstrap sequence to complete. This includes: - Makefile/configure changes to allow native s390x builds - Full Rust compiler support for the s390x C ABI (only the non-vector ABI is supported at this point) - Port of the standard library to s390x - Update the liblibc submodule to a version including s390x support - Testsuite fixes to allow clean "make check" on s390x Caveats: - Resets base cpu to "z10" to bring support in sync with the default behaviour of other compilers on the platforms. (Usually, upstream supports all older processors; a distribution build may then chose to require a more recent base version.) (Also, using zEC12 causes failures in the valgrind tests since valgrind doesn't fully support this CPU yet.) - z13 vector ABI is not yet supported. To ensure compatible code generation, the -vector feature is passed to LLVM. Note that this means that even when compiling for z13, no vector instructions will be used. In the future, support for the vector ABI should be added (this will require common code support for different ABIs that need different data_layout strings on the same platform). - Two test cases are (temporarily) ignored on s390x to allow passing the test suite. The underlying issues still need to be fixed: * debuginfo/simd.rs fails because of incorrect debug information. This seems to be a LLVM bug (also seen with C code). * run-pass/union/union-basic.rs simply seems to be incorrect for all big-endian platforms. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-10 05:00:23 +08:00
//@ ignore-s390x
2014-02-19 20:54:19 +08:00
//@ compile-flags:-g
// gdb-command:run
2014-02-19 20:54:19 +08:00
2024-08-18 05:31:49 +08:00
// gdb-command:print vi8x16
2024-08-22 16:28:20 +08:00
// gdb-check:$1 = simd::i8x16 ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
2024-08-18 05:31:49 +08:00
// gdb-command:print vi16x8
2024-08-22 16:28:20 +08:00
// gdb-check:$2 = simd::i16x8 ([16, 17, 18, 19, 20, 21, 22, 23])
2024-08-18 05:31:49 +08:00
// gdb-command:print vi32x4
2024-08-22 16:28:20 +08:00
// gdb-check:$3 = simd::i32x4 ([24, 25, 26, 27])
2024-08-18 05:31:49 +08:00
// gdb-command:print vi64x2
2024-08-22 16:28:20 +08:00
// gdb-check:$4 = simd::i64x2 ([28, 29])
2024-08-18 05:31:49 +08:00
// gdb-command:print vu8x16
2024-08-22 16:28:20 +08:00
// gdb-check:$5 = simd::u8x16 ([30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45])
2024-08-18 05:31:49 +08:00
// gdb-command:print vu16x8
2024-08-22 16:28:20 +08:00
// gdb-check:$6 = simd::u16x8 ([46, 47, 48, 49, 50, 51, 52, 53])
2024-08-18 05:31:49 +08:00
// gdb-command:print vu32x4
2024-08-22 16:28:20 +08:00
// gdb-check:$7 = simd::u32x4 ([54, 55, 56, 57])
2024-08-18 05:31:49 +08:00
// gdb-command:print vu64x2
2024-08-22 16:28:20 +08:00
// gdb-check:$8 = simd::u64x2 ([58, 59])
2014-02-19 20:54:19 +08:00
2014-10-03 06:12:58 +08:00
// gdb-command:print vf32x4
2024-08-22 16:28:20 +08:00
// gdb-check:$9 = simd::f32x4 ([60.5, 61.5, 62.5, 63.5])
2014-10-03 06:12:58 +08:00
// gdb-command:print vf64x2
2024-08-22 16:28:20 +08:00
// gdb-check:$10 = simd::f64x2 ([64.5, 65.5])
2014-02-19 20:54:19 +08:00
// gdb-command:continue
2014-02-19 20:54:19 +08:00
2014-10-28 06:37:07 +08:00
#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
#![omit_gdb_pretty_printer_section]
#![feature(repr_simd)]
2014-02-19 20:54:19 +08:00
#[repr(simd)]
2024-08-22 16:28:20 +08:00
struct i8x16([i8; 16]);
#[repr(simd)]
2024-08-22 16:28:20 +08:00
struct i16x8([i16; 8]);
#[repr(simd)]
2024-08-22 16:28:20 +08:00
struct i32x4([i32; 4]);
#[repr(simd)]
2024-08-22 16:28:20 +08:00
struct i64x2([i64; 2]);
#[repr(simd)]
2024-08-22 16:28:20 +08:00
struct u8x16([u8; 16]);
#[repr(simd)]
2024-08-22 16:28:20 +08:00
struct u16x8([u16; 8]);
#[repr(simd)]
2024-08-22 16:28:20 +08:00
struct u32x4([u32; 4]);
#[repr(simd)]
2024-08-22 16:28:20 +08:00
struct u64x2([u64; 2]);
#[repr(simd)]
2024-08-22 16:28:20 +08:00
struct f32x4([f32; 4]);
#[repr(simd)]
2024-08-22 16:28:20 +08:00
struct f64x2([f64; 2]);
2014-02-19 20:54:19 +08:00
fn main() {
2024-08-22 16:28:20 +08:00
let vi8x16 = i8x16([0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15]);
2024-08-22 16:28:20 +08:00
let vi16x8 = i16x8([16, 17, 18, 19, 20, 21, 22, 23]);
let vi32x4 = i32x4([24, 25, 26, 27]);
let vi64x2 = i64x2([28, 29]);
2024-08-22 16:28:20 +08:00
let vu8x16 = u8x16([30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45]);
let vu16x8 = u16x8([46, 47, 48, 49, 50, 51, 52, 53]);
let vu32x4 = u32x4([54, 55, 56, 57]);
let vu64x2 = u64x2([58, 59]);
2014-02-19 20:54:19 +08:00
2024-08-22 16:28:20 +08:00
let vf32x4 = f32x4([60.5f32, 61.5f32, 62.5f32, 63.5f32]);
let vf64x2 = f64x2([64.5f64, 65.5f64]);
2014-02-19 20:54:19 +08:00
zzz(); // #break
2014-02-19 20:54:19 +08:00
}
#[inline(never)]
fn zzz() { () }