Home | History | Annotate | Download | only in Linker
      1 ; RUN: llvm-link %s %p/unnamed-addr1-b.ll -S -o - | FileCheck %s
      2 
      3 ; Only in this file
      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
      8 
      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 {
     13 
     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 
     19 define i32* @use-global-d() {
     20   ret i32* @global-d
     21 }
     22 
     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
     28 
     29 @alias-a = weak global i32 42
     30 ; CHECK-DAG: @alias-a = alias i32, i32* @global-f
     31 @alias-b = weak unnamed_addr global i32 42
     32 ; CHECK-DAG: @alias-b = unnamed_addr alias i32, i32* @global-f
     33 
     34 declare void @func-c()
     35 define void @use-func-c() {
     36   call void @func-c()
     37   ret void
     38 }
     39 
     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 {
     45 
     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
     55 
     56 @alias-c = weak global i32 42
     57 ; CHECK-DAG: @alias-c = alias i32, i32* @global-f
     58 @alias-d = weak unnamed_addr global i32 42
     59 ; CHECK-DAG: @alias-d = alias i32, i32* @global-f
     60 
     61 
     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() {
     68