1 ; RUN: opt -S -passes=mergefunc < %s | FileCheck %s
3 ; Minor note: functions need to be at least three instructions long
4 ; to be considered by -mergefunc.
11 %v0 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ]
12 %v1 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ]
13 %v2 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ]
15 ; CHECK: %v0 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ]
16 ; CHECK: %v1 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ]
17 ; CHECK: %v2 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ]
25 %v0 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ]
26 %v1 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ]
27 %v2 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ]
29 ; CHECK: %v0 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ]
30 ; CHECK: %v1 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ]
31 ; CHECK: %v2 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ]
36 define i32 @f.invoke() personality i8 3 {
37 ; CHECK-LABEL: @f.invoke(
39 ; CHECK: %v0 = invoke i32 (...) @foo(i32 10) [ "foo"(i32 20) ]
40 %v0 = invoke i32 (...) @foo(i32 10) [ "foo"(i32 20) ]
41 to label %normal unwind label %exception
47 %cleanup = landingpad i8 cleanup
51 define i32 @g.invoke() personality i8 3 {
52 ; CHECK-LABEL: @g.invoke(
54 ; CHECK: %v0 = invoke i32 (...) @foo() [ "foo"(i32 10, i32 20) ]
55 %v0 = invoke i32 (...) @foo() [ "foo"(i32 10, i32 20) ]
56 to label %normal unwind label %exception
62 %cleanup = landingpad i8 cleanup