Home | History | Annotate | Download | only in GlobalOpt
      1 ; RUN: opt -S -globalopt < %s | FileCheck %s
      2 
      3 target datalayout = "p:32:32:32-p1:16:16:16"
      4 
      5 @c = addrspace(1) global i8 42
      6 
      7 @i = internal addrspace(1) global i8 42
      8 
      9 ; CHECK: @ia = internal addrspace(1) global i8 42
     10 @ia = alias internal i8 addrspace(1)* @i
     11 
     12 @llvm.used = appending global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* @ca to i8*)], section "llvm.metadata"
     13 ; CHECK-DAG: @llvm.used = appending global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* @ca to i8*)], section "llvm.metadata"
     14 
     15 @llvm.compiler.used = appending global [2 x i8*] [i8* addrspacecast(i8 addrspace(1)* @ia to i8*), i8* addrspacecast (i8 addrspace(1)* @i to i8*)], section "llvm.metadata"
     16 ; CHECK-DAG: @llvm.compiler.used = appending global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* @ia to i8*)], section "llvm.metadata"
     17 
     18 @sameAsUsed = global [1 x i8*] [i8* addrspacecast(i8 addrspace(1)* @ca to i8*)]
     19 ; CHECK-DAG: @sameAsUsed = global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* @c to i8*)]
     20 
     21 @ca = alias internal i8 addrspace(1)* @c
     22 ; CHECK: @ca = alias internal i8 addrspace(1)* @c
     23 
     24 define i8 addrspace(1)* @h() {
     25   ret i8 addrspace(1)* @ca
     26 }
     27