1 ; RUN: llvm-link -S %s %p/Inputs/comdat13.ll -o - | FileCheck %s
3 ; In Inputs/comdat13.ll a function not in the $foo comdat (zed) references an
4 ; internal function in the comdat $foo.
5 ; The IR would be ilegal on ELF ("relocation refers to discarded section"),
6 ; but COFF linkers seem to just duplicate the comdat.
9 @foo = internal global i8 0, comdat
14 ; CHECK: $foo = comdat any
16 ; CHECK: @foo = internal global i8 0, comdat
17 ; CHECK: @foo.1 = internal global i8 1, comdat($foo)
19 ; CHECK: define i8* @bar() {
20 ; CHECK-NEXT: ret i8* @foo
23 ; CHECK: define i8* @zed() {
24 ; CHECK-NEXT: call void @bax()
25 ; CHECK-NEXT: ret i8* @foo.1
28 ; CHECK: define internal void @bax() comdat($foo) {
29 ; CHECK-NEXT: ret void