1; RUN: llvm-link -S -o %t %s %p/Inputs/comdat-rm-dst.ll
2; RUN: FileCheck %s < %t
3; RUN: FileCheck --check-prefix=RM %s < %t
4
5target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
6target triple = "i686-pc-windows-msvc"
7
8$foo = comdat largest
9@foo = global i32 42, comdat
10; CHECK-DAG: @foo = global i64 43, comdat
11
12; RM-NOT: @alias =
13@alias = alias i32, i32* @foo
14
15; We should arguably reject an out of comdat reference to int_alias. Given that
16; the verifier accepts it, test that we at least produce an output that passes
17; the verifier.
18; CHECK-DAG: @int_alias = external global i32
19@int_alias = internal alias i32, i32* @foo
20@bar = global i32* @int_alias
21
22@func_alias = alias void (), void ()* @func
23@zed = global void()* @func_alias
24; CHECK-DAG: @zed = global void ()* @func_alias
25; CHECK-DAG: declare void @func_alias()
26
27; RM-NOT: @func()
28define void @func() comdat($foo) {
29  ret void
30}
31
32; RM-NOT: var
33@var = global i32 42, comdat($foo)
34