]> git.lizzy.rs Git - rust.git/blobdiff - src/test/debuginfo/vec-slices.rs
Auto merge of #93284 - eholk:disable-drop-range-analysis, r=pnkfelix
[rust.git] / src / test / debuginfo / vec-slices.rs
index e109b1bf2aeaeac90b6e5749282c1f3a98bd7020..7d88e45caf2576cdedb2cce5115832d63844ac8e 100644 (file)
@@ -1,5 +1,4 @@
 // ignore-windows
-// ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
 // min-lldb-version: 310
 
 // compile-flags:-g
 // gdb-command:print singleton.length
 // gdb-check:$2 = 1
 // gdbg-command:print *((i64[1]*)(singleton.data_ptr))
-// gdbr-command:print *(singleton.data_ptr as &[i64; 1])
+// gdbr-command:print *(singleton.data_ptr as *const [i64; 1])
 // gdbg-check:$3 = {1}
 // gdbr-check:$3 = [1]
 
 // gdb-command:print multiple.length
 // gdb-check:$4 = 4
 // gdbg-command:print *((i64[4]*)(multiple.data_ptr))
-// gdbr-command:print *(multiple.data_ptr as &[i64; 4])
+// gdbr-command:print *(multiple.data_ptr as *const [i64; 4])
 // gdbg-check:$5 = {2, 3, 4, 5}
 // gdbr-check:$5 = [2, 3, 4, 5]
 
 // gdb-command:print slice_of_slice.length
 // gdb-check:$6 = 2
 // gdbg-command:print *((i64[2]*)(slice_of_slice.data_ptr))
-// gdbr-command:print *(slice_of_slice.data_ptr as &[i64; 2])
+// gdbr-command:print *(slice_of_slice.data_ptr as *const [i64; 2])
 // gdbg-check:$7 = {3, 4}
 // gdbr-check:$7 = [3, 4]
 
 // gdbg-check:$13 = {x = 13, y = 14, z = 15}
 // gdbr-check:$13 = vec_slices::AStruct {x: 13, y: 14, z: 15}
 
-// gdbg-command:print 'vec_slices::MUT_VECT_SLICE'.length
-// gdbr-command:print MUT_VECT_SLICE.length
-// gdb-check:$14 = 2
-// gdbg-command:print *((i64[2]*)('vec_slices::MUT_VECT_SLICE'.data_ptr))
-// gdbr-command:print *(MUT_VECT_SLICE.data_ptr as &[i64; 2])
-// gdbg-check:$15 = {64, 65}
-// gdbr-check:$15 = [64, 65]
+// gdb-command:print mut_slice.length
+// gdb-check:$14 = 5
+// gdbg-command:print *((i64[5]*)(mut_slice.data_ptr))
+// gdbr-command:print *(mut_slice.data_ptr as *const [i64; 5])
+// gdbg-check:$15 = {1, 2, 3, 4, 5}
+// gdbr-check:$15 = [1, 2, 3, 4, 5]
 
-//gdb-command:print mut_slice.length
-//gdb-check:$16 = 5
-//gdbg-command:print *((i64[5]*)(mut_slice.data_ptr))
-//gdbr-command:print *(mut_slice.data_ptr as &[i64; 5])
-//gdbg-check:$17 = {1, 2, 3, 4, 5}
-//gdbr-check:$17 = [1, 2, 3, 4, 5]
+// Some lines below are marked with [ignored] because old GDB versions seem to have trouble
+// accessing globals.
 
+// [ignored] gdbg-command:print 'vec_slices::MUT_VECT_SLICE'.length
+// gdbr-command:print MUT_VECT_SLICE.length
+// [ignored] gdbg-check:$16 = 2
+// gdbr-check:$16 = 2
+// [ignored] gdbg-command:print *((i64[2]*)('vec_slices::MUT_VECT_SLICE'.data_ptr))
+// gdbr-command:print *(MUT_VECT_SLICE.data_ptr as *const [i64; 2])
+// [ignored] gdbg-check:$17 = {64, 65}
+// gdbr-check:$17 = [64, 65]
 
 // === LLDB TESTS ==================================================================================
 
 struct AStruct {
     x: i16,
     y: i32,
-    z: i16
+    z: i16,
 }
 
 static VECT_SLICE: &'static [i64] = &[64, 65];
@@ -114,10 +116,8 @@ fn main() {
 
     let padded_tuple: &[(i32, i16)] = &[(6, 7), (8, 9)];
 
-    let padded_struct: &[AStruct] = &[
-        AStruct { x: 10, y: 11, z: 12 },
-        AStruct { x: 13, y: 14, z: 15 }
-    ];
+    let padded_struct: &[AStruct] =
+        &[AStruct { x: 10, y: 11, z: 12 }, AStruct { x: 13, y: 14, z: 15 }];
 
     unsafe {
         MUT_VECT_SLICE = VECT_SLICE;
@@ -128,4 +128,6 @@ fn main() {
     zzz(); // #break
 }
 
-fn zzz() {()}
+fn zzz() {
+    ()
+}