1 ; RUN: opt -mergefunc -S < %s | FileCheck %s
3 define i8 @call_with_range() {
4 bitcast i8 0 to i8 ; dummy to make the function large enough
5 %out = call i8 @dummy(), !range !0
9 define i8 @call_no_range() {
10 ; CHECK-LABEL: @call_no_range
11 ; CHECK-NEXT: bitcast i8 0 to i8
12 ; CHECK-NEXT: %out = call i8 @dummy()
13 ; CHECK-NEXT: ret i8 %out
15 %out = call i8 @dummy()
19 define i8 @call_different_range() {
20 ; CHECK-LABEL: @call_different_range
21 ; CHECK-NEXT: bitcast i8 0 to i8
22 ; CHECK-NEXT: %out = call i8 @dummy(), !range !1
23 ; CHECK-NEXT: ret i8 %out
25 %out = call i8 @dummy(), !range !1
29 define i8 @invoke_with_range() personality i8* undef {
30 %out = invoke i8 @dummy() to label %next unwind label %lpad, !range !0
36 %pad = landingpad { i8*, i32 } cleanup
37 resume { i8*, i32 } zeroinitializer
40 define i8 @invoke_no_range() personality i8* undef {
41 ; CHECK-LABEL: @invoke_no_range()
42 ; CHECK-NEXT: invoke i8 @dummy
43 %out = invoke i8 @dummy() to label %next unwind label %lpad
49 %pad = landingpad { i8*, i32 } cleanup
50 resume { i8*, i32 } zeroinitializer
53 define i8 @invoke_different_range() personality i8* undef {
54 ; CHECK-LABEL: @invoke_different_range()
55 ; CHECK-NEXT: invoke i8 @dummy
56 %out = invoke i8 @dummy() to label %next unwind label %lpad, !range !1
62 %pad = landingpad { i8*, i32 } cleanup
63 resume { i8*, i32 } zeroinitializer
66 define i8 @invoke_with_same_range() personality i8* undef {
67 ; CHECK-LABEL: @invoke_with_same_range()
68 ; CHECK: tail call i8 @invoke_with_range()
69 %out = invoke i8 @dummy() to label %next unwind label %lpad, !range !0
75 %pad = landingpad { i8*, i32 } cleanup
76 resume { i8*, i32 } zeroinitializer
79 define i8 @call_with_same_range() {
80 ; CHECK-LABEL: @call_with_same_range
81 ; CHECK: tail call i8 @call_with_range
83 %out = call i8 @dummy(), !range !0
89 declare i32 @__gxx_personality_v0(...)