1 ; RUN: rm -rf %t && split-file %s %t
2 ; RUN: llvm-link -S %t/1.ll %t/1-aux.ll -o - | FileCheck %s
5 ; In 1-aux.ll a function not in the $foo comdat (zed) references an
6 ; internal function in the comdat $foo.
7 ; The IR would be ilegal on ELF ("relocation refers to discarded section"),
8 ; but COFF linkers seem to just duplicate the comdat.
11 @foo = internal global i8 0, comdat
16 ; CHECK: $foo = comdat any
18 ; CHECK: @foo = internal global i8 0, comdat
19 ; CHECK: @foo.1 = internal global i8 1, comdat($foo)
21 ; CHECK: define ptr @bar() {
22 ; CHECK-NEXT: ret ptr @foo
25 ; CHECK: define ptr @zed() {
26 ; CHECK-NEXT: call void @bax()
27 ; CHECK-NEXT: ret ptr @foo.1
30 ; CHECK: define internal void @bax() comdat($foo) {
31 ; CHECK-NEXT: ret void
36 @foo = internal global i8 1, comdat
41 define internal void @bax() comdat($foo) {