blob: 877cf8dc67104391ef299ddcb8fd6e66400ad6e5 [file] [log] [blame]
Chris Lattner93d4f352010-02-12 18:17:23 +00001; RUN: opt < %s -constmerge -S | FileCheck %s
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
Chris Lattner93d4f352010-02-12 18:17:23 +00003; Don't merge constants with specified sections.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004
Chris Lattner93d4f352010-02-12 18:17:23 +00005@T1G1 = internal constant i32 1, section "foo"
6@T1G2 = internal constant i32 1, section "bar"
7@T1G3 = internal constant i32 1, section "bar"
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008
Chris Lattner93d4f352010-02-12 18:17:23 +00009; CHECK: @T1G1
10; CHECK: @T1G2
11; CHECK: @T1G3
12
13define void @test1(i32** %P1, i32** %P2, i32** %P3) {
14 store i32* @T1G1, i32** %P1
15 store i32* @T1G2, i32** %P2
16 store i32* @T1G3, i32** %P3
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000017 ret void
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018}
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000019
Chris Lattner93d4f352010-02-12 18:17:23 +000020@T2a = internal constant i32 224
21@T2b = internal addrspace(30) constant i32 224
22
23; CHECK: @T2a
24; CHECK: @T2b
25
26define void @test2(i32** %P1, i32 addrspace(30)** %P2) {
27 store i32* @T2a, i32** %P1
28 store i32 addrspace(30)* @T2b, i32 addrspace(30)** %P2
29 ret void
30}