1 ; RUN: llc -march=hexagon -verify-machineinstrs < %s | FileCheck %s
2 ; Check that this testcase compiles successfully.
6 target triple = "hexagon"
8 %struct.0 = type { i32, i16, ptr }
10 declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
11 declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
13 define i32 @fred(ptr readonly %p0, ptr %p1) local_unnamed_addr #0 {
15 %v0 = alloca i16, align 2
16 %v1 = icmp eq ptr %p0, null
17 br i1 %v1, label %if.then, label %lor.lhs.false
19 lor.lhs.false: ; preds = %entry
20 %v3 = load ptr, ptr %p0, align 4
21 %v4 = icmp eq ptr %v3, null
22 br i1 %v4, label %if.then, label %if.else
24 if.then: ; preds = %lor.lhs.false, %ent
25 %v5 = icmp eq ptr %p1, null
26 br i1 %v5, label %cleanup, label %if.then3
28 if.then3: ; preds = %if.then
29 store i32 0, ptr %p1, align 4
32 if.else: ; preds = %lor.lhs.false
33 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %v0) #0
34 store i16 0, ptr %v0, align 2
35 %v7 = call i32 @foo(ptr nonnull %v3, ptr nonnull %v0) #0
36 %v8 = icmp eq ptr %p1, null
37 br i1 %v8, label %if.end7, label %if.then6
39 if.then6: ; preds = %if.else
40 %v9 = load i16, ptr %v0, align 2
41 %v10 = zext i16 %v9 to i32
42 store i32 %v10, ptr %p1, align 4
45 if.end7: ; preds = %if.else, %if.then6
46 call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %v0) #0
49 cleanup: ; preds = %if.then3, %if.then,
50 %v11 = phi i32 [ %v7, %if.end7 ], [ -2147024809, %if.then ], [ -2147024809, %if.then3 ]
54 declare i32 @foo(ptr, ptr) local_unnamed_addr #0
56 attributes #0 = { nounwind }
57 attributes #1 = { argmemonly nounwind }