1 ; RUN: opt -S -mergefunc < %s | FileCheck %s
3 target datalayout = "p:32:32:32-p1:32:32:32-p2:16:16:16"
5 declare void @foo(i32) nounwind
7 ; None of these functions should be merged
9 define i32 @store_as0(i32* %x) {
10 ; CHECK-LABEL: @store_as0(
11 ; CHECK: call void @foo(
12 %gep = getelementptr i32, i32* %x, i32 4
13 %y = load i32, i32* %gep
14 call void @foo(i32 %y) nounwind
18 define i32 @store_as1(i32 addrspace(1)* %x) {
19 ; CHECK-LABEL: @store_as1(
20 ; CHECK: call void @foo(
21 %gep = getelementptr i32, i32 addrspace(1)* %x, i32 4
22 %y = load i32, i32 addrspace(1)* %gep
23 call void @foo(i32 %y) nounwind
27 define i32 @store_as2(i32 addrspace(2)* %x) {
28 ; CHECK-LABEL: @store_as2(
29 ; CHECK: call void @foo(
30 %gep = getelementptr i32, i32 addrspace(2)* %x, i32 4
31 %y = load i32, i32 addrspace(2)* %gep
32 call void @foo(i32 %y) nounwind