1 ; RUN: opt -mergefunc -S < %s | FileCheck %s
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
4 ; These should not be merged, the type of the GEP pointer argument does not have
7 %"struct1" = type <{ i8*, i32, [4 x i8] }>
8 %"struct2" = type { i8*, { i64, i64 } }
10 define internal %struct2* @Ffunc(%struct2* %P, i64 %i) {
11 ; CHECK-LABEL: @Ffunc(
12 ; CHECK-NEXT: getelementptr
13 ; CHECK-NEXT: getelementptr
14 ; CHECK-NEXT: getelementptr
15 ; CHECK-NEXT: getelementptr
16 ; CHECK-NEXT: getelementptr
17 ; CHECK-NEXT: getelementptr
19 %1 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
20 %2 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
21 %3 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
22 %4 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
23 %5 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
24 %6 = getelementptr inbounds %"struct2", %"struct2"* %P, i64 %i
29 define internal %struct1* @Gfunc(%struct1* %P, i64 %i) {
30 ; CHECK-LABEL: @Gfunc(
31 ; CHECK-NEXT: getelementptr
32 ; CHECK-NEXT: getelementptr
33 ; CHECK-NEXT: getelementptr
34 ; CHECK-NEXT: getelementptr
35 ; CHECK-NEXT: getelementptr
36 ; CHECK-NEXT: getelementptr
38 %1 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
39 %2 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
40 %3 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
41 %4 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
42 %5 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i
43 %6 = getelementptr inbounds %"struct1", %"struct1"* %P, i64 %i