blob: 0282f464aeee93d31145448dbab10bb99bb3e770 [file] [log] [blame]
Rafael Espindolad6e5cbc2011-01-16 17:05:09 +00001; RUN: opt -constmerge %s -S -o - | FileCheck %s
2; Test that in one run var3 is merged into var2 and var1 into var4.
3
4declare void @zed(%struct.foobar*, %struct.foobar*)
5
6%struct.foobar = type { i32 }
7
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 }
12
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*)
19
20define i32 @main() {
21entry:
22 call void @zed(%struct.foobar* @var1, %struct.foobar* @var2)
23 call void @zed(%struct.foobar* @var3, %struct.foobar* @var4)
24 ret i32 0
25}
26