From cf7502a1ebe635c10e69ff70bc590313474b5277 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 6 Jul 2022 16:21:05 +0200 Subject: [PATCH] [LICM] Check opt output in test (NFC) Check what the test actually produces, not just that it doesn't crash. --- llvm/test/Transforms/LICM/callbr-crash.ll | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/llvm/test/Transforms/LICM/callbr-crash.ll b/llvm/test/Transforms/LICM/callbr-crash.ll index 923e832de082..c9a3136e7612 100644 --- a/llvm/test/Transforms/LICM/callbr-crash.ll +++ b/llvm/test/Transforms/LICM/callbr-crash.ll @@ -1,18 +1,31 @@ -; RUN: opt -licm -disable-output < %s +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt -S -licm < %s | FileCheck %s define i32 @j() { +; CHECK-LABEL: @j( +; CHECK-NEXT: entry: +; CHECK-NEXT: br label [[FOR_COND:%.*]] +; CHECK: for.cond: +; CHECK-NEXT: callbr void asm sideeffect "", "i,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@j, [[FOR_END:%.*]])) +; CHECK-NEXT: to label [[COND_TRUE_I:%.*]] [label %for.end] +; CHECK: cond.true.i: +; CHECK-NEXT: br i1 true, label [[FOR_END]], label [[FOR_COND]] +; CHECK: for.end: +; CHECK-NEXT: [[PHI:%.*]] = phi i32 [ 0, [[COND_TRUE_I]] ], [ undef, [[FOR_COND]] ] +; CHECK-NEXT: ret i32 [[PHI]] +; entry: br label %for.cond for.cond: ; preds = %cond.true.i, %entry callbr void asm sideeffect "", "i,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@j, %for.end)) - to label %cond.true.i [label %for.end] + to label %cond.true.i [label %for.end] cond.true.i: ; preds = %for.cond %asmresult1.i.i = extractvalue { i8, i32 } zeroinitializer, 1 br i1 undef, label %for.end, label %for.cond for.end: ; preds = %cond.true.i, %for.cond - %asmresult1.i.i2 = phi i32 [ %asmresult1.i.i, %cond.true.i ], [ undef, %for.cond ] - ret i32 undef + %phi = phi i32 [ %asmresult1.i.i, %cond.true.i ], [ undef, %for.cond ] + ret i32 %phi }