llvm.org GIT mirror llvm / 25efa8a
Add a test for LowerInvoke that doesn't use "-enable-correct-eh-support" None of the existing tests for LowerInvoke check LowerInvoke's output, and all but one use "-enable-correct-eh-support", which is obsolete, so those tests will be removed when that option is removed. To make sure LowerInvoke will still have test coverage, this adds a test for its default mode which converts invokes to calls. Differential Revision: http://llvm-reviews.chandlerc.com/D3124 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204344 91177308-0d34-0410-b5e6-96231b3b80d8 Mark Seaborn 5 years ago
1 changed file(s) with 25 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -lowerinvoke -S | FileCheck %s
1
2 declare i32 @external_func(i64 %arg)
3
4 define i32 @invoke_test(i64 %arg) {
5 entry:
6 %result = invoke fastcc i32 @external_func(i64 inreg %arg)
7 to label %cont unwind label %lpad
8 cont:
9 ret i32 %result
10 lpad:
11 %phi = phi i32 [ 99, %entry ]
12 %lp = landingpad { i8*, i32 } personality i8* null cleanup
13 ret i32 %phi
14 }
15
16 ; The "invoke" should be converted to a "call".
17 ; CHECK-LABEL: define i32 @invoke_test
18 ; CHECK: %result = call fastcc i32 @external_func(i64 inreg %arg)
19 ; CHECK-NEXT: br label %cont
20
21 ; Note that this pass does not remove dead landingpad blocks.
22 ; CHECK: lpad:
23 ; CHECK-NOT: phi
24 ; CHECK: landingpad