]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/simd.rs
Rollup merge of #53545 - FelixMcFelix:fix-50865-beta, r=petrochenkov
[rust.git] / src / test / debuginfo / simd.rs
1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // Need a fix for LLDB first...
12 // ignore-lldb
13 // ignore-tidy-linelength
14
15 // FIXME: LLVM generates invalid debug info for variables requiring
16 // dynamic stack realignment, which is the case on s390x for vector
17 // types with with non-vector ABI.
18 // ignore-s390x
19
20 // compile-flags:-g
21 // gdb-command:run
22
23 // gdbg-command:print/d vi8x16
24 // gdbr-command:print vi8x16
25 // gdbg-check:$1 = {__0 = 0, __1 = 1, __2 = 2, __3 = 3, __4 = 4, __5 = 5, __6 = 6, __7 = 7, __8 = 8, __9 = 9, __10 = 10, __11 = 11, __12 = 12, __13 = 13, __14 = 14, __15 = 15}
26 // gdbr-check:$1 = simd::i8x16 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
27 // gdbg-command:print/d vi16x8
28 // gdbr-command:print vi16x8
29 // gdbg-check:$2 = {__0 = 16, __1 = 17, __2 = 18, __3 = 19, __4 = 20, __5 = 21, __6 = 22, __7 = 23}
30 // gdbr-check:$2 = simd::i16x8 (16, 17, 18, 19, 20, 21, 22, 23)
31 // gdbg-command:print/d vi32x4
32 // gdbr-command:print vi32x4
33 // gdbg-check:$3 = {__0 = 24, __1 = 25, __2 = 26, __3 = 27}
34 // gdbr-check:$3 = simd::i32x4 (24, 25, 26, 27)
35 // gdbg-command:print/d vi64x2
36 // gdbr-command:print vi64x2
37 // gdbg-check:$4 = {__0 = 28, __1 = 29}
38 // gdbr-check:$4 = simd::i64x2 (28, 29)
39
40 // gdbg-command:print/d vu8x16
41 // gdbr-command:print vu8x16
42 // gdbg-check:$5 = {__0 = 30, __1 = 31, __2 = 32, __3 = 33, __4 = 34, __5 = 35, __6 = 36, __7 = 37, __8 = 38, __9 = 39, __10 = 40, __11 = 41, __12 = 42, __13 = 43, __14 = 44, __15 = 45}
43 // gdbr-check:$5 = simd::u8x16 (30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)
44 // gdbg-command:print/d vu16x8
45 // gdbr-command:print vu16x8
46 // gdbg-check:$6 = {__0 = 46, __1 = 47, __2 = 48, __3 = 49, __4 = 50, __5 = 51, __6 = 52, __7 = 53}
47 // gdbr-check:$6 = simd::u16x8 (46, 47, 48, 49, 50, 51, 52, 53)
48 // gdbg-command:print/d vu32x4
49 // gdbr-command:print vu32x4
50 // gdbg-check:$7 = {__0 = 54, __1 = 55, __2 = 56, __3 = 57}
51 // gdbr-check:$7 = simd::u32x4 (54, 55, 56, 57)
52 // gdbg-command:print/d vu64x2
53 // gdbr-command:print vu64x2
54 // gdbg-check:$8 = {__0 = 58, __1 = 59}
55 // gdbr-check:$8 = simd::u64x2 (58, 59)
56
57 // gdb-command:print vf32x4
58 // gdbg-check:$9 = {__0 = 60.5, __1 = 61.5, __2 = 62.5, __3 = 63.5}
59 // gdbr-check:$9 = simd::f32x4 (60.5, 61.5, 62.5, 63.5)
60 // gdb-command:print vf64x2
61 // gdbg-check:$10 = {__0 = 64.5, __1 = 65.5}
62 // gdbr-check:$10 = simd::f64x2 (64.5, 65.5)
63
64 // gdb-command:continue
65
66 #![allow(unused_variables)]
67 #![feature(omit_gdb_pretty_printer_section)]
68 #![omit_gdb_pretty_printer_section]
69 #![feature(repr_simd)]
70
71 #[repr(simd)]
72 struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8);
73 #[repr(simd)]
74 struct i16x8(i16, i16, i16, i16, i16, i16, i16, i16);
75 #[repr(simd)]
76 struct i32x4(i32, i32, i32, i32);
77 #[repr(simd)]
78 struct i64x2(i64, i64);
79 #[repr(simd)]
80 struct u8x16(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8);
81 #[repr(simd)]
82 struct u16x8(u16, u16, u16, u16, u16, u16, u16, u16);
83 #[repr(simd)]
84 struct u32x4(u32, u32, u32, u32);
85 #[repr(simd)]
86 struct u64x2(u64, u64);
87 #[repr(simd)]
88 struct f32x4(f32, f32, f32, f32);
89 #[repr(simd)]
90 struct f64x2(f64, f64);
91
92 fn main() {
93
94     let vi8x16 = i8x16(0, 1, 2, 3, 4, 5, 6, 7,
95                       8, 9, 10, 11, 12, 13, 14, 15);
96
97     let vi16x8 = i16x8(16, 17, 18, 19, 20, 21, 22, 23);
98     let vi32x4 = i32x4(24, 25, 26, 27);
99     let vi64x2 = i64x2(28, 29);
100
101     let vu8x16 = u8x16(30, 31, 32, 33, 34, 35, 36, 37,
102                       38, 39, 40, 41, 42, 43, 44, 45);
103     let vu16x8 = u16x8(46, 47, 48, 49, 50, 51, 52, 53);
104     let vu32x4 = u32x4(54, 55, 56, 57);
105     let vu64x2 = u64x2(58, 59);
106
107     let vf32x4 = f32x4(60.5f32, 61.5f32, 62.5f32, 63.5f32);
108     let vf64x2 = f64x2(64.5f64, 65.5f64);
109
110     zzz(); // #break
111 }
112
113 #[inline(never)]
114 fn zzz() { () }