1 ; RUN: llvm-link %s -S -o - | FileCheck %s
2 ; RUN: llvm-link %s %S/Inputs/metadata-attach.ll -S -o - | FileCheck --check-prefix=CHECK-LINKED1 %s
3 ; RUN: llvm-link %S/Inputs/metadata-attach.ll %s -S -o - | FileCheck --check-prefix=CHECK-LINKED2 %s
5 ; CHECK: @g1 = global i32 0, !attach !0{{$}}
6 ; CHECK-LINKED1: @g1 = global i32 0, !attach !0{{$}}
7 @g1 = global i32 0, !attach !0
9 ; CHECK: @g3 = weak global i32 1, !attach !0{{$}}
10 ; CHECK: @g2 = external global i32, !attach !0{{$}}
11 ; CHECK-LINKED1: @g2 = global i32 1, !attach !1{{$}}
12 @g2 = external global i32, !attach !0
14 ; CHECK-LINKED1: @g3 = global i32 2, !attach !1{{$}}
15 @g3 = weak global i32 1, !attach !0
17 ; CHECK-LINKED2: @g2 = global i32 1, !attach !0{{$}}
18 ; CHECK-LINKED2: @g3 = global i32 2, !attach !0{{$}}
19 ; CHECK-LINKED2: @g1 = global i32 0, !attach !1{{$}}
21 ; CHECK: define void @f1() !attach !0 {
22 ; CHECK-LINKED1: define void @f1() !attach !0 {
23 define void @f1() !attach !0 {
29 ; CHECK: declare !attach !0 void @f2()
30 ; CHECK-LINKED1: define void @f2() !attach !1 {
31 declare !attach !0 void @f2()
33 ; CHECK: define weak void @f3() !attach !0 {
34 ; CHECK-LINKED1: define void @f3() !attach !1 {
35 define weak void @f3() !attach !0 {
39 ; CHECK-LINKED2: define void @f2() !attach !0 {
40 ; CHECK-LINKED2: define void @f3() !attach !0 {
41 ; CHECK-LINKED2: define void @f1() !attach !1 {
43 ; CHECK-LINKED1: !0 = !{i32 0}
44 ; CHECK-LINKED1: !1 = !{i32 1}
46 ; CHECK-LINKED2: !0 = !{i32 1}
47 ; CHECK-LINKED2: !1 = !{i32 0}