When removing a function from the function set and adding it to deferred, we
[llvm.git] / test / Transforms / ConstantMerge / merge-both.ll
blob0282f464aeee93d31145448dbab10bb99bb3e770
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 }
14 ; CHECK-NOT: @
15 ; CHECK: @var2 = constant %struct.foobar { i32 2 }
16 ; CHECK-NEXT: @var4 = constant %struct.foobar { i32 2 }
17 ; CHECK-NOT: @
18 ; CHECK: declare void @zed(%struct.foobar*, %struct.foobar*)
20 define i32 @main() {
21 entry:
22   call void @zed(%struct.foobar* @var1, %struct.foobar* @var2)
23   call void @zed(%struct.foobar* @var3, %struct.foobar* @var4)
24   ret i32 0