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
19 define ptr @use-global-d() {
23 ; CHECK-DAG: @global-d = global i32 42
24 @global-e = external unnamed_addr global i32
25 ; CHECK-DAG: @global-e = unnamed_addr global i32 42
26 @global-f = weak global i32 42
27 ; CHECK-DAG: @global-f = global i32 42
29 @alias-a = weak global i32 42
30 ; CHECK-DAG: @alias-a = alias i32, ptr @global-f
31 @alias-b = weak unnamed_addr global i32 42
32 ; CHECK-DAG: @alias-b = unnamed_addr alias i32, ptr @global-f
34 declare void @func-c()
35 define void @use-func-c() {
40 ; CHECK-DAG: define weak void @func-c() {
41 define weak void @func-d() { ret void }
42 ; CHECK-DAG: define weak void @func-d() {
43 define weak void @func-e() unnamed_addr { ret void }
44 ; CHECK-DAG: define weak void @func-e() unnamed_addr {
46 ; Other file has non-unnamed_addr definition
47 @global-g = common unnamed_addr global i32 0
48 ; CHECK-DAG: @global-g = common global i32 0
49 @global-h = external global i32
50 ; CHECK-DAG: @global-h = global i32 42
51 @global-i = external unnamed_addr global i32
52 ; CHECK-DAG: @global-i = global i32 42
53 @global-j = weak global i32 42
54 ; CHECK-DAG: @global-j = global i32 42
56 @alias-c = weak global i32 42
57 ; CHECK-DAG: @alias-c = alias i32, ptr @global-f
58 @alias-d = weak unnamed_addr global i32 42
59 ; CHECK-DAG: @alias-d = alias i32, ptr @global-f
62 declare void @func-g()
63 ; CHECK-DAG: define weak void @func-g() {
64 define weak void @func-h() { ret void }
65 ; CHECK-DAG: define weak void @func-h() {
66 define weak void @func-i() unnamed_addr { ret void }
67 ; CHECK-DAG: define weak void @func-i() {