1 ; RUN: rm -rf %t && split-file %s %t
2 ; RUN: llvm-link -S %t/1.ll %t/1-aux.ll -o - | FileCheck %s
3 ; RUN: llvm-link -S %t/2.ll %t/2-aux.ll -o - | FileCheck %s --check-prefix=CHECK2
8 @v = global i32 0, comdat ($c)
10 ; CHECK: @v = global i32 0, comdat($c)
11 ; CHECK: @v3 = external global i32
12 ; CHECK: @v2 = external dllexport global i32
17 @v2 = weak dllexport global i32 0, comdat ($c)
22 @v3 = weak alias i32, ptr @v2
28 ;; Check that a private global variable from a non-prevailing comdat group is
29 ;; converted into 'available_externally' and excluded from the comdat group.
31 ; CHECK2: $__profc_foo = comdat any
32 ; CHECK2: @llvm.compiler.used = appending global [2 x ptr] [ptr @__profd_foo.[[SUFFIX:[0-9]+]], ptr @__profd_foo]
33 ; CHECK2: @__profd_foo.[[SUFFIX]] = private global ptr @__profc_foo, comdat($__profc_foo)
34 ; CHECK2: @__profc_foo = linkonce_odr global i64 1, comdat
35 ; CHECK2: @__profd_foo = available_externally dso_local global ptr @__profc_foo{{$}}
37 $__profc_foo = comdat any
38 @__profc_foo = linkonce_odr global i64 1, comdat
39 @__profd_foo = private global ptr @__profc_foo, comdat($__profc_foo)
40 @llvm.compiler.used = appending global [1 x ptr] [ ptr @__profd_foo ]
47 $__profc_foo = comdat any
48 @__profc_foo = linkonce_odr global i64 1, comdat
49 @__profd_foo = private global ptr @__profc_foo, comdat($__profc_foo)
50 @llvm.compiler.used = appending global [1 x ptr] [ ptr @__profd_foo ]