[Attributor][NFC] Reorder test functions

Since one of the functions has a personality the attribute set is
printed. If the function is the first it should (hopefully) always be #0
This commit is contained in:
Johannes Doerfert 2019-12-13 23:38:05 -06:00
parent 3d347e2835
commit 6a05ee05b6
1 changed files with 23 additions and 23 deletions

View File

@ -3,6 +3,29 @@
; FIXME: icmp folding is missing
define i1 @invokecaller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
; CHECK-LABEL: define {{[^@]+}}@invokecaller
; CHECK-SAME: (i1 [[C:%.*]]) #0 personality i32 (...)* @__gxx_personality_v0
; CHECK-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]])
; CHECK-NEXT: br label [[OK:%.*]]
; CHECK: .i2c:
; CHECK-NEXT: unreachable
; CHECK: OK:
; CHECK-NEXT: [[Y:%.*]] = icmp ne i32 52, 0
; CHECK-NEXT: ret i1 [[Y]]
; CHECK: FAIL:
; CHECK-NEXT: unreachable
;
%X = invoke i32 @foo( i1 %C ) to label %OK unwind label %FAIL ; <i32> [#uses=1]
OK:
%Y = icmp ne i32 %X, 0 ; <i1> [#uses=1]
ret i1 %Y
FAIL:
%exn = landingpad {i8*, i32}
cleanup
ret i1 false
}
define internal i32 @foo(i1 %C) {
; CHECK-LABEL: define {{[^@]+}}@foo
; CHECK-SAME: (i1 [[C:%.*]])
@ -33,27 +56,4 @@ define i1 @caller(i1 %C) {
ret i1 %Y
}
define i1 @invokecaller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
; CHECK-LABEL: define {{[^@]+}}@invokecaller
; CHECK-SAME: (i1 [[C:%.*]]) #0 personality i32 (...)* @__gxx_personality_v0
; CHECK-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C]])
; CHECK-NEXT: br label [[OK:%.*]]
; CHECK: .i2c:
; CHECK-NEXT: unreachable
; CHECK: OK:
; CHECK-NEXT: [[Y:%.*]] = icmp ne i32 52, 0
; CHECK-NEXT: ret i1 [[Y]]
; CHECK: FAIL:
; CHECK-NEXT: unreachable
;
%X = invoke i32 @foo( i1 %C ) to label %OK unwind label %FAIL ; <i32> [#uses=1]
OK:
%Y = icmp ne i32 %X, 0 ; <i1> [#uses=1]
ret i1 %Y
FAIL:
%exn = landingpad {i8*, i32}
cleanup
ret i1 false
}
declare i32 @__gxx_personality_v0(...)