1; RUN: opt -mergefunc -S < %s | FileCheck %s 2 3define i8 @call_with_range() { 4 bitcast i8 0 to i8 ; dummy to make the function large enough 5 %out = call i8 @dummy(), !range !0 6 ret i8 %out 7} 8 9define 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 14 bitcast i8 0 to i8 15 %out = call i8 @dummy() 16 ret i8 %out 17} 18 19define 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 24 bitcast i8 0 to i8 25 %out = call i8 @dummy(), !range !1 26 ret i8 %out 27} 28 29define i8 @invoke_with_range() { 30 %out = invoke i8 @dummy() to label %next unwind label %lpad, !range !0 31 32next: 33 ret i8 %out 34 35lpad: 36 %pad = landingpad { i8*, i32 } personality i8* undef cleanup 37 resume { i8*, i32 } zeroinitializer 38} 39 40define i8 @invoke_no_range() { 41; CHECK-LABEL: @invoke_no_range() 42; CHECK-NEXT: invoke i8 @dummy 43 %out = invoke i8 @dummy() to label %next unwind label %lpad 44 45next: 46 ret i8 %out 47 48lpad: 49 %pad = landingpad { i8*, i32 } personality i8* undef cleanup 50 resume { i8*, i32 } zeroinitializer 51} 52 53define i8 @invoke_different_range() { 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 57 58next: 59 ret i8 %out 60 61lpad: 62 %pad = landingpad { i8*, i32 } personality i8* undef cleanup 63 resume { i8*, i32 } zeroinitializer 64} 65 66define i8 @call_same_range() { 67; CHECK-LABEL: @call_same_range 68; CHECK: tail call i8 @call_with_range 69 bitcast i8 0 to i8 70 %out = call i8 @dummy(), !range !0 71 ret i8 %out 72} 73 74define i8 @invoke_same_range() { 75; CHECK-LABEL: @invoke_same_range() 76; CHECK: tail call i8 @invoke_with_range() 77 %out = invoke i8 @dummy() to label %next unwind label %lpad, !range !0 78 79next: 80 ret i8 %out 81 82lpad: 83 %pad = landingpad { i8*, i32 } personality i8* undef cleanup 84 resume { i8*, i32 } zeroinitializer 85} 86 87declare i8 @dummy(); 88declare i32 @__gxx_personality_v0(...) 89 90!0 = !{i8 0, i8 2} 91!1 = !{i8 5, i8 7} 92