1 ; RUN: opt -constmerge %s -S -o - | FileCheck %s
2 ; Test which corresponding x and y are merged and that unnamed_addr
5 declare void @zed(%struct.foobar*, %struct.foobar*)
7 %struct.foobar = type { i32 }
9 @test1.x = internal constant %struct.foobar { i32 1 }
10 @test1.y = constant %struct.foobar { i32 1 }
12 @test2.x = internal constant %struct.foobar { i32 2 }
13 @test2.y = unnamed_addr constant %struct.foobar { i32 2 }
15 @test3.x = internal unnamed_addr constant %struct.foobar { i32 3 }
16 @test3.y = constant %struct.foobar { i32 3 }
18 @test4.x = internal unnamed_addr constant %struct.foobar { i32 4 }
19 @test4.y = unnamed_addr constant %struct.foobar { i32 4 }
22 ; CHECK: %struct.foobar = type { i32 }
24 ; CHECK: @test1.x = internal constant %struct.foobar { i32 1 }
25 ; CHECK-NEXT: @test1.y = constant %struct.foobar { i32 1 }
26 ; CHECK-NEXT: @test2.y = constant %struct.foobar { i32 2 }
27 ; CHECK-NEXT: @test3.y = constant %struct.foobar { i32 3 }
28 ; CHECK-NEXT: @test4.y = unnamed_addr constant %struct.foobar { i32 4 }
30 ; CHECK: declare void @zed(%struct.foobar*, %struct.foobar*)
34 call void @zed(%struct.foobar* @test1.x, %struct.foobar* @test1.y)
35 call void @zed(%struct.foobar* @test2.x, %struct.foobar* @test2.y)
36 call void @zed(%struct.foobar* @test3.x, %struct.foobar* @test3.y)
37 call void @zed(%struct.foobar* @test4.x, %struct.foobar* @test4.y)