about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-04-20 17:59:54 +0200
committerGitHub <noreply@github.com>2023-04-20 17:59:54 +0200
commit462461699aa78e08388fb32cf7b4ab05336a5763 (patch)
treebb3bf43231655599e1d69f0c8acedd66ccfb57d8 /tests
parent7dc211f5cede0a515d7a00bf7f3f908ce97e861c (diff)
parent2f503345b482e970df48cdb074becc75b7e507f2 (diff)
downloadrust-462461699aa78e08388fb32cf7b4ab05336a5763.tar.gz
rust-462461699aa78e08388fb32cf7b4ab05336a5763.zip
Rollup merge of #110558 - spastorino:smir-call-terminator, r=oli-obk
Add Call terminator to SMIR

This adds internal MIR `TerminatorKind::Call` to SMIR `Terminator::Call` conversion.

r? `@oli-obk`
Diffstat (limited to 'tests')
-rw-r--r--tests/ui-fulldeps/stable-mir/crate-info.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/ui-fulldeps/stable-mir/crate-info.rs b/tests/ui-fulldeps/stable-mir/crate-info.rs
index dfde8c97ec2..95f27efa771 100644
--- a/tests/ui-fulldeps/stable-mir/crate-info.rs
+++ b/tests/ui-fulldeps/stable-mir/crate-info.rs
@@ -33,7 +33,6 @@ fn test_stable_mir(tcx: TyCtxt<'_>) {
 
     // Find items in the local crate.
     let items = stable_mir::all_local_items();
-    assert!(get_item(tcx, &items, (DefKind::Fn, "foo_bar")).is_some());
     assert!(get_item(tcx, &items, (DefKind::Fn, "foo::bar")).is_some());
 
     // Find the `std` crate.
@@ -52,6 +51,15 @@ fn test_stable_mir(tcx: TyCtxt<'_>) {
         stable_mir::mir::Terminator::Return => {}
         other => panic!("{other:?}"),
     }
+
+    let foo_bar = get_item(tcx, &items, (DefKind::Fn, "foo_bar")).unwrap();
+    let body = foo_bar.body();
+    assert_eq!(body.blocks.len(), 4);
+    let block = &body.blocks[0];
+    match &block.terminator {
+        stable_mir::mir::Terminator::Call { .. } => {}
+        other => panic!("{other:?}"),
+    }
 }
 
 // Use internal API to find a function in a crate.