1 ; RUN: llc < %s | FileCheck %s
2 ; Check for allocframe in a non-entry block LBB0_n.
3 ; CHECK: LBB0_{{[0-9]+}}:
5 ; Deallocframe may be in a different block, but must follow.
8 target datalayout = "e-m:e-p:32:32-i1:32-i64:64-a:0-v32:32-n16:32"
9 target triple = "hexagon"
11 ; Function Attrs: nounwind
12 define i32 @foo(i32 %n, ptr %p) #0 {
14 %cmp = icmp eq ptr %p, null
15 br i1 %cmp, label %if.end, label %if.then
17 if.then: ; preds = %entry
18 %0 = load i32, ptr %p, align 4
19 %inc = add nsw i32 %0, 1
20 store i32 %inc, ptr %p, align 4
23 if.end: ; preds = %entry
24 %call = tail call i32 @bar(i32 %n) #0
25 %add = add nsw i32 %call, 1
28 return: ; preds = %if.end, %if.then
29 %retval.0 = phi i32 [ %0, %if.then ], [ %add, %if.end ]
33 declare i32 @bar(...) #0
35 attributes #0 = { nounwind }