source: icGREP/icgrep-devel/llvm-3.8.0.src/test/CodeGen/Hexagon/eh_return.ll @ 5027

Last change on this file since 5027 was 5027, checked in by cameron, 3 years ago

Upgrade to llvm 3.8

File size: 1.5 KB
Line 
1; RUN: llc -O0 -march=hexagon < %s | FileCheck %s
2; Make sure we generate an exception handling return.
3
4; CHECK:         deallocframe
5; CHECK-NEXT:  }
6; CHECK-NEXT:  {
7; CHECK-NEXT:    r29 = add(r29, r28)
8; CHECK-NEXT:  }
9; CHECK-NEXT:  {
10; CHECK-NEXT:    jumpr r31
11; CHECK-NEXT:  }
12
13target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-a0:0-n32"
14target triple = "hexagon-unknown-linux-gnu"
15
16%struct.Data = type { i32, i8* }
17
18define i32 @test_eh_return(i32 %a, i32 %b) nounwind {
19entry:
20  %a.addr = alloca i32, align 4
21  %b.addr = alloca i32, align 4
22  %d = alloca %struct.Data, align 4
23  store i32 %a, i32* %a.addr, align 4
24  store i32 %b, i32* %b.addr, align 4
25  %0 = load i32, i32* %a.addr, align 4
26  %1 = load i32, i32* %b.addr, align 4
27  %cmp = icmp sgt i32 %0, %1
28  br i1 %cmp, label %if.then, label %if.else
29
30if.then:                                          ; preds = %entry
31  %2 = load i32, i32* %a.addr, align 4
32  %3 = load i32, i32* %b.addr, align 4
33  %add = add nsw i32 %2, %3
34  ret i32 %add
35
36if.else:                                          ; preds = %entry
37  %call = call i32 @setup(%struct.Data* %d)
38  %_d1 = getelementptr inbounds %struct.Data, %struct.Data* %d, i32 0, i32 0
39  %4 = load i32, i32* %_d1, align 4
40  %_d2 = getelementptr inbounds %struct.Data, %struct.Data* %d, i32 0, i32 1
41  %5 = load i8*, i8** %_d2, align 4
42  call void @llvm.eh.return.i32(i32 %4, i8* %5)
43  unreachable
44}
45
46declare i32 @setup(%struct.Data*)
47
48declare void @llvm.eh.return.i32(i32, i8*) nounwind
Note: See TracBrowser for help on using the repository browser.