blob: 1cfecae979d2ab76b09f43253a8a1cbb2aa376db [file] [log] [blame]
Matt Arsenault5bcefab2013-11-10 01:44:37 +00001; RUN: opt -S -mergefunc < %s | FileCheck %s
2
3target datalayout = "p:32:32:32-p1:32:32:32-p2:16:16:16"
4
5declare void @foo(i32) nounwind
6
7; None of these functions should be merged
8
9define i32 @store_as0(i32* %x) {
10; CHECK-LABEL: @store_as0(
11; CHECK: call void @foo(
David Blaikie79e6c742015-02-27 19:29:02 +000012 %gep = getelementptr i32, i32* %x, i32 4
David Blaikiea79ac142015-02-27 21:17:42 +000013 %y = load i32, i32* %gep
Matt Arsenault5bcefab2013-11-10 01:44:37 +000014 call void @foo(i32 %y) nounwind
15 ret i32 %y
16}
17
18define i32 @store_as1(i32 addrspace(1)* %x) {
19; CHECK-LABEL: @store_as1(
20; CHECK: call void @foo(
David Blaikie79e6c742015-02-27 19:29:02 +000021 %gep = getelementptr i32, i32 addrspace(1)* %x, i32 4
David Blaikiea79ac142015-02-27 21:17:42 +000022 %y = load i32, i32 addrspace(1)* %gep
Matt Arsenault5bcefab2013-11-10 01:44:37 +000023 call void @foo(i32 %y) nounwind
24 ret i32 %y
25}
26
27define i32 @store_as2(i32 addrspace(2)* %x) {
28; CHECK-LABEL: @store_as2(
29; CHECK: call void @foo(
David Blaikie79e6c742015-02-27 19:29:02 +000030 %gep = getelementptr i32, i32 addrspace(2)* %x, i32 4
David Blaikiea79ac142015-02-27 21:17:42 +000031 %y = load i32, i32 addrspace(2)* %gep
Matt Arsenault5bcefab2013-11-10 01:44:37 +000032 call void @foo(i32 %y) nounwind
33 ret i32 %y
34}
35