[llvm] cf7502a - [LICM] Check opt output in test (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 07:21:43 PDT 2022


Author: Nikita Popov
Date: 2022-07-06T16:21:36+02:00
New Revision: cf7502a1ebe635c10e69ff70bc590313474b5277

URL: https://github.com/llvm/llvm-project/commit/cf7502a1ebe635c10e69ff70bc590313474b5277
DIFF: https://github.com/llvm/llvm-project/commit/cf7502a1ebe635c10e69ff70bc590313474b5277.diff

LOG: [LICM] Check opt output in test (NFC)

Check what the test actually produces, not just that it doesn't
crash.

Added: 
    

Modified: 
    llvm/test/Transforms/LICM/callbr-crash.ll

Removed: 
    


################################################################################
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
 }


        


More information about the llvm-commits mailing list