[LICM] Check opt output in test (NFC)

Check what the test actually produces, not just that it doesn't
crash.
This commit is contained in:
Nikita Popov 2022-07-06 16:21:05 +02:00
parent 08e4fe6c61
commit cf7502a1eb
1 changed files with 17 additions and 4 deletions

View File

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