1 ; RUN: opt -constmerge %s -S -o - | FileCheck %s
2 ; Test that in one run var3 is merged into var2 and var1 into var4.
4 declare void @zed(%struct.foobar*, %struct.foobar*)
6 %struct.foobar = type { i32 }
8 @var1 = internal constant %struct.foobar { i32 2 }
9 @var2 = unnamed_addr constant %struct.foobar { i32 2 }
10 @var3 = internal constant %struct.foobar { i32 2 }
11 @var4 = unnamed_addr constant %struct.foobar { i32 2 }
13 ; CHECK: %struct.foobar = type { i32 }
15 ; CHECK: @var2 = constant %struct.foobar { i32 2 }
16 ; CHECK-NEXT: @var4 = constant %struct.foobar { i32 2 }
18 ; CHECK: declare void @zed(%struct.foobar*, %struct.foobar*)
22 call void @zed(%struct.foobar* @var1, %struct.foobar* @var2)
23 call void @zed(%struct.foobar* @var3, %struct.foobar* @var4)