Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame] | 1 | ; RUN: opt -mergefunc -disable-output < %s |
2 | |||||
3 | ; A linked list type and simple payload | ||||
4 | %LL = type { %S, %LL* } | ||||
5 | %S = type { void (%S*, i32)* } | ||||
6 | |||||
7 | ; Table refers to itself via GEP | ||||
8 | @Table = internal global [3 x %LL] [%LL { %S { void (%S*, i32)* @B }, %LL* getelementptr inbounds ([3 x %LL], [3 x %LL]* @Table, i32 0, i32 0) }, %LL { %S { void (%S*, i32)* @A }, %LL* getelementptr inbounds ([3 x %LL], [3 x %LL]* @Table, i32 0, i32 0) }, %LL { %S { void (%S*, i32)* @A }, %LL* getelementptr inbounds ([3 x %LL], [3 x %LL]* @Table, i32 0, i32 0) }], align 16 | ||||
9 | |||||
10 | ; The body of this is irrelevant; it is long so that mergefunc doesn't skip it as a small function. | ||||
11 | define internal void @A(%S* %self, i32 %a) { | ||||
12 | %1 = add i32 %a, 32 | ||||
13 | %2 = add i32 %1, 32 | ||||
14 | %3 = add i32 %2, 32 | ||||
15 | %4 = add i32 %3, 32 | ||||
16 | %5 = add i32 %4, 32 | ||||
17 | %6 = add i32 %5, 32 | ||||
18 | %7 = add i32 %6, 32 | ||||
19 | %8 = add i32 %7, 32 | ||||
20 | %9 = add i32 %8, 32 | ||||
21 | %10 = add i32 %9, 32 | ||||
22 | %11 = add i32 %10, 32 | ||||
23 | ret void | ||||
24 | } | ||||
25 | |||||
26 | define internal void @B(%S* %self, i32 %a) { | ||||
27 | %1 = add i32 %a, 32 | ||||
28 | %2 = add i32 %1, 32 | ||||
29 | %3 = add i32 %2, 32 | ||||
30 | %4 = add i32 %3, 32 | ||||
31 | %5 = add i32 %4, 32 | ||||
32 | %6 = add i32 %5, 32 | ||||
33 | %7 = add i32 %6, 32 | ||||
34 | %8 = add i32 %7, 32 | ||||
35 | %9 = add i32 %8, 32 | ||||
36 | %10 = add i32 %9, 32 | ||||
37 | %11 = add i32 %10, 32 | ||||
38 | ret void | ||||
39 | } | ||||
40 |