1 ; RUN: llvm-link %s %p/unnamed-addr1-b.ll -S -o - | FileCheck %s
4 @global-a = common global i32 0
5 ; CHECK-DAG: @global-a = common global i32 0
6 @global-b = common unnamed_addr global i32 0
7 ; CHECK-DAG: @global-b = common unnamed_addr global i32 0
9 define weak void @func-a() { ret void }
10 ; CHECK-DAG: define weak void @func-a() {
11 define weak void @func-b() unnamed_addr { ret void }
12 ; CHECK-DAG: define weak void @func-b() unnamed_addr {
14 ; Other file has unnamed_addr definition
15 @global-c = common unnamed_addr global i32 0
16 ; CHECK-DAG: @global-c = common unnamed_addr global i32 0
17 @global-d = external global i32
18 ; CHECK-DAG: @global-d = global i32 42
19 @global-e = external unnamed_addr global i32
20 ; CHECK-DAG: @global-e = unnamed_addr global i32 42
21 @global-f = weak global i32 42
22 ; CHECK-DAG: @global-f = global i32 42
24 @alias-a = weak global i32 42
25 ; CHECK-DAG: @alias-a = alias i32* @global-f
26 @alias-b = weak unnamed_addr global i32 42
27 ; CHECK-DAG: @alias-b = unnamed_addr alias i32* @global-f
29 declare void @func-c()
30 ; CHECK-DAG: define weak void @func-c() {
31 define weak void @func-d() { ret void }
32 ; CHECK-DAG: define weak void @func-d() {
33 define weak void @func-e() unnamed_addr { ret void }
34 ; CHECK-DAG: define weak void @func-e() unnamed_addr {
36 ; Other file has non-unnamed_addr definition
37 @global-g = common unnamed_addr global i32 0
38 ; CHECK-DAG: @global-g = common global i32 0
39 @global-h = external global i32
40 ; CHECK-DAG: @global-h = global i32 42
41 @global-i = external unnamed_addr global i32
42 ; CHECK-DAG: @global-i = global i32 42
43 @global-j = weak global i32 42
44 ; CHECK-DAG: @global-j = global i32 42
46 @alias-c = weak global i32 42
47 ; CHECK-DAG: @alias-c = alias i32* @global-f
48 @alias-d = weak unnamed_addr global i32 42
49 ; CHECK-DAG: @alias-d = alias i32* @global-f
52 declare void @func-g()
53 ; CHECK-DAG: define weak void @func-g() {
54 define weak void @func-h() { ret void }
55 ; CHECK-DAG: define weak void @func-h() {
56 define weak void @func-i() unnamed_addr { ret void }
57 ; CHECK-DAG: define weak void @func-i() {