xref: /llvm-project/llvm/test/CodeGen/ARM/invalidated-save-point.ll (revision 56d87ef5d7c3b3f53cafd2a360b949b39bc88733)
1263f314bSJustin Bogner; RUN: llc -mtriple thumbv7 -stop-after=if-converter < %s 2>&1 | FileCheck %s
2263f314bSJustin Bogner
3263f314bSJustin Bogner; Make sure the save point and restore point are dropped from MFI at
4263f314bSJustin Bogner; this point. Notably, if it isn't is will be invalid and reference a
5263f314bSJustin Bogner; deleted block (%bb.-1.if.end)
6263f314bSJustin Bogner
7*56d87ef5SVivek Pandya; CHECK: savePoint: ''
8*56d87ef5SVivek Pandya; CHECK: restorePoint: ''
9263f314bSJustin Bogner
10263f314bSJustin Bognertarget datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
11263f314bSJustin Bognertarget triple = "thumbv7"
12263f314bSJustin Bogner
13263f314bSJustin Bognerdefine i32 @f(i32 %n) {
14263f314bSJustin Bognerentry:
15263f314bSJustin Bogner  %cmp = icmp ult i32 %n, 4
16263f314bSJustin Bogner  br i1 %cmp, label %return, label %if.end
17263f314bSJustin Bogner
18263f314bSJustin Bognerif.end:
19263f314bSJustin Bogner  tail call void @g(i32 %n)
20263f314bSJustin Bogner  br label %return
21263f314bSJustin Bogner
22263f314bSJustin Bognerreturn:
23263f314bSJustin Bogner  %retval.0 = phi i32 [ 0, %if.end ], [ -1, %entry ]
24263f314bSJustin Bogner  ret i32 %retval.0
25263f314bSJustin Bogner}
26263f314bSJustin Bogner
27263f314bSJustin Bognerdeclare void @g(i32)
28