about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2022-01-12 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2022-01-12 18:51:31 +0100
commit47b1c16fcd1d2a54002b77ac3e15c6092415d1b1 (patch)
tree52125b10d9c61756c179e1ba8ebf058ff4a789f3
parent61c233bac354df524f1e6daf29cf9521a6bb3de6 (diff)
downloadrust-47b1c16fcd1d2a54002b77ac3e15c6092415d1b1.tar.gz
rust-47b1c16fcd1d2a54002b77ac3e15c6092415d1b1.zip
Remove mir-opt tests for LLVM-style inline assembly
-rw-r--r--src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff75
-rw-r--r--src/test/mir-opt/unreachable_asm.rs24
-rw-r--r--src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff85
-rw-r--r--src/test/mir-opt/unreachable_asm_2.rs26
4 files changed, 0 insertions, 210 deletions
diff --git a/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff
deleted file mode 100644
index c60997be5d3..00000000000
--- a/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff
+++ /dev/null
@@ -1,75 +0,0 @@
-- // MIR for `main` before UnreachablePropagation
-+ // MIR for `main` after UnreachablePropagation
-  
-  fn main() -> () {
-      let mut _0: ();                      // return place in scope 0 at $DIR/unreachable_asm.rs:10:11: 10:11
-      let mut _1: std::option::Option<Empty>; // in scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
-      let mut _2: isize;                   // in scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
-      let _3: Empty;                       // in scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
-      let mut _4: i32;                     // in scope 0 at $DIR/unreachable_asm.rs:12:13: 12:19
-      let _5: ();                          // in scope 0 at $DIR/unreachable_asm.rs:14:9: 18:10
-      let mut _6: bool;                    // in scope 0 at $DIR/unreachable_asm.rs:14:12: 14:16
-      let _7: ();                          // in scope 0 at $DIR/unreachable_asm.rs:21:9: 21:37
-      let mut _8: !;                       // in scope 0 at $DIR/unreachable_asm.rs:22:9: 22:21
-      scope 1 {
-          debug _x => _3;                  // in scope 1 at $DIR/unreachable_asm.rs:11:17: 11:19
-      }
-      scope 2 {
-          debug _y => _4;                  // in scope 2 at $DIR/unreachable_asm.rs:12:13: 12:19
-          scope 3 {
-          }
-      }
-  
-      bb0: {
-          StorageLive(_1);                 // scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
-          _1 = empty() -> bb1;             // scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
-                                           // mir::Constant
-                                           // + span: $DIR/unreachable_asm.rs:11:23: 11:28
-                                           // + literal: Const { ty: fn() -> std::option::Option<Empty> {empty}, val: Value(Scalar(<ZST>)) }
-      }
-  
-      bb1: {
-          _2 = discriminant(_1);           // scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
-          switchInt(move _2) -> [1_isize: bb2, otherwise: bb6]; // scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
-      }
-  
-      bb2: {
-          StorageLive(_3);                 // scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
-          _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
-          StorageLive(_4);                 // scope 0 at $DIR/unreachable_asm.rs:12:13: 12:19
-          StorageLive(_5);                 // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
-          StorageLive(_6);                 // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
-          _6 = const true;                 // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
-          switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
-      }
-  
-      bb3: {
-          _4 = const 21_i32;               // scope 2 at $DIR/unreachable_asm.rs:15:13: 15:20
-          _5 = const ();                   // scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10
-          goto -> bb5;                     // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
-      }
-  
-      bb4: {
-          _4 = const 42_i32;               // scope 2 at $DIR/unreachable_asm.rs:17:13: 17:20
-          _5 = const ();                   // scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10
-          goto -> bb5;                     // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
-      }
-  
-      bb5: {
-          StorageDead(_6);                 // scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10
-          StorageDead(_5);                 // scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10
-          StorageLive(_7);                 // scope 2 at $DIR/unreachable_asm.rs:21:9: 21:37
-          llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 3 at $DIR/unreachable_asm.rs:21:18: 21:34
-          _7 = const ();                   // scope 3 at $DIR/unreachable_asm.rs:21:9: 21:37
-          StorageDead(_7);                 // scope 2 at $DIR/unreachable_asm.rs:21:36: 21:37
-          StorageLive(_8);                 // scope 2 at $DIR/unreachable_asm.rs:22:9: 22:21
-          unreachable;                     // scope 2 at $DIR/unreachable_asm.rs:22:15: 22:17
-      }
-  
-      bb6: {
-          _0 = const ();                   // scope 0 at $DIR/unreachable_asm.rs:23:6: 23:6
-          StorageDead(_1);                 // scope 0 at $DIR/unreachable_asm.rs:24:1: 24:2
-          return;                          // scope 0 at $DIR/unreachable_asm.rs:24:2: 24:2
-      }
-  }
-  
diff --git a/src/test/mir-opt/unreachable_asm.rs b/src/test/mir-opt/unreachable_asm.rs
deleted file mode 100644
index cbef05a3c05..00000000000
--- a/src/test/mir-opt/unreachable_asm.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-#![feature(llvm_asm)]
-
-enum Empty {}
-
-fn empty() -> Option<Empty> {
-    None
-}
-
-// EMIT_MIR unreachable_asm.main.UnreachablePropagation.diff
-fn main() {
-    if let Some(_x) = empty() {
-        let mut _y;
-
-        if true {
-            _y = 21;
-        } else {
-            _y = 42;
-        }
-
-        // asm instruction stops unreachable propagation to if else blocks bb4 and bb5.
-        unsafe { llvm_asm!("NOP"); }
-        match _x { }
-    }
-}
diff --git a/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff
deleted file mode 100644
index 28c5f031dbb..00000000000
--- a/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff
+++ /dev/null
@@ -1,85 +0,0 @@
-- // MIR for `main` before UnreachablePropagation
-+ // MIR for `main` after UnreachablePropagation
-  
-  fn main() -> () {
-      let mut _0: ();                      // return place in scope 0 at $DIR/unreachable_asm_2.rs:10:11: 10:11
-      let mut _1: std::option::Option<Empty>; // in scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
-      let mut _2: isize;                   // in scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
-      let _3: Empty;                       // in scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
-      let mut _4: i32;                     // in scope 0 at $DIR/unreachable_asm_2.rs:12:13: 12:19
-      let _5: ();                          // in scope 0 at $DIR/unreachable_asm_2.rs:14:9: 22:10
-      let mut _6: bool;                    // in scope 0 at $DIR/unreachable_asm_2.rs:14:12: 14:16
-      let _7: ();                          // in scope 0 at $DIR/unreachable_asm_2.rs:16:13: 16:41
-      let _8: ();                          // in scope 0 at $DIR/unreachable_asm_2.rs:20:13: 20:41
-      let mut _9: !;                       // in scope 0 at $DIR/unreachable_asm_2.rs:24:9: 24:21
-      scope 1 {
-          debug _x => _3;                  // in scope 1 at $DIR/unreachable_asm_2.rs:11:17: 11:19
-      }
-      scope 2 {
-          debug _y => _4;                  // in scope 2 at $DIR/unreachable_asm_2.rs:12:13: 12:19
-          scope 3 {
-          }
-          scope 4 {
-          }
-      }
-  
-      bb0: {
-          StorageLive(_1);                 // scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
-          _1 = empty() -> bb1;             // scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
-                                           // mir::Constant
-                                           // + span: $DIR/unreachable_asm_2.rs:11:23: 11:28
-                                           // + literal: Const { ty: fn() -> std::option::Option<Empty> {empty}, val: Value(Scalar(<ZST>)) }
-      }
-  
-      bb1: {
-          _2 = discriminant(_1);           // scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
--         switchInt(move _2) -> [1_isize: bb2, otherwise: bb6]; // scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
-+         switchInt(move _2) -> [1_isize: bb2, otherwise: bb5]; // scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
-      }
-  
-      bb2: {
-          StorageLive(_3);                 // scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
-          _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
-          StorageLive(_4);                 // scope 0 at $DIR/unreachable_asm_2.rs:12:13: 12:19
-          StorageLive(_5);                 // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
-          StorageLive(_6);                 // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
-          _6 = const true;                 // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
-          switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
-      }
-  
-      bb3: {
-          StorageLive(_7);                 // scope 2 at $DIR/unreachable_asm_2.rs:16:13: 16:41
-          llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 3 at $DIR/unreachable_asm_2.rs:16:22: 16:38
-          _7 = const ();                   // scope 3 at $DIR/unreachable_asm_2.rs:16:13: 16:41
-          StorageDead(_7);                 // scope 2 at $DIR/unreachable_asm_2.rs:16:40: 16:41
-          _4 = const 21_i32;               // scope 2 at $DIR/unreachable_asm_2.rs:17:13: 17:20
-          _5 = const ();                   // scope 2 at $DIR/unreachable_asm_2.rs:14:17: 18:10
--         goto -> bb5;                     // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
-+         unreachable;                     // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
-      }
-  
-      bb4: {
-          StorageLive(_8);                 // scope 2 at $DIR/unreachable_asm_2.rs:20:13: 20:41
-          llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 4 at $DIR/unreachable_asm_2.rs:20:22: 20:38
-          _8 = const ();                   // scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41
-          StorageDead(_8);                 // scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41
-          _4 = const 42_i32;               // scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20
-          _5 = const ();                   // scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10
--         goto -> bb5;                     // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
-+         unreachable;                     // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
-      }
-  
-      bb5: {
--         StorageDead(_6);                 // scope 2 at $DIR/unreachable_asm_2.rs:22:9: 22:10
--         StorageDead(_5);                 // scope 2 at $DIR/unreachable_asm_2.rs:22:9: 22:10
--         StorageLive(_9);                 // scope 2 at $DIR/unreachable_asm_2.rs:24:9: 24:21
--         unreachable;                     // scope 2 at $DIR/unreachable_asm_2.rs:24:15: 24:17
--     }
-- 
--     bb6: {
-          _0 = const ();                   // scope 0 at $DIR/unreachable_asm_2.rs:25:6: 25:6
-          StorageDead(_1);                 // scope 0 at $DIR/unreachable_asm_2.rs:26:1: 26:2
-          return;                          // scope 0 at $DIR/unreachable_asm_2.rs:26:2: 26:2
-      }
-  }
-  
diff --git a/src/test/mir-opt/unreachable_asm_2.rs b/src/test/mir-opt/unreachable_asm_2.rs
deleted file mode 100644
index e0d8e725147..00000000000
--- a/src/test/mir-opt/unreachable_asm_2.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-#![feature(llvm_asm)]
-
-enum Empty {}
-
-fn empty() -> Option<Empty> {
-    None
-}
-
-// EMIT_MIR unreachable_asm_2.main.UnreachablePropagation.diff
-fn main() {
-    if let Some(_x) = empty() {
-        let mut _y;
-
-        if true {
-            // asm instruction stops unreachable propagation to block bb3.
-            unsafe { llvm_asm!("NOP"); }
-            _y = 21;
-        } else {
-            // asm instruction stops unreachable propagation to block bb3.
-            unsafe { llvm_asm!("NOP"); }
-            _y = 42;
-        }
-
-        match _x { }
-    }
-}