File tree 2 files changed +39
-0
lines changed
src/test/run-make/repr128-dwarf
2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ # ignore-windows
2
+ # This test should be replaced with one in src/test/debuginfo once GDB or LLDB support 128-bit
3
+ # enums.
4
+
5
+ include ../../run-make-fulldeps/tools.mk
6
+
7
+ all :
8
+ $(RUSTC ) -Cdebuginfo=2 lib.rs -o $(TMPDIR ) /repr128.rlib
9
+ " $( LLVM_BIN_DIR) " /llvm-dwarfdump -n U128A $(TMPDIR ) /repr128.rlib | $(CGREP ) " DW_AT_const_value (<0x10> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 )"
10
+ " $( LLVM_BIN_DIR) " /llvm-dwarfdump -n U128B $(TMPDIR ) /repr128.rlib | $(CGREP ) " DW_AT_const_value (<0x10> 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 )"
11
+ " $( LLVM_BIN_DIR) " /llvm-dwarfdump -n U128C $(TMPDIR ) /repr128.rlib | $(CGREP ) " DW_AT_const_value (<0x10> 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 )"
12
+ " $( LLVM_BIN_DIR) " /llvm-dwarfdump -n U128D $(TMPDIR ) /repr128.rlib | $(CGREP ) " DW_AT_const_value (<0x10> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff )"
13
+ " $( LLVM_BIN_DIR) " /llvm-dwarfdump -n I128A $(TMPDIR ) /repr128.rlib | $(CGREP ) " DW_AT_const_value (<0x10> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 )"
14
+ " $( LLVM_BIN_DIR) " /llvm-dwarfdump -n I128B $(TMPDIR ) /repr128.rlib | $(CGREP ) " DW_AT_const_value (<0x10> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff )"
15
+ " $( LLVM_BIN_DIR) " /llvm-dwarfdump -n I128C $(TMPDIR ) /repr128.rlib | $(CGREP ) " DW_AT_const_value (<0x10> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 )"
16
+ " $( LLVM_BIN_DIR) " /llvm-dwarfdump -n I128D $(TMPDIR ) /repr128.rlib | $(CGREP ) " DW_AT_const_value (<0x10> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 7f )"
Original file line number Diff line number Diff line change
1
+ #![ crate_type = "lib" ]
2
+ #![ feature( repr128) ]
3
+
4
+ // Use .to_le() to ensure that the bytes are in the same order on both little- and big-endian
5
+ // platforms.
6
+
7
+ #[ repr( u128 ) ]
8
+ pub enum U128Enum {
9
+ U128A = 0_u128 . to_le ( ) ,
10
+ U128B = 1_u128 . to_le ( ) ,
11
+ U128C = ( u64:: MAX as u128 + 1 ) . to_le ( ) ,
12
+ U128D = u128:: MAX . to_le ( ) ,
13
+ }
14
+
15
+ #[ repr( i128 ) ]
16
+ pub enum I128Enum {
17
+ I128A = 0_i128 . to_le ( ) ,
18
+ I128B = ( -1_i128 ) . to_le ( ) ,
19
+ I128C = i128:: MIN . to_le ( ) ,
20
+ I128D = i128:: MAX . to_le ( ) ,
21
+ }
22
+
23
+ pub fn f ( _: U128Enum , _: I128Enum ) { }
You can’t perform that action at this time.
0 commit comments