return Error(NameLoc,
"symbol with local linkage must have default visibility");
+ Type *Ty;
+ LocTy ExplicitTypeLoc = Lex.getLoc();
+ if (ParseType(Ty) ||
+ ParseToken(lltok::comma, "expected comma after alias's type"))
+ return true;
+
Constant *Aliasee;
LocTy AliaseeLoc = Lex.getLoc();
if (Lex.getKind() != lltok::kw_bitcast &&
if (!PTy)
return Error(AliaseeLoc, "An alias must have pointer type");
+ if (Ty != PTy->getElementType())
+ return Error(
+ ExplicitTypeLoc,
+ "explicit pointee type doesn't match operand's pointee type");
+
// Okay, create the alias but do not insert it into the module yet.
std::unique_ptr<GlobalAlias> GA(
GlobalAlias::create(PTy, (GlobalValue::LinkageTypes)Linkage, Name,
Out << "alias ";
+ TypePrinter.print(GA->getValueType(), Out);
+
+ Out << ", ";
+
const Constant *Aliasee = GA->getAliasee();
if (!Aliasee) {
%struct.usb_hcd = type { %struct.usb_bus, i64, [0 x i64] }
@uhci_pci_ids = constant [1 x %struct.pci_device_id] zeroinitializer
-@__mod_pci_device_table = alias [1 x %struct.pci_device_id]* @uhci_pci_ids
+@__mod_pci_device_table = alias [1 x %struct.pci_device_id], [1 x %struct.pci_device_id]* @uhci_pci_ids
; <[1 x %struct.pci_device_id]*> [#uses=0]
define i32 @uhci_suspend(%struct.usb_hcd* %hcd) {
%struct.usb_hcd = type { %struct.usb_bus, [0 x i64] }
@pci_ids = constant [1 x %struct.pci_device_id] zeroinitializer
-@__mod_pci_device_table = alias [1 x %struct.pci_device_id]* @pci_ids ; <[1 x %struct.pci_device_id]*> [#uses=0]
+@__mod_pci_device_table = alias [1 x %struct.pci_device_id], [1 x %struct.pci_device_id]* @pci_ids ; <[1 x %struct.pci_device_id]*> [#uses=0]
define i32 @ehci_pci_setup(%struct.usb_hcd* %hcd) {
entry:
; PR1645
@__gthread_active_ptr.5335 = internal constant i8* bitcast (i32 (i32)* @__gthrw_pthread_cancel to i8*)
-@__gthrw_pthread_cancel = weak alias i32 (i32)* @pthread_cancel
+@__gthrw_pthread_cancel = weak alias i32 (i32), i32 (i32)* @pthread_cancel
@empty.cmp = global i1 icmp eq ([0 x i8]* @empty.1, [0 x i8]* @empty.2)
; Don't add an inbounds on @glob.a3, since it's not inbounds.
-; CHECK: @glob.a3 = alias getelementptr (i32, i32* @glob.a2, i32 1)
+; CHECK: @glob.a3 = alias i32, getelementptr (i32, i32* @glob.a2, i32 1)
@glob = global i32 0
-@glob.a3 = alias getelementptr (i32, i32* @glob.a2, i32 1)
-@glob.a2 = alias getelementptr (i32, i32* @glob.a1, i32 1)
-@glob.a1 = alias i32* @glob
+@glob.a3 = alias i32, getelementptr (i32, i32* @glob.a2, i32 1)
+@glob.a2 = alias i32, getelementptr (i32, i32* @glob.a1, i32 1)
+@glob.a1 = alias i32, i32* @glob
; Test that global aliases are allowed to be constant addrspacecast
@i = internal addrspace(1) global i8 42
-@ia = internal alias addrspacecast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(3)*)
-; CHECK: @ia = internal alias addrspacecast (i8 addrspace(2)* addrspace(1)* bitcast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(1)*) to i8 addrspace(2)* addrspace(3)*)
+@ia = internal alias i8 addrspace(2)*, addrspacecast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(3)*)
+; CHECK: @ia = internal alias i8 addrspace(2)*, addrspacecast (i8 addrspace(2)* addrspace(1)* bitcast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(1)*) to i8 addrspace(2)* addrspace(3)*)
; CHECK: error: redefinition of global named '@bar'
@foo = global i32 0
-@bar = alias i32* @foo
-@bar = alias i32* @foo
+@bar = alias i32, i32* @foo
+@bar = alias i32, i32* @foo
@alias.ref2 = global i32* getelementptr inbounds (i32, i32* @alias, i64 1)
; Aliases.
-@alias = alias i32* @global
-@alias.ref3 = alias i32* getelementptr inbounds (i32, i32* @alias, i64 1)
-@alias.ref4 = alias i32* getelementptr inbounds (i32, i32* @alias, i64 1)
+@alias = alias i32, i32* @global
+@alias.ref3 = alias i32, getelementptr inbounds (i32, i32* @alias, i64 1)
+@alias.ref4 = alias i32, getelementptr inbounds (i32, i32* @alias, i64 1)
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-unknown-linux-gnu"
-@f = alias void ()* @0 ; <void ()*> [#uses=0]
-@g = alias void ()* @1 ; <void ()*> [#uses=0]
+@f = alias void (), void ()* @0 ; <void ()*> [#uses=0]
+@g = alias void (), void ()* @1 ; <void ()*> [#uses=0]
@h = external global void ()* ; <void ()*> [#uses=0]
define internal void @0() nounwind {
@global = global i32 0
-@alias = internal hidden alias i32* @global
+@alias = internal hidden alias i32, i32* @global
; CHECK: symbol with local linkage must have default visibility
@global = global i32 0
-@alias = internal protected alias i32* @global
+@alias = internal protected alias i32, i32* @global
; CHECK: symbol with local linkage must have default visibility
--- /dev/null
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+; CHECK: <stdin>:4:12: error: explicit pointee type doesn't match operand's pointee type
+@y = global i2 0
+@x = alias i1, i2* @y
; RUN: not llvm-as %s -disable-output 2>&1 | grep "forward reference and definition of global have different types"
-@a2 = alias void ()* @g2
+@a2 = alias void (), void ()* @g2
@g2 = internal global i8 42
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: expected distinct uselistorder indexes in range [0, size)
@global = global i32 0
-@alias1 = alias i32* @global
-@alias2 = alias i32* @global
-@alias3 = alias i32* @global
+@alias1 = alias i32, i32* @global
+@alias2 = alias i32, i32* @global
+@alias3 = alias i32, i32* @global
uselistorder i32* @global, { 0, 0, 2 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: value only has one use
@global = global i32 0
-@alias = alias i32* @global
+@alias = alias i32, i32* @global
uselistorder i32* @global, { 1, 0 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: expected uselistorder indexes to change the order
@global = global i32 0
-@alias1 = alias i32* @global
-@alias2 = alias i32* @global
-@alias3 = alias i32* @global
+@alias1 = alias i32, i32* @global
+@alias2 = alias i32, i32* @global
+@alias3 = alias i32, i32* @global
uselistorder i32* @global, { 0, 1, 2 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: expected distinct uselistorder indexes in range [0, size)
@global = global i32 0
-@alias1 = alias i32* @global
-@alias2 = alias i32* @global
-@alias3 = alias i32* @global
+@alias1 = alias i32, i32* @global
+@alias2 = alias i32, i32* @global
+@alias3 = alias i32, i32* @global
uselistorder i32* @global, { 0, 3, 1 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: wrong number of indexes, expected 3
@global = global i32 0
-@alias1 = alias i32* @global
-@alias2 = alias i32* @global
-@alias3 = alias i32* @global
+@alias1 = alias i32, i32* @global
+@alias2 = alias i32, i32* @global
+@alias3 = alias i32, i32* @global
uselistorder i32* @global, { 1, 0 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: wrong number of indexes, expected 2
@global = global i32 0
-@alias1 = alias i32* @global
-@alias2 = alias i32* @global
+@alias1 = alias i32, i32* @global
+@alias2 = alias i32, i32* @global
uselistorder i32* @global, { 1, 0, 2 }
@global = global i32 0
-@alias = private hidden alias i32* @global
+@alias = private hidden alias i32, i32* @global
; CHECK: symbol with local linkage must have default visibility
@global = global i32 0
-@alias = private protected alias i32* @global
+@alias = private protected alias i32, i32* @global
; CHECK: symbol with local linkage must have default visibility
@1 = private constant i32 1
; CHECK: @1 = private constant i32 1
-@2 = private alias i32* @0
-; CHECK: @2 = private alias i32* @0
-@3 = private alias i32* @1
-; CHECK: @3 = private alias i32* @1
+@2 = private alias i32, i32* @0
+; CHECK: @2 = private alias i32, i32* @0
+@3 = private alias i32, i32* @1
+; CHECK: @3 = private alias i32, i32* @1
; RUN: verify-uselistorder < %s
@a = global [4 x i1] [i1 0, i1 1, i1 0, i1 1]
-@b = alias getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2)
+@b = alias i1, getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2)
; Check use-list order of constants used by globals.
@glob1 = global i5 7
; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
; Aliases -- Linkage
-@a.private = private alias i32* @g.private
-; CHECK: @a.private = private alias i32* @g.private
-@a.internal = internal alias i32* @g.internal
-; CHECK: @a.internal = internal alias i32* @g.internal
-@a.linkonce = linkonce alias i32* @g.linkonce
-; CHECK: @a.linkonce = linkonce alias i32* @g.linkonce
-@a.weak = weak alias i32* @g.weak
-; CHECK: @a.weak = weak alias i32* @g.weak
-@a.linkonce_odr = linkonce_odr alias i32* @g.linkonce_odr
-; CHECK: @a.linkonce_odr = linkonce_odr alias i32* @g.linkonce_odr
-@a.weak_odr = weak_odr alias i32* @g.weak_odr
-; CHECK: @a.weak_odr = weak_odr alias i32* @g.weak_odr
-@a.external = external alias i32* @g1
-; CHECK: @a.external = alias i32* @g1
+@a.private = private alias i32, i32* @g.private
+; CHECK: @a.private = private alias i32, i32* @g.private
+@a.internal = internal alias i32, i32* @g.internal
+; CHECK: @a.internal = internal alias i32, i32* @g.internal
+@a.linkonce = linkonce alias i32, i32* @g.linkonce
+; CHECK: @a.linkonce = linkonce alias i32, i32* @g.linkonce
+@a.weak = weak alias i32, i32* @g.weak
+; CHECK: @a.weak = weak alias i32, i32* @g.weak
+@a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
+; CHECK: @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
+@a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
+; CHECK: @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
+@a.external = external alias i32, i32* @g1
+; CHECK: @a.external = alias i32, i32* @g1
; Aliases -- Visibility
-@a.default = default alias i32* @g.default
-; CHECK: @a.default = alias i32* @g.default
-@a.hidden = hidden alias i32* @g.hidden
-; CHECK: @a.hidden = hidden alias i32* @g.hidden
-@a.protected = protected alias i32* @g.protected
-; CHECK: @a.protected = protected alias i32* @g.protected
+@a.default = default alias i32, i32* @g.default
+; CHECK: @a.default = alias i32, i32* @g.default
+@a.hidden = hidden alias i32, i32* @g.hidden
+; CHECK: @a.hidden = hidden alias i32, i32* @g.hidden
+@a.protected = protected alias i32, i32* @g.protected
+; CHECK: @a.protected = protected alias i32, i32* @g.protected
; Aliases -- DLLStorageClass
-@a.dlldefault = default alias i32* @g.dlldefault
-; CHECK: @a.dlldefault = alias i32* @g.dlldefault
-@a.dllimport = dllimport alias i32* @g1
-; CHECK: @a.dllimport = dllimport alias i32* @g1
-@a.dllexport = dllexport alias i32* @g.dllexport
-; CHECK: @a.dllexport = dllexport alias i32* @g.dllexport
+@a.dlldefault = default alias i32, i32* @g.dlldefault
+; CHECK: @a.dlldefault = alias i32, i32* @g.dlldefault
+@a.dllimport = dllimport alias i32, i32* @g1
+; CHECK: @a.dllimport = dllimport alias i32, i32* @g1
+@a.dllexport = dllexport alias i32, i32* @g.dllexport
+; CHECK: @a.dllexport = dllexport alias i32, i32* @g.dllexport
; Aliases -- ThreadLocal
-@a.notthreadlocal = alias i32* @g.notthreadlocal
-; CHECK: @a.notthreadlocal = alias i32* @g.notthreadlocal
-@a.generaldynamic = thread_local alias i32* @g.generaldynamic
-; CHECK: @a.generaldynamic = thread_local alias i32* @g.generaldynamic
-@a.localdynamic = thread_local(localdynamic) alias i32* @g.localdynamic
-; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32* @g.localdynamic
-@a.initialexec = thread_local(initialexec) alias i32* @g.initialexec
-; CHECK: @a.initialexec = thread_local(initialexec) alias i32* @g.initialexec
-@a.localexec = thread_local(localexec) alias i32* @g.localexec
-; CHECK: @a.localexec = thread_local(localexec) alias i32* @g.localexec
+@a.notthreadlocal = alias i32, i32* @g.notthreadlocal
+; CHECK: @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
+@a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
+; CHECK: @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
+@a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
+; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
+@a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
+; CHECK: @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
+@a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
+; CHECK: @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
; Aliases -- unnamed_addr
-@a.unnamed_addr = unnamed_addr alias i32* @g.unnamed_addr
-; CHECK: @a.unnamed_addr = unnamed_addr alias i32* @g.unnamed_addr
+@a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
+; CHECK: @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
;; Functions
; Format: define [linkage] [visibility] [DLLStorageClass]
; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
; Aliases -- Linkage
-@a.private = private alias i32* @g.private
-; CHECK: @a.private = private alias i32* @g.private
-@a.internal = internal alias i32* @g.internal
-; CHECK: @a.internal = internal alias i32* @g.internal
-@a.linkonce = linkonce alias i32* @g.linkonce
-; CHECK: @a.linkonce = linkonce alias i32* @g.linkonce
-@a.weak = weak alias i32* @g.weak
-; CHECK: @a.weak = weak alias i32* @g.weak
-@a.linkonce_odr = linkonce_odr alias i32* @g.linkonce_odr
-; CHECK: @a.linkonce_odr = linkonce_odr alias i32* @g.linkonce_odr
-@a.weak_odr = weak_odr alias i32* @g.weak_odr
-; CHECK: @a.weak_odr = weak_odr alias i32* @g.weak_odr
-@a.external = external alias i32* @g1
-; CHECK: @a.external = alias i32* @g1
+@a.private = private alias i32, i32* @g.private
+; CHECK: @a.private = private alias i32, i32* @g.private
+@a.internal = internal alias i32, i32* @g.internal
+; CHECK: @a.internal = internal alias i32, i32* @g.internal
+@a.linkonce = linkonce alias i32, i32* @g.linkonce
+; CHECK: @a.linkonce = linkonce alias i32, i32* @g.linkonce
+@a.weak = weak alias i32, i32* @g.weak
+; CHECK: @a.weak = weak alias i32, i32* @g.weak
+@a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
+; CHECK: @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
+@a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
+; CHECK: @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
+@a.external = external alias i32, i32* @g1
+; CHECK: @a.external = alias i32, i32* @g1
; Aliases -- Visibility
-@a.default = default alias i32* @g.default
-; CHECK: @a.default = alias i32* @g.default
-@a.hidden = hidden alias i32* @g.hidden
-; CHECK: @a.hidden = hidden alias i32* @g.hidden
-@a.protected = protected alias i32* @g.protected
-; CHECK: @a.protected = protected alias i32* @g.protected
+@a.default = default alias i32, i32* @g.default
+; CHECK: @a.default = alias i32, i32* @g.default
+@a.hidden = hidden alias i32, i32* @g.hidden
+; CHECK: @a.hidden = hidden alias i32, i32* @g.hidden
+@a.protected = protected alias i32, i32* @g.protected
+; CHECK: @a.protected = protected alias i32, i32* @g.protected
; Aliases -- DLLStorageClass
-@a.dlldefault = default alias i32* @g.dlldefault
-; CHECK: @a.dlldefault = alias i32* @g.dlldefault
-@a.dllimport = dllimport alias i32* @g1
-; CHECK: @a.dllimport = dllimport alias i32* @g1
-@a.dllexport = dllexport alias i32* @g.dllexport
-; CHECK: @a.dllexport = dllexport alias i32* @g.dllexport
+@a.dlldefault = default alias i32, i32* @g.dlldefault
+; CHECK: @a.dlldefault = alias i32, i32* @g.dlldefault
+@a.dllimport = dllimport alias i32, i32* @g1
+; CHECK: @a.dllimport = dllimport alias i32, i32* @g1
+@a.dllexport = dllexport alias i32, i32* @g.dllexport
+; CHECK: @a.dllexport = dllexport alias i32, i32* @g.dllexport
; Aliases -- ThreadLocal
-@a.notthreadlocal = alias i32* @g.notthreadlocal
-; CHECK: @a.notthreadlocal = alias i32* @g.notthreadlocal
-@a.generaldynamic = thread_local alias i32* @g.generaldynamic
-; CHECK: @a.generaldynamic = thread_local alias i32* @g.generaldynamic
-@a.localdynamic = thread_local(localdynamic) alias i32* @g.localdynamic
-; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32* @g.localdynamic
-@a.initialexec = thread_local(initialexec) alias i32* @g.initialexec
-; CHECK: @a.initialexec = thread_local(initialexec) alias i32* @g.initialexec
-@a.localexec = thread_local(localexec) alias i32* @g.localexec
-; CHECK: @a.localexec = thread_local(localexec) alias i32* @g.localexec
+@a.notthreadlocal = alias i32, i32* @g.notthreadlocal
+; CHECK: @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
+@a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
+; CHECK: @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
+@a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
+; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
+@a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
+; CHECK: @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
+@a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
+; CHECK: @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
; Aliases -- unnamed_addr
-@a.unnamed_addr = unnamed_addr alias i32* @g.unnamed_addr
-; CHECK: @a.unnamed_addr = unnamed_addr alias i32* @g.unnamed_addr
+@a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
+; CHECK: @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
;; Functions
; Format: define [linkage] [visibility] [DLLStorageClass]
; [unnamed_addr] alias <AliaseeTy> @<Aliasee>
; Aliases -- Linkage
-@a.private = private alias i32* @g.private
-; CHECK: @a.private = private alias i32* @g.private
-@a.internal = internal alias i32* @g.internal
-; CHECK: @a.internal = internal alias i32* @g.internal
-@a.linkonce = linkonce alias i32* @g.linkonce
-; CHECK: @a.linkonce = linkonce alias i32* @g.linkonce
-@a.weak = weak alias i32* @g.weak
-; CHECK: @a.weak = weak alias i32* @g.weak
-@a.linkonce_odr = linkonce_odr alias i32* @g.linkonce_odr
-; CHECK: @a.linkonce_odr = linkonce_odr alias i32* @g.linkonce_odr
-@a.weak_odr = weak_odr alias i32* @g.weak_odr
-; CHECK: @a.weak_odr = weak_odr alias i32* @g.weak_odr
-@a.external = external alias i32* @g1
-; CHECK: @a.external = alias i32* @g1
+@a.private = private alias i32, i32* @g.private
+; CHECK: @a.private = private alias i32, i32* @g.private
+@a.internal = internal alias i32, i32* @g.internal
+; CHECK: @a.internal = internal alias i32, i32* @g.internal
+@a.linkonce = linkonce alias i32, i32* @g.linkonce
+; CHECK: @a.linkonce = linkonce alias i32, i32* @g.linkonce
+@a.weak = weak alias i32, i32* @g.weak
+; CHECK: @a.weak = weak alias i32, i32* @g.weak
+@a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
+; CHECK: @a.linkonce_odr = linkonce_odr alias i32, i32* @g.linkonce_odr
+@a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
+; CHECK: @a.weak_odr = weak_odr alias i32, i32* @g.weak_odr
+@a.external = external alias i32, i32* @g1
+; CHECK: @a.external = alias i32, i32* @g1
; Aliases -- Visibility
-@a.default = default alias i32* @g.default
-; CHECK: @a.default = alias i32* @g.default
-@a.hidden = hidden alias i32* @g.hidden
-; CHECK: @a.hidden = hidden alias i32* @g.hidden
-@a.protected = protected alias i32* @g.protected
-; CHECK: @a.protected = protected alias i32* @g.protected
+@a.default = default alias i32, i32* @g.default
+; CHECK: @a.default = alias i32, i32* @g.default
+@a.hidden = hidden alias i32, i32* @g.hidden
+; CHECK: @a.hidden = hidden alias i32, i32* @g.hidden
+@a.protected = protected alias i32, i32* @g.protected
+; CHECK: @a.protected = protected alias i32, i32* @g.protected
; Aliases -- DLLStorageClass
-@a.dlldefault = default alias i32* @g.dlldefault
-; CHECK: @a.dlldefault = alias i32* @g.dlldefault
-@a.dllimport = dllimport alias i32* @g1
-; CHECK: @a.dllimport = dllimport alias i32* @g1
-@a.dllexport = dllexport alias i32* @g.dllexport
-; CHECK: @a.dllexport = dllexport alias i32* @g.dllexport
+@a.dlldefault = default alias i32, i32* @g.dlldefault
+; CHECK: @a.dlldefault = alias i32, i32* @g.dlldefault
+@a.dllimport = dllimport alias i32, i32* @g1
+; CHECK: @a.dllimport = dllimport alias i32, i32* @g1
+@a.dllexport = dllexport alias i32, i32* @g.dllexport
+; CHECK: @a.dllexport = dllexport alias i32, i32* @g.dllexport
; Aliases -- ThreadLocal
-@a.notthreadlocal = alias i32* @g.notthreadlocal
-; CHECK: @a.notthreadlocal = alias i32* @g.notthreadlocal
-@a.generaldynamic = thread_local alias i32* @g.generaldynamic
-; CHECK: @a.generaldynamic = thread_local alias i32* @g.generaldynamic
-@a.localdynamic = thread_local(localdynamic) alias i32* @g.localdynamic
-; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32* @g.localdynamic
-@a.initialexec = thread_local(initialexec) alias i32* @g.initialexec
-; CHECK: @a.initialexec = thread_local(initialexec) alias i32* @g.initialexec
-@a.localexec = thread_local(localexec) alias i32* @g.localexec
-; CHECK: @a.localexec = thread_local(localexec) alias i32* @g.localexec
+@a.notthreadlocal = alias i32, i32* @g.notthreadlocal
+; CHECK: @a.notthreadlocal = alias i32, i32* @g.notthreadlocal
+@a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
+; CHECK: @a.generaldynamic = thread_local alias i32, i32* @g.generaldynamic
+@a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
+; CHECK: @a.localdynamic = thread_local(localdynamic) alias i32, i32* @g.localdynamic
+@a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
+; CHECK: @a.initialexec = thread_local(initialexec) alias i32, i32* @g.initialexec
+@a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
+; CHECK: @a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
; Aliases -- unnamed_addr
-@a.unnamed_addr = unnamed_addr alias i32* @g.unnamed_addr
-; CHECK: @a.unnamed_addr = unnamed_addr alias i32* @g.unnamed_addr
+@a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
+; CHECK: @a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
;; Functions
; Format: define [linkage] [visibility] [DLLStorageClass]
; Aliases Test
; CHECK: @glob1 = global i32 1
@glob1 = global i32 1
-; CHECK: @aliased1 = alias i32* @glob1
-@aliased1 = alias i32* @glob1
-; CHECK-NEXT: @aliased2 = internal alias i32* @glob1
-@aliased2 = internal alias i32* @glob1
-; CHECK-NEXT: @aliased3 = alias i32* @glob1
-@aliased3 = external alias i32* @glob1
-; CHECK-NEXT: @aliased4 = weak alias i32* @glob1
-@aliased4 = weak alias i32* @glob1
-; CHECK-NEXT: @aliased5 = weak_odr alias i32* @glob1
-@aliased5 = weak_odr alias i32* @glob1
+; CHECK: @aliased1 = alias i32, i32* @glob1
+@aliased1 = alias i32, i32* @glob1
+; CHECK-NEXT: @aliased2 = internal alias i32, i32* @glob1
+@aliased2 = internal alias i32, i32* @glob1
+; CHECK-NEXT: @aliased3 = alias i32, i32* @glob1
+@aliased3 = external alias i32, i32* @glob1
+; CHECK-NEXT: @aliased4 = weak alias i32, i32* @glob1
+@aliased4 = weak alias i32, i32* @glob1
+; CHECK-NEXT: @aliased5 = weak_odr alias i32, i32* @glob1
+@aliased5 = weak_odr alias i32, i32* @glob1
;Parameter Attribute Test
; CHECK: declare void @ParamAttr1(i8 zeroext)
@global = global i32 0
-@default.internal.alias = alias internal i32* @global
-; CHECK: @default.internal.alias = internal alias i32* @global
+@default.internal.alias = alias internal i32, internal i32* @global
+; CHECK: @default.internal.alias = internal alias i32, i32* @global
-@hidden.internal.alias = hidden alias internal i32* @global
-; CHECK: @hidden.internal.alias = internal alias i32* @global
+@hidden.internal.alias = hidden alias internal i32, internal i32* @global
+; CHECK: @hidden.internal.alias = internal alias i32, i32* @global
-@protected.internal.alias = protected alias internal i32* @global
-; CHECK: @protected.internal.alias = internal alias i32* @global
+@protected.internal.alias = protected alias internal i32, internal i32* @global
+; CHECK: @protected.internal.alias = internal alias i32, i32* @global
-@default.private.alias = alias private i32* @global
-; CHECK: @default.private.alias = private alias i32* @global
+@default.private.alias = alias private i32, private i32* @global
+; CHECK: @default.private.alias = private alias i32, i32* @global
-@hidden.private.alias = hidden alias private i32* @global
-; CHECK: @hidden.private.alias = private alias i32* @global
+@hidden.private.alias = hidden alias private i32, private i32* @global
+; CHECK: @hidden.private.alias = private alias i32, i32* @global
-@protected.private.alias = protected alias private i32* @global
-; CHECK: @protected.private.alias = private alias i32* @global
+@protected.private.alias = protected alias private i32, private i32* @global
+; CHECK: @protected.private.alias = private alias i32, i32* @global
define internal void @default.internal() {
; CHECK: define internal void @default.internal
@v2 = global [1 x i32] zeroinitializer
; CHECK: @v2 = global [1 x i32] zeroinitializer
-@v3 = alias bitcast (i32* @v1 to i16*)
-; CHECK: @v3 = alias bitcast (i32* @v1 to i16*)
+@v3 = alias i16, bitcast (i32* @v1 to i16*)
+; CHECK: @v3 = alias i16, bitcast (i32* @v1 to i16*)
-@v4 = alias getelementptr ([1 x i32], [1 x i32]* @v2, i32 0, i32 0)
-; CHECK: @v4 = alias getelementptr inbounds ([1 x i32], [1 x i32]* @v2, i32 0, i32 0)
+@v4 = alias i32, getelementptr ([1 x i32], [1 x i32]* @v2, i32 0, i32 0)
+; CHECK: @v4 = alias i32, getelementptr inbounds ([1 x i32], [1 x i32]* @v2, i32 0, i32 0)
-@v5 = alias i32 addrspace(2)* addrspacecast (i32 addrspace(0)* @v1 to i32 addrspace(2)*)
-; CHECK: @v5 = alias addrspacecast (i32* @v1 to i32 addrspace(2)*)
+@v5 = alias i32, i32 addrspace(2)* addrspacecast (i32 addrspace(0)* @v1 to i32 addrspace(2)*)
+; CHECK: @v5 = alias i32, addrspacecast (i32* @v1 to i32 addrspace(2)*)
-@v6 = alias i16* @v3
-; CHECK: @v6 = alias i16* @v3
+@v6 = alias i16, i16* @v3
+; CHECK: @v6 = alias i16, i16* @v3
; RUN: verify-uselistorder < %s
@a = global [4 x i1] [i1 0, i1 1, i1 0, i1 1]
-@b = alias i1* getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2)
+@b = alias i1, getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2)
; Check use-list order of constants used by globals.
@glob1 = global i5 7
; Check use-list order between variables and aliases.
@target = global i3 zeroinitializer
-@alias1 = alias i3* @target
-@alias2 = alias i3* @target
-@alias3 = alias i3* @target
+@alias1 = alias i3, i3* @target
+@alias2 = alias i3, i3* @target
+@alias3 = alias i3, i3* @target
@var1 = global i3* @target
@var2 = global i3* @target
@var3 = global i3* @target
; Same as above, but for aliases.
@const.target = global i62 1
-@const.alias = alias i62* @const.target
-@const.alias.ptr = alias i62* @const.alias
-@const.alias.2 = alias i62* @const.target
+@const.alias = alias i62, i62* @const.target
+@const.alias.ptr = alias i62, i62* @const.alias
+@const.alias.2 = alias i62, i62* @const.target
define i64 @f(i64 %f) {
entry:
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -replace-funcs-with-null -bugpoint-crash-decl-funcs -silence-passes -safe-run-llc
; REQUIRES: loadable_module
-@foo2 = alias i32 ()* @foo
+@foo2 = alias i32 (), i32 ()* @foo
define i32 @foo() { ret i32 1 }
@var32 = global [3 x i32] zeroinitializer
@var64 = global [3 x i64] zeroinitializer
@var32_align64 = global [3 x i32] zeroinitializer, align 8
-@alias = alias [3 x i32]* @var32_align64
+@alias = alias [3 x i32], [3 x i32]* @var32_align64
define i64 @test_align32() {
; CHECK-LABEL: test_align32:
@.str51 = external constant [45 x i8] ; <[45 x i8]*> [#uses=1]
@__PRETTY_FUNCTION__._ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs = external constant [116 x i8] ; <[116 x i8]*> [#uses=1]
-@_ZN4llvm9RecordValC1ERKSsPNS_5RecTyEj = alias void (%"class.llvm::RecordVal"*, %"class.std::basic_string"*, %"struct.llvm::Init"*, i32)* @_ZN4llvm9RecordValC2ERKSsPNS_5RecTyEj ; <void (%"class.llvm::RecordVal"*, %"class.std::basic_string"*, %"struct.llvm::Init"*, i32)*> [#uses=0]
+@_ZN4llvm9RecordValC1ERKSsPNS_5RecTyEj = alias void (%"class.llvm::RecordVal"*, %"class.std::basic_string"*, %"struct.llvm::Init"*, i32), void (%"class.llvm::RecordVal"*, %"class.std::basic_string"*, %"struct.llvm::Init"*, i32)* @_ZN4llvm9RecordValC2ERKSsPNS_5RecTyEj ; <void (%"class.llvm::RecordVal"*, %"class.std::basic_string"*, %"struct.llvm::Init"*, i32)*> [#uses=0]
declare i8* @__dynamic_cast(i8*, i8*, i8*, i32)
; CHECK: .size elem1, 4
@bar = global i32 42
-@foo1 = alias i32* @bar
-@foo2 = alias i32* @bar
+@foo1 = alias i32, i32* @bar
+@foo2 = alias i32, i32* @bar
%FunTy = type i32()
define i32 @foo_f() {
ret i32 0
}
-@bar_f = weak alias %FunTy* @foo_f
+@bar_f = weak alias %FunTy, %FunTy* @foo_f
-@bar_i = internal alias i32* @bar
+@bar_i = internal alias i32, i32* @bar
-@A = alias bitcast (i32* @bar to i64*)
+@A = alias i64, bitcast (i32* @bar to i64*)
@structvar = private global {i32, i32} {i32 1, i32 2}
-@elem0 = alias getelementptr({i32, i32}, {i32, i32}* @structvar, i32 0, i32 0)
-@elem1 = alias getelementptr({i32, i32}, {i32, i32}* @structvar, i32 0, i32 1)
+@elem0 = alias i32, getelementptr({i32, i32}, {i32, i32}* @structvar, i32 0, i32 0)
+@elem1 = alias i32, getelementptr({i32, i32}, {i32, i32}* @structvar, i32 0, i32 1)
define i32 @test() {
entry:
%"struct.qdesigner_internal::GridLayout" = type { %"struct.qdesigner_internal::Layout", %"struct.QPair<int,int>", %"struct.qdesigner_internal::Grid"* }
%"struct.qdesigner_internal::Layout" = type { %struct.QObject, %"struct.QList<QAbstractExtensionFactory*>", %struct.QWidget*, %"struct.QHash<QString,QList<QAbstractExtensionFactory*> >", %struct.QWidget*, %struct.QDesignerFormWindowInterface*, i8, %"struct.QPair<int,int>", %struct.QRect, i8 }
-@_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
-@_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32)* @pthread_getspecific ; <i8* (i32)*> [#uses=0]
-@_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*)* @pthread_setspecific ; <i32 (i32, i8*)*> [#uses=0]
-@_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = weak alias i32 (i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; <i32 (i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)*> [#uses=0]
-@_ZL22__gthrw_pthread_cancelm = weak alias i32 (i64)* @pthread_cancel ; <i32 (i64)*> [#uses=0]
-@_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
-@_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
-@_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
-@_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%struct.pthread_mutex_t*, %struct.Alignment*)* @pthread_mutex_init ; <i32 (%struct.pthread_mutex_t*, %struct.Alignment*)*> [#uses=0]
-@_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*)* @pthread_key_create ; <i32 (i32*, void (i8*)*)*> [#uses=0]
-@_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32)* @pthread_key_delete ; <i32 (i32)*> [#uses=0]
-@_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%struct.Alignment*)* @pthread_mutexattr_init ; <i32 (%struct.Alignment*)*> [#uses=0]
-@_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%struct.Alignment*, i32)* @pthread_mutexattr_settype ; <i32 (%struct.Alignment*, i32)*> [#uses=0]
-@_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%struct.Alignment*)* @pthread_mutexattr_destroy ; <i32 (%struct.Alignment*)*> [#uses=0]
+@_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*), i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
+@_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32), i8* (i32)* @pthread_getspecific ; <i8* (i32)*> [#uses=0]
+@_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*), i32 (i32, i8*)* @pthread_setspecific ; <i32 (i32, i8*)*> [#uses=0]
+@_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = weak alias i32 (i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*), i32 (i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; <i32 (i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)*> [#uses=0]
+@_ZL22__gthrw_pthread_cancelm = weak alias i32 (i64), i32 (i64)* @pthread_cancel ; <i32 (i64)*> [#uses=0]
+@_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
+@_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
+@_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
+@_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%struct.pthread_mutex_t*, %struct.Alignment*), i32 (%struct.pthread_mutex_t*, %struct.Alignment*)* @pthread_mutex_init ; <i32 (%struct.pthread_mutex_t*, %struct.Alignment*)*> [#uses=0]
+@_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*), i32 (i32*, void (i8*)*)* @pthread_key_create ; <i32 (i32*, void (i8*)*)*> [#uses=0]
+@_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32), i32 (i32)* @pthread_key_delete ; <i32 (i32)*> [#uses=0]
+@_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%struct.Alignment*), i32 (%struct.Alignment*)* @pthread_mutexattr_init ; <i32 (%struct.Alignment*)*> [#uses=0]
+@_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%struct.Alignment*, i32), i32 (%struct.Alignment*, i32)* @pthread_mutexattr_settype ; <i32 (%struct.Alignment*, i32)*> [#uses=0]
+@_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%struct.Alignment*), i32 (%struct.Alignment*)* @pthread_mutexattr_destroy ; <i32 (%struct.Alignment*)*> [#uses=0]
define void @_ZN18qdesigner_internal10GridLayout9buildGridEv(%"struct.qdesigner_internal::GridLayout"* %this) nounwind {
entry:
; RUN: llc -march=mipsel -relocation-model=pic -disable-mips-delay-filler < %s | FileCheck %s
@foo = thread_local global i32 42
-@bar = hidden thread_local alias i32* @foo
+@bar = hidden thread_local alias i32, i32* @foo
define i32* @zed() {
; CHECK-DAG: __tls_get_addr
; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -code-model=large | FileCheck --check-prefix=CHECK --check-prefix=LARGE %s
@foo = global i32 42
-@fooa = alias i32* @foo
+@fooa = alias i32, i32* @foo
@foo2 = global i64 42
-@foo2a = alias i64* @foo2
+@foo2a = alias i64, i64* @foo2
; CHECK-LABEL: bar:
define i32 @bar() {
; RUN: llc < %s -mtriple=i686-pc-linux-gnu | FileCheck %s
-@__gthrw_pthread_once = weak alias i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
+@__gthrw_pthread_once = weak alias i32 (i32*, void ()*), i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
define weak i32 @pthread_once(i32*, void ()*) {
ret i32 0
@__resp = thread_local global %struct.__res_state* @_res ; <%struct.__res_state**> [#uses=1]
@_res = global %struct.__res_state zeroinitializer, section ".bss" ; <%struct.__res_state*> [#uses=1]
-@__libc_resp = hidden thread_local alias %struct.__res_state** @__resp ; <%struct.__res_state**> [#uses=2]
+@__libc_resp = hidden thread_local alias %struct.__res_state*, %struct.__res_state** @__resp ; <%struct.__res_state**> [#uses=2]
define i32 @foo() {
; CHECK-LABEL: foo:
%struct.locale_data = type { i8*, i8*, i32, i32, { void (%struct.locale_data*)*, %struct.anon }, i32, i32, i32, [0 x %struct.locale_data_value] }
%struct.locale_data_value = type { i32* }
-@wcstoll_l = alias i64 (i32*, i32**, i32, %struct.__locale_struct*)* @__wcstoll_l
+@wcstoll_l = alias i64 (i32*, i32**, i32, %struct.__locale_struct*), i64 (i32*, i32**, i32, %struct.__locale_struct*)* @__wcstoll_l
define i64 @____wcstoll_l_internal(i32* %nptr, i32** %endptr, i32 %base, i32 %group, %struct.__locale_struct* %loc) nounwind {
entry:
; RUN: -relocation-model=pic | FileCheck %s
@thread_var = thread_local global i32 42, align 4
-@thread_alias = thread_local(localdynamic) alias i32* @thread_var
+@thread_alias = thread_local(localdynamic) alias i32, i32* @thread_var
; CHECK-LABEL: get_thread_var
define i32* @get_thread_var() {
@bar = global i32 42
; CHECK-DAG: .globl foo1
-@foo1 = alias i32* @bar
+@foo1 = alias i32, i32* @bar
; CHECK-DAG: .globl foo2
-@foo2 = alias i32* @bar
+@foo2 = alias i32, i32* @bar
%FunTy = type i32()
ret i32 0
}
; CHECK-DAG: .weak bar_f
-@bar_f = weak alias %FunTy* @foo_f
+@bar_f = weak alias %FunTy, %FunTy* @foo_f
-@bar_l = linkonce_odr alias i32* @bar
+@bar_l = linkonce_odr alias i32, i32* @bar
; CHECK-DAG: .weak bar_l
-@bar_i = internal alias i32* @bar
+@bar_i = internal alias i32, i32* @bar
; CHECK-DAG: .globl A
-@A = alias bitcast (i32* @bar to i64*)
+@A = alias i64, bitcast (i32* @bar to i64*)
; CHECK-DAG: .globl bar_h
; CHECK-DAG: .hidden bar_h
-@bar_h = hidden alias i32* @bar
+@bar_h = hidden alias i32, i32* @bar
; CHECK-DAG: .globl bar_p
; CHECK-DAG: .protected bar_p
-@bar_p = protected alias i32* @bar
+@bar_p = protected alias i32, i32* @bar
; CHECK-DAG: test2 = bar+4
-@test2 = alias getelementptr(i32, i32* @bar, i32 1)
+@test2 = alias i32, getelementptr(i32, i32* @bar, i32 1)
; CHECK-DAG: test3 = 42
-@test3 = alias inttoptr(i32 42 to i32*)
+@test3 = alias i32, inttoptr(i32 42 to i32*)
; CHECK-DAG: test4 = bar
-@test4 = alias inttoptr(i64 ptrtoint (i32* @bar to i64) to i32*)
+@test4 = alias i32, inttoptr(i64 ptrtoint (i32* @bar to i64) to i32*)
; CHECK-DAG: test5 = test2-bar
-@test5 = alias inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32),
+@test5 = alias i32, inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32),
i32 ptrtoint (i32* @bar to i32)) to i32*)
; CHECK-DAG: .globl test
$vftable = comdat largest
@some_name = private unnamed_addr constant [2 x i8*] zeroinitializer, comdat($vftable)
-@vftable = alias getelementptr([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
+@vftable = alias i8*, getelementptr([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
; CHECK: .section .text,"xr",discard,_f1
; CHECK: .globl _f1
; CHECK: .globl alias
; CHECK: alias = notExported
-@alias = dllexport alias void()* @notExported
+@alias = dllexport alias void(), void()* @notExported
; CHECK: .globl alias2
; CHECK: alias2 = f1
-@alias2 = dllexport alias void()* @f1
+@alias2 = dllexport alias void(), void()* @f1
; CHECK: .globl alias3
; CHECK: alias3 = notExported
-@alias3 = dllexport alias void()* @notExported
+@alias3 = dllexport alias void(), void()* @notExported
; CHECK: .weak weak_alias
; CHECK: weak_alias = f1
-@weak_alias = weak_odr dllexport alias void()* @f1
+@weak_alias = weak_odr dllexport alias void(), void()* @f1
@blob = global [6 x i8] c"\B8*\00\00\00\C3", section ".text", align 16
-@blob_alias = dllexport alias bitcast ([6 x i8]* @blob to i32 ()*)
+@blob_alias = dllexport alias i32 (), bitcast ([6 x i8]* @blob to i32 ()*)
; CHECK: .section .drectve
; WIN32: /EXPORT:f1
; CHECK: .globl _alias
; CHECK: _alias = _notExported
-@alias = dllexport alias void()* @notExported
+@alias = dllexport alias void(), void()* @notExported
; CHECK: .globl _alias2
; CHECK: _alias2 = _f1
-@alias2 = dllexport alias void()* @f1
+@alias2 = dllexport alias void(), void()* @f1
; CHECK: .globl _alias3
; CHECK: _alias3 = _notExported
-@alias3 = dllexport alias void()* @notExported
+@alias3 = dllexport alias void(), void()* @notExported
; CHECK: .weak _weak_alias
; CHECK: _weak_alias = _f1
-@weak_alias = weak_odr dllexport alias void()* @f1
+@weak_alias = weak_odr dllexport alias void(), void()* @f1
; CHECK: .section .drectve
; CHECK-CL-NOT: not_exported
; CHECK-NEXT: calll __emutls_get_address@PLT
; CHECK-NEXT: movl (%eax), %eax
-@alias = internal alias i32* @v
+@alias = internal alias i32, i32* @v
define i32 @f_alias() nounwind {
entry:
%t = load i32, i32* @v
; CHECK: leal v@TLSGD
; CHECK: __tls_get_addr
-@alias = internal alias i32* @v
+@alias = internal alias i32, i32* @v
define i32 @f_alias() nounwind {
entry:
%t = load i32, i32* @v
@var = global i32 0
; CHECK: alias = var
-@alias = alias i32* @var
+@alias = alias i32, i32* @var
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
; RUN: grep "callq g@PLT" %t1
-@g = weak alias i32 ()* @f
+@g = weak alias i32 (), i32 ()* @f
define void @h() {
entry:
@b_val = constant i32 42, section ".cp.rodata"
@c_val = global i32 42
-@a = alias void ()* @a_val
-@b = alias i32* @b_val
-@c = alias i32* @c_val
+@a = alias void (), void ()* @a_val
+@b = alias i32, i32* @b_val
+@c = alias i32, i32* @c_val
; CHECK-LABEL: a_addr:
; CHECK: ldap r11, a
%class.D = type { i32, i32, i32, i32 }
-@_ZN1DC1Ev = alias void (%class.D*)* @_ZN1DC2Ev
-@_ZN1DC1ERKS_ = alias void (%class.D*, %class.D*)* @_ZN1DC2ERKS_
+@_ZN1DC1Ev = alias void (%class.D*), void (%class.D*)* @_ZN1DC2Ev
+@_ZN1DC1ERKS_ = alias void (%class.D*, %class.D*), void (%class.D*, %class.D*)* @_ZN1DC2ERKS_
define void @_ZN1DC2Ev(%class.D* nocapture %this) unnamed_addr nounwind uwtable align 2 {
entry:
%class.anon = type { i8 }
%class.anon.0 = type { i8 }
-@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = internal alias void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"
-@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = internal alias void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"
+@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = internal alias void (%class.function*), void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"
+@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = internal alias void (%class.function*), void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"
define void @_ZN17BPLFunctionWriter9writeExprEv(%class.BPLFunctionWriter* %this) nounwind uwtable align 2 {
entry:
@_ZTS1A = linkonce_odr constant [3 x i8] c"1A\00"
@_ZTI1A = linkonce_odr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1A, i32 0, i32 0) }
-@_ZN1AC1Ei = alias void (%class.A*, i32)* @_ZN1AC2Ei
-@_ZN1AC1ERKS_ = alias void (%class.A*, %class.A*)* @_ZN1AC2ERKS_
+@_ZN1AC1Ei = alias void (%class.A*, i32), void (%class.A*, i32)* @_ZN1AC2Ei
+@_ZN1AC1ERKS_ = alias void (%class.A*, %class.A*), void (%class.A*, %class.A*)* @_ZN1AC2ERKS_
; Function Attrs: nounwind uwtable
define void @_ZN1AC2Ei(%class.A* %this, i32 %i) unnamed_addr #0 align 2 {
@v3 = global [2 x i16] zeroinitializer
; CHECK: @v3 = global [2 x i16] zeroinitializer
-@a1 = alias bitcast (i32* @v1 to i16*)
-; CHECK: @a1 = alias bitcast (i32* @v1 to i16*)
+@a1 = alias i16, bitcast (i32* @v1 to i16*)
+; CHECK: @a1 = alias i16, bitcast (i32* @v1 to i16*)
-@a2 = alias bitcast([1 x i32]* @v2 to i32*)
-; CHECK: @a2 = alias getelementptr inbounds ([1 x i32], [1 x i32]* @v2, i32 0, i32 0)
+@a2 = alias i32, bitcast([1 x i32]* @v2 to i32*)
+; CHECK: @a2 = alias i32, getelementptr inbounds ([1 x i32], [1 x i32]* @v2, i32 0, i32 0)
-@a3 = alias addrspacecast (i32* @v1 to i32 addrspace(2)*)
-; CHECK: @a3 = alias addrspacecast (i32* @v1 to i32 addrspace(2)*)
+@a3 = alias i32, addrspacecast (i32* @v1 to i32 addrspace(2)*)
+; CHECK: @a3 = alias i32, addrspacecast (i32* @v1 to i32 addrspace(2)*)
-@a4 = alias bitcast (i32* @v1 to i16*)
-; CHECK: @a4 = alias bitcast (i32* @v1 to i16*)
+@a4 = alias i16, bitcast (i32* @v1 to i16*)
+; CHECK: @a4 = alias i16, bitcast (i32* @v1 to i16*)
-@a5 = thread_local(localdynamic) alias i32* @v1
-; CHECK: @a5 = thread_local(localdynamic) alias i32* @v1
+@a5 = thread_local(localdynamic) alias i32, i32* @v1
+; CHECK: @a5 = thread_local(localdynamic) alias i32, i32* @v1
-@a6 = alias getelementptr ([2 x i16], [2 x i16]* @v3, i32 1, i32 1)
-; CHECK: @a6 = alias getelementptr ([2 x i16], [2 x i16]* @v3, i32 1, i32 1)
+@a6 = alias i16, getelementptr ([2 x i16], [2 x i16]* @v3, i32 1, i32 1)
+; CHECK: @a6 = alias i16, getelementptr ([2 x i16], [2 x i16]* @v3, i32 1, i32 1)
@llvm.used = appending global [1 x i8*] [i8* bitcast (i32* @foo1 to i8*)], section "llvm.metadata"
@bar = global i32 0
-@foo1 = alias i32* @bar
-@foo2 = alias i32* @bar
-@foo3 = alias i32* @foo2
-@foo4 = unnamed_addr alias i32* @foo2
+@foo1 = alias i32, i32* @bar
+@foo2 = alias i32, i32* @bar
+@foo3 = alias i32, i32* @foo2
+@foo4 = unnamed_addr alias i32, i32* @foo2
; Make sure the verifier does not complain about references to a global
; declaration from an initializer.
@decl = external global i32
@ptr = global i32* @decl
-@ptr_a = alias i32** @ptr
+@ptr_a = alias i32*, i32** @ptr
%FunTy = type i32()
define i32 @foo_f() {
ret i32 0
}
-@bar_f = weak_odr alias %FunTy* @foo_f
-@bar_ff = alias i32()* @bar_f
+@bar_f = weak_odr alias %FunTy, %FunTy* @foo_f
+@bar_ff = alias i32(), i32()* @bar_f
-@bar_i = internal alias i32* @bar
+@bar_i = internal alias i32, i32* @bar
-@A = alias bitcast (i32* @bar to i64*)
+@A = alias i64, bitcast (i32* @bar to i64*)
define i32 @test() {
entry:
@v = global i32 0, comdat($f)
; CHECK: @v = global i32 0, comdat($f)
-@a = alias i32* @v
-; CHECK: @a = alias i32* @v{{$}}
+@a = alias i32, i32* @v
+; CHECK: @a = alias i32, i32* @v{{$}}
define void @f() comdat($f) {
ret void
; no action should be taken for these globals
$global_noinst = comdat largest
@aliasee = private unnamed_addr constant [2 x i8] [i8 1, i8 2], comdat($global_noinst)
-@global_noinst = unnamed_addr alias [2 x i8]* @aliasee
+@global_noinst = unnamed_addr alias [2 x i8], [2 x i8]* @aliasee
; CHECK-NOT: {{asan_gen.*global_noinst}}
-; CHECK-DAG: @global_noinst = unnamed_addr alias [2 x i8]* @aliasee
+; CHECK-DAG: @global_noinst = unnamed_addr alias [2 x i8], [2 x i8]* @aliasee
@global_inst = private constant [2 x i8] [i8 1, i8 2]
; CHECK-DAG: {{asan_gen.*global_inst}}
; CHECK: @asan.module_ctor
; CHECK: %[[CALL:.*]] = call { i32 (i32, i32)*, i16 } @"dfs$g"(i32 %0, i16 0)
; CHECK: %[[XVAL:.*]] = extractvalue { i32 (i32, i32)*, i16 } %[[CALL]], 0
; CHECK: ret {{.*}} %[[XVAL]]
-@discardg = alias i32 (i32, i32)* (i32)* @g
+@discardg = alias i32 (i32, i32)* (i32), i32 (i32, i32)* (i32)* @g
declare void @custom1(i32 %a, i32 %b)
; CHECK: %[[IVAL0:.*]] = insertvalue { i32, i16 } undef, i32 %[[CALL]], 0
; CHECK: %[[IVAL1:.*]] = insertvalue { i32, i16 } %[[IVAL0]], i16 0, 1
; CHECK: ret { i32, i16 } %[[IVAL1]]
-@adiscard = alias i32 (i32, i32)* @discard
+@adiscard = alias i32 (i32, i32), i32 (i32, i32)* @discard
; CHECK: declare void @__dfsw_custom1(i32, i32, i16, i16)
; CHECK: declare i32 @__dfsw_custom2(i32, i32, i16, i16, i16*)
module asm ".symver f1,f@@version1"
; CHECK: @"dfs$f2" = alias {{.*}} @"dfs$f1"
-@f2 = alias void ()* @f1
+@f2 = alias void (), void ()* @f1
; CHECK: @"dfs$g2" = alias {{.*}} @"dfs$g1"
-@g2 = alias bitcast (void (i8*)* @g1 to void (i16*)*)
+@g2 = alias void (i16*), bitcast (void (i8*)* @g1 to void (i16*)*)
; CHECK: define void @"dfs$f1"
define void @f1() {
target triple = "x86_64-unknown-linux-gnu"
@foo = weak global i32 0 ; <i32*> [#uses=1]
-@bar = weak alias i32* @foo ; <i32*> [#uses=1]
+@bar = weak alias i32, i32* @foo ; <i32*> [#uses=1]
define i32 @baz() nounwind {
entry:
; RUN: llvm-as %p/2008-07-06-AliasFnDecl2.ll -o %t2.bc
; RUN: llvm-link %t1.bc %t2.bc -o %t3.bc
-@b = alias void ()* @a
+@b = alias void (), void ()* @a
define void @a() nounwind {
entry:
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
-@sched_clock = alias i64 ()* @native_sched_clock
+@sched_clock = alias i64 (), i64 ()* @native_sched_clock
-@foo = alias i32* @realfoo
+@foo = alias i32, i32* @realfoo
@realfoo = global i32 0
define i64 @native_sched_clock() nounwind {
%foo = type { [8 x i8] }
%bar = type { [9 x i8] }
-@zed = alias bitcast (void (%bar*)* @xyz to void (%foo*)*)
+@zed = alias void (%foo*), bitcast (void (%bar*)* @xyz to void (%foo*)*)
define void @xyz(%bar* %this) {
entry:
@zed = global i32 42
-@foo = alias i32* @zed
-@foo2 = alias bitcast (i32* @zed to i16*)
+@foo = alias i32, i32* @zed
+@foo2 = alias i16, bitcast (i32* @zed to i16*)
@zed = external constant i8
@some_name = private unnamed_addr constant [2 x i8*] [i8* @zed, i8* bitcast (void ()* @bar to i8*)], comdat($foo)
-@foo = alias getelementptr([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
+@foo = alias i8*, getelementptr([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
declare void @bar() unnamed_addr
$c1 = comdat largest
@some_name = private unnamed_addr constant i32 42, comdat($c1)
-@c1 = alias i32* @some_name
+@c1 = alias i32, i32* @some_name
%u = type { i8 }
@g2 = global %u zeroinitializer
-@a = weak alias %u* @g2
+@a = weak alias %u, %u* @g2
@v4 = hidden global i32 1, comdat($c1)
; Aliases
-@a1 = weak hidden alias i32* @v1
-@a2 = weak protected alias i32* @v2
-@a3 = weak hidden alias i32* @v3
+@a1 = weak hidden alias i32, i32* @v1
+@a2 = weak protected alias i32, i32* @v2
+@a3 = weak hidden alias i32, i32* @v3
; Functions
define weak hidden void @f1() {
; RUN: llvm-link %S/Inputs/alias.ll %s -S -o - | FileCheck %s
@foo = weak global i32 0
-; CHECK-DAG: @foo = alias i32* @zed
+; CHECK-DAG: @foo = alias i32, i32* @zed
-@bar = alias i32* @foo
-; CHECK-DAG: @bar = alias i32* @foo
+@bar = alias i32, i32* @foo
+; CHECK-DAG: @bar = alias i32, i32* @foo
@foo2 = weak global i32 0
-; CHECK-DAG: @foo2 = alias bitcast (i32* @zed to i16*)
+; CHECK-DAG: @foo2 = alias i16, bitcast (i32* @zed to i16*)
-@bar2 = alias i32* @foo2
-; CHECK-DAG: @bar2 = alias bitcast (i16* @foo2 to i32*)
+@bar2 = alias i32, i32* @foo2
+; CHECK-DAG: @bar2 = alias i32, bitcast (i16* @foo2 to i32*)
; CHECK-DAG: @zed = global i32 42
$foo = comdat largest
@foo = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (void ()* @bar to i8*)], comdat($foo)
-; CHECK: @foo = alias getelementptr inbounds ([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
+; CHECK: @foo = alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1)
declare void @bar() unnamed_addr
$c1 = comdat largest
@some_name = private unnamed_addr constant i32 42, comdat($c1)
-@c1 = alias i8* inttoptr (i32 ptrtoint (i32* @some_name to i32) to i8*)
+@c1 = alias i8, inttoptr (i32 ptrtoint (i32* @some_name to i32) to i8*)
; CHECK: COMDAT key involves incomputable alias size.
; RUN: llvm-link %s -S -o - | FileCheck %s
$c = comdat any
-@a = alias void ()* @f
+@a = alias void (), void ()* @f
define internal void @f() comdat($c) {
ret void
}
; CHECK-DAG: $c = comdat any
-; CHECK-DAG: @a = alias void ()* @f
+; CHECK-DAG: @a = alias void (), void ()* @f
; CHECK-DAG: define internal void @f() comdat($c)
$f2 = comdat largest
$_ZN3fooIiEC5Ev = comdat any
; CHECK: $_ZN3fooIiEC5Ev = comdat any
-@_ZN3fooIiEC1Ev = weak_odr alias void ()* @_ZN3fooIiEC2Ev
-; CHECK: @_ZN3fooIiEC1Ev = weak_odr alias void ()* @_ZN3fooIiEC2Ev
+@_ZN3fooIiEC1Ev = weak_odr alias void (), void ()* @_ZN3fooIiEC2Ev
+; CHECK: @_ZN3fooIiEC1Ev = weak_odr alias void (), void ()* @_ZN3fooIiEC2Ev
; CHECK: define weak_odr void @_ZN3fooIiEC2Ev() comdat($_ZN3fooIiEC5Ev) {
define weak_odr void @_ZN3fooIiEC2Ev() comdat($_ZN3fooIiEC5Ev) {
@g2 = linkonce_odr global i8 0
; CHECK-NOT: @g2
-@a1 = private alias i8* @g1
+@a1 = private alias i8, i8* @g1
; CHECK-NOT: @a1
-@a2 = linkonce_odr alias i8* @g2
+@a2 = linkonce_odr alias i8, i8* @g2
; CHECK-NOT: @a2
define private void @f1() {
%t = type { i8 }
@g = global %t zeroinitializer
-@a = weak alias %t* @g
+@a = weak alias %t, %t* @g
; CHECK: @g = global %t zeroinitializer
; CHECK: @g2 = global %t zeroinitializer
-; CHECK: @a = weak alias %t* @g
+; CHECK: @a = weak alias %t, %t* @g
; CHECK-DAG: @global-f = global i32 42
@alias-a = weak global i32 42
-; CHECK-DAG: @alias-a = alias i32* @global-f
+; CHECK-DAG: @alias-a = alias i32, i32* @global-f
@alias-b = weak unnamed_addr global i32 42
-; CHECK-DAG: @alias-b = unnamed_addr alias i32* @global-f
+; CHECK-DAG: @alias-b = unnamed_addr alias i32, i32* @global-f
declare void @func-c()
; CHECK-DAG: define weak void @func-c() {
; CHECK-DAG: @global-j = global i32 42
@alias-c = weak global i32 42
-; CHECK-DAG: @alias-c = alias i32* @global-f
+; CHECK-DAG: @alias-c = alias i32, i32* @global-f
@alias-d = weak unnamed_addr global i32 42
-; CHECK-DAG: @alias-d = alias i32* @global-f
+; CHECK-DAG: @alias-d = alias i32, i32* @global-f
declare void @func-g()
@global-e = unnamed_addr global i32 42
@global-f = unnamed_addr global i32 42
-@alias-a = unnamed_addr alias i32* @global-f
-@alias-b = unnamed_addr alias i32* @global-f
+@alias-a = unnamed_addr alias i32, i32* @global-f
+@alias-b = unnamed_addr alias i32, i32* @global-f
define weak void @func-c() unnamed_addr { ret void }
define weak void @func-d() unnamed_addr { ret void }
@global-i = global i32 42
@global-j = global i32 42
-@alias-c = alias i32* @global-f
-@alias-d = alias i32* @global-f
+@alias-c = alias i32, i32* @global-f
+@alias-d = alias i32, i32* @global-f
define weak void @func-g() { ret void }
define weak void @func-h() { ret void }
@v4 = global i32 1, comdat($c1)
; Aliases
-; CHECK: @a1 = hidden alias i32* @v1
-@a1 = alias i32* @v1
+; CHECK: @a1 = hidden alias i32, i32* @v1
+@a1 = alias i32, i32* @v1
-; CHECK: @a2 = protected alias i32* @v2
-@a2 = alias i32* @v2
+; CHECK: @a2 = protected alias i32, i32* @v2
+@a2 = alias i32, i32* @v2
-; CHECK: @a3 = hidden alias i32* @v3
-@a3 = protected alias i32* @v3
+; CHECK: @a3 = hidden alias i32, i32* @v3
+@a3 = protected alias i32, i32* @v3
; Functions
@g3 = common global i32 0
@g4 = private global i32 42
-@a1 = alias i32* @g1
-@a2 = internal alias i32* @g1
+@a1 = alias i32, i32* @g1
+@a2 = internal alias i32, i32* @g1
define void @f1() {
ret void
; CHECK: declare void @a0bar()
; DELETE: @zed = global i32 0
-; DELETE: @zeda0 = alias i32* @zed
-; DELETE-NEXT: @a0foo = alias i32* ()* @foo
-; DELETE-NEXT: @a0a0bar = alias void ()* @bar
-; DELETE-NEXT: @a0bar = alias void ()* @bar
+; DELETE: @zeda0 = alias i32, i32* @zed
+; DELETE-NEXT: @a0foo = alias i32* (), i32* ()* @foo
+; DELETE-NEXT: @a0a0bar = alias void (), void ()* @bar
+; DELETE-NEXT: @a0bar = alias void (), void ()* @bar
; DELETE: declare i32* @foo()
; DELETE: define void @bar() {
; DELETE-NEXT: %c = call i32* @foo()
; DELETE-NEXT: }
; ALIAS: @zed = external global i32
-; ALIAS: @zeda0 = alias i32* @zed
+; ALIAS: @zeda0 = alias i32, i32* @zed
-; ALIASRE: @a0a0bar = alias void ()* @bar
-; ALIASRE: @a0bar = alias void ()* @bar
+; ALIASRE: @a0a0bar = alias void (), void ()* @bar
+; ALIASRE: @a0bar = alias void (), void ()* @bar
; ALIASRE: declare void @bar()
@zed = global i32 0
-@zeda0 = alias i32* @zed
+@zeda0 = alias i32, i32* @zed
-@a0foo = alias i32* ()* @foo
+@a0foo = alias i32* (), i32* ()* @foo
define i32* @foo() {
call void @a0bar()
ret i32* @zeda0
}
-@a0a0bar = alias void ()* @bar
+@a0a0bar = alias void (), void ()* @bar
-@a0bar = alias void ()* @bar
+@a0bar = alias void (), void ()* @bar
define void @bar() {
%c = call i32* @foo()
; WITH: T bar
; WITH: T foo
-@a0foo = alias void ()* @foo
+@a0foo = alias void (), void ()* @foo
define void @foo() {
ret void
}
-@a0bar = alias void ()* @bar
+@a0bar = alias void (), void ()* @bar
define void @bar() {
ret void
}
%struct.S = type { i8 }
-@_ZN1SC1Ev = alias void (%struct.S*)* @_ZN1SC2Ev
+@_ZN1SC1Ev = alias void (%struct.S*), void (%struct.S*)* @_ZN1SC2Ev
define void @_ZN1SC2Ev(%struct.S* %this) unnamed_addr align 2 {
entry:
%this.addr = alloca %struct.S*, align 4
; CHECK-NEXT: @var7 = internal constant [16 x i8] c"foo1bar2foo3bar\00"
; CHECK-NEXT: @var8 = private constant [16 x i8] c"foo1bar2foo3bar\00", align 16
-@var4a = alias %struct.foobar* @var4
+@var4a = alias %struct.foobar, %struct.foobar* @var4
@llvm.used = appending global [1 x %struct.foobar*] [%struct.foobar* @var4a], section "llvm.metadata"
define i32 @main() {
%"struct.std::pair<std::_Rb_tree_iterator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,bool>" = type { %"struct.std::_Rb_tree_iterator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >", i8 }
%"struct.std::pair<void* const,void*>" = type { i8*, i8* }
-@_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
-@_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32)* @pthread_getspecific ; <i8* (i32)*> [#uses=0]
-@_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*)* @pthread_setspecific ; <i32 (i32, i8*)*> [#uses=0]
-@_ZL22__gthrw_pthread_createPmPK16__pthread_attr_sPFPvS3_ES3_ = weak alias i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; <i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)*> [#uses=0]
-@_ZL22__gthrw_pthread_cancelm = weak alias i32 (i32)* @pthread_cancel ; <i32 (i32)*> [#uses=0]
-@_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
-@_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
-@_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
-@_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%struct.pthread_mutex_t*, %struct.__sched_param*)* @pthread_mutex_init ; <i32 (%struct.pthread_mutex_t*, %struct.__sched_param*)*> [#uses=0]
-@_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*)* @pthread_key_create ; <i32 (i32*, void (i8*)*)*> [#uses=0]
-@_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32)* @pthread_key_delete ; <i32 (i32)*> [#uses=0]
-@_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%struct.__sched_param*)* @pthread_mutexattr_init ; <i32 (%struct.__sched_param*)*> [#uses=0]
-@_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%struct.__sched_param*, i32)* @pthread_mutexattr_settype ; <i32 (%struct.__sched_param*, i32)*> [#uses=0]
-@_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%struct.__sched_param*)* @pthread_mutexattr_destroy ; <i32 (%struct.__sched_param*)*> [#uses=0]
+@_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*), i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
+@_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32), i8* (i32)* @pthread_getspecific ; <i8* (i32)*> [#uses=0]
+@_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*), i32 (i32, i8*)* @pthread_setspecific ; <i32 (i32, i8*)*> [#uses=0]
+@_ZL22__gthrw_pthread_createPmPK16__pthread_attr_sPFPvS3_ES3_ = weak alias i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*), i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; <i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)*> [#uses=0]
+@_ZL22__gthrw_pthread_cancelm = weak alias i32 (i32), i32 (i32)* @pthread_cancel ; <i32 (i32)*> [#uses=0]
+@_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
+@_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
+@_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
+@_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%struct.pthread_mutex_t*, %struct.__sched_param*), i32 (%struct.pthread_mutex_t*, %struct.__sched_param*)* @pthread_mutex_init ; <i32 (%struct.pthread_mutex_t*, %struct.__sched_param*)*> [#uses=0]
+@_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*), i32 (i32*, void (i8*)*)* @pthread_key_create ; <i32 (i32*, void (i8*)*)*> [#uses=0]
+@_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32), i32 (i32)* @pthread_key_delete ; <i32 (i32)*> [#uses=0]
+@_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%struct.__sched_param*), i32 (%struct.__sched_param*)* @pthread_mutexattr_init ; <i32 (%struct.__sched_param*)*> [#uses=0]
+@_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%struct.__sched_param*, i32), i32 (%struct.__sched_param*, i32)* @pthread_mutexattr_settype ; <i32 (%struct.__sched_param*, i32)*> [#uses=0]
+@_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%struct.__sched_param*), i32 (%struct.__sched_param*)* @pthread_mutexattr_destroy ; <i32 (%struct.__sched_param*)*> [#uses=0]
declare fastcc void @_ZNSt10_Select1stISt4pairIKPvS1_EEC1Ev() nounwind readnone
@A = global i32 0
; CHECK: @A = global i32 0
-@D = internal alias i32* @A
+@D = internal alias i32, i32* @A
; DEAD-NOT: @D
-@L1 = alias i32* @A
-; CHECK: @L1 = alias i32* @A
+@L1 = alias i32, i32* @A
+; CHECK: @L1 = alias i32, i32* @A
-@L2 = internal alias i32* @L1
-; CHECK: @L2 = internal alias i32* @L1
+@L2 = internal alias i32, i32* @L1
+; CHECK: @L2 = internal alias i32, i32* @L1
-@L3 = alias i32* @L2
-; CHECK: @L3 = alias i32* @L2
+@L3 = alias i32, i32* @L2
+; CHECK: @L3 = alias i32, i32* @L2
; RUN: opt < %s -globaldce
-@A = internal alias void ()* @F
+@A = internal alias void (), void ()* @F
define internal void @F() { ret void }
$c1 = comdat any
; CHECK: $c1 = comdat any
-@a1 = linkonce_odr alias void ()* @f1
-; CHECK: @a1 = linkonce_odr alias void ()* @f1
+@a1 = linkonce_odr alias void (), void ()* @f1
+; CHECK: @a1 = linkonce_odr alias void (), void ()* @f1
define linkonce_odr void @f1() comdat($c1) {
ret void
@g = global i32 0
-@a = alias bitcast (i32* @g to i8*)
+@a = alias i8, bitcast (i32* @g to i8*)
define void @f() {
%tmp = load i8, i8* @a
ret void
}
-@a = alias void ()* @f
+@a = alias void (), void ()* @f
define void @g() {
call void() @a()
ret void
}
-@b = internal alias void ()* @g
+@b = internal alias void (), void ()* @g
; CHECK-NOT: @b
define void @h() {
; RUN: opt < %s -globalopt -S | FileCheck %s
-@foo1 = alias void ()* @foo2
-; CHECK: @foo1 = alias void ()* @bar2
+@foo1 = alias void (), void ()* @foo2
+; CHECK: @foo1 = alias void (), void ()* @bar2
-@foo2 = alias void()* @bar1
-; CHECK: @foo2 = alias void ()* @bar2
+@foo2 = alias void(), void()* @bar1
+; CHECK: @foo2 = alias void (), void ()* @bar2
-@bar1 = alias void ()* @bar2
-; CHECK: @bar1 = alias void ()* @bar2
+@bar1 = alias void (), void ()* @bar2
+; CHECK: @bar1 = alias void (), void ()* @bar2
-@weak1 = weak alias void ()* @bar2
-; CHECK: @weak1 = weak alias void ()* @bar2
+@weak1 = weak alias void (), void ()* @bar2
+; CHECK: @weak1 = weak alias void (), void ()* @bar2
@bar4 = private unnamed_addr constant [2 x i8*] zeroinitializer
-@foo4 = linkonce_odr unnamed_addr alias getelementptr inbounds ([2 x i8*], [2 x i8*]* @bar4, i32 0, i32 1)
-; CHECK: @foo4 = linkonce_odr unnamed_addr alias getelementptr inbounds ([2 x i8*], [2 x i8*]* @bar4, i32 0, i32 1)
+@foo4 = linkonce_odr unnamed_addr alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* @bar4, i32 0, i32 1)
+; CHECK: @foo4 = linkonce_odr unnamed_addr alias i8*, getelementptr inbounds ([2 x i8*], [2 x i8*]* @bar4, i32 0, i32 1)
define void @bar2() {
ret void
ret void
}
-@foo3 = alias void ()* @bar3
+@foo3 = alias void (), void ()* @bar3
; CHECK-NOT: bar3
define internal void @bar3() {
@i = internal addrspace(1) global i8 42
; CHECK: @ia = internal addrspace(1) global i8 42
-@ia = internal alias i8 addrspace(1)* @i
+@ia = internal alias i8, i8 addrspace(1)* @i
@llvm.used = appending global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* @ca to i8*)], section "llvm.metadata"
; CHECK-DAG: @llvm.used = appending global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* @ca to i8*)], section "llvm.metadata"
@sameAsUsed = global [1 x i8*] [i8* addrspacecast(i8 addrspace(1)* @ca to i8*)]
; CHECK-DAG: @sameAsUsed = global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* @c to i8*)]
-@ca = internal alias i8 addrspace(1)* @c
-; CHECK: @ca = internal alias i8 addrspace(1)* @c
+@ca = internal alias i8, i8 addrspace(1)* @c
+; CHECK: @ca = internal alias i8, i8 addrspace(1)* @c
define i8 addrspace(1)* @h() {
ret i8 addrspace(1)* @ca
; RUN: opt -S -globalopt < %s | FileCheck %s
@_Z17in_custom_section = internal global i8 42, section "CUSTOM"
-@in_custom_section = internal dllexport alias i8* @_Z17in_custom_section
+@in_custom_section = internal dllexport alias i8, i8* @_Z17in_custom_section
; CHECK: @in_custom_section = internal dllexport global i8 42, section "CUSTOM"
@i = internal global i8 42
; CHECK: @ia = internal global i8 42
-@ia = internal alias i8* @i
+@ia = internal alias i8, i8* @i
@llvm.used = appending global [3 x i8*] [i8* bitcast (void ()* @fa to i8*), i8* bitcast (void ()* @f to i8*), i8* @ca], section "llvm.metadata"
; CHECK-DAG: @llvm.used = appending global [3 x i8*] [i8* bitcast (void ()* @fa to i8*), i8* bitcast (void ()* @f to i8*), i8* @ca], section "llvm.metadata"
@other = global i32* bitcast (void ()* @fa to i32*)
; CHECK-DAG: @other = global i32* bitcast (void ()* @f to i32*)
-@fa = internal alias void ()* @f
-; CHECK: @fa = internal alias void ()* @f
+@fa = internal alias void (), void ()* @f
+; CHECK: @fa = internal alias void (), void ()* @f
-@fa2 = internal alias void ()* @f
+@fa2 = internal alias void (), void ()* @f
; CHECK-NOT: @fa2
-@fa3 = internal alias void ()* @f
+@fa3 = internal alias void (), void ()* @f
; CHECK: @fa3
-@ca = internal alias i8* @c
-; CHECK: @ca = internal alias i8* @c
+@ca = internal alias i8, i8* @c
+; CHECK: @ca = internal alias i8, i8* @c
define void @f() {
ret void
; RUN: opt < %s -instcombine -S | grep icmp
; PR1646
-@__gthrw_pthread_cancel = weak alias i32 (i32)* @pthread_cancel ; <i32 (i32)*> [#uses=1]
+@__gthrw_pthread_cancel = weak alias i32 (i32), i32 (i32)* @pthread_cancel ; <i32 (i32)*> [#uses=1]
@__gthread_active_ptr.5335 = internal constant i8* bitcast (i32 (i32)* @__gthrw_pthread_cancel to i8*) ; <i8**> [#uses=1]
define weak i32 @pthread_cancel(i32) {
ret i32 0
; RUN: opt < %s -instcombine -S | grep icmp
; PR1678
-@A = weak alias void ()* @B ; <void ()*> [#uses=1]
+@A = weak alias void (), void ()* @B ; <void ()*> [#uses=1]
define weak void @B() {
ret void
@0 = constant [1 x i8*] zeroinitializer
-@vtbl = alias getelementptr inbounds ([1 x i8*], [1 x i8*]* @0, i32 0, i32 0)
+@vtbl = alias i8*, getelementptr inbounds ([1 x i8*], [1 x i8*]* @0, i32 0, i32 0)
define i32 (%class.A*)* @test() {
; CHECK-LABEL: test
; Cases that should be bitcast
; Test cast between scalars with same bit sizes
-@alias_i32_to_f32 = alias bitcast (i32 (i32)* @func_i32 to float (float)*)
+@alias_i32_to_f32 = alias float (float), bitcast (i32 (i32)* @func_i32 to float (float)*)
; Test cast between vectors with same number of elements and bit sizes
-@alias_v2i32_to_v2f32 = alias bitcast (<2 x i32> (<2 x i32>)* @func_v2i32 to <2 x float> (<2 x float>)*)
+@alias_v2i32_to_v2f32 = alias <2 x float> (<2 x float>), bitcast (<2 x i32> (<2 x i32>)* @func_v2i32 to <2 x float> (<2 x float>)*)
; Test cast from vector to scalar with same number of bits
-@alias_v2f32_to_i64 = alias bitcast (i64 (i64)* @func_i64 to <2 x float> (<2 x float>)*)
+@alias_v2f32_to_i64 = alias <2 x float> (<2 x float>), bitcast (i64 (i64)* @func_i64 to <2 x float> (<2 x float>)*)
; Test cast from scalar to vector with same number of bits
-@alias_i64_to_v2f32 = alias bitcast (<2 x float> (<2 x float>)* @func_v2f32 to i64 (i64)*)
+@alias_i64_to_v2f32 = alias i64 (i64), bitcast (<2 x float> (<2 x float>)* @func_v2f32 to i64 (i64)*)
; Test cast between vectors of pointers
-@alias_v2i32p_to_v2i64p = alias bitcast (<2 x i32*> (<2 x i32*>)* @func_v2i32p to <2 x i64*> (<2 x i64*>)*)
+@alias_v2i32p_to_v2i64p = alias <2 x i64*> (<2 x i64*>), bitcast (<2 x i32*> (<2 x i32*>)* @func_v2i32p to <2 x i64*> (<2 x i64*>)*)
; Cases that should be invalid and unchanged
; Test cast between scalars with different bit sizes
-@alias_i64_to_f32 = alias bitcast (i64 (i64)* @func_i64 to float (float)*)
+@alias_i64_to_f32 = alias float (float), bitcast (i64 (i64)* @func_i64 to float (float)*)
; Test cast between vectors with different bit sizes but the
; same number of elements
-@alias_v2i64_to_v2f32 = alias bitcast (<2 x i64> (<2 x i64>)* @func_v2i64 to <2 x float> (<2 x float>)*)
+@alias_v2i64_to_v2f32 = alias <2 x float> (<2 x float>), bitcast (<2 x i64> (<2 x i64>)* @func_v2i64 to <2 x float> (<2 x float>)*)
; Test cast between vectors with same number of bits and different
; numbers of elements
-@alias_v2i32_to_v4f32 = alias bitcast (<2 x i32> (<2 x i32>)* @func_v2i32 to <4 x float> (<4 x float>)*)
+@alias_v2i32_to_v4f32 = alias <4 x float> (<4 x float>), bitcast (<2 x i32> (<2 x i32>)* @func_v2i32 to <4 x float> (<4 x float>)*)
; Test cast between scalar and vector with different number of bits
-@alias_i64_to_v4f32 = alias bitcast (<4 x float> (<4 x float>)* @func_v4f32 to i64 (i64)*)
+@alias_i64_to_v4f32 = alias i64 (i64), bitcast (<4 x float> (<4 x float>)* @func_v4f32 to i64 (i64)*)
; Test cast between vector and scalar with different number of bits
-@alias_v4f32_to_i64 = alias bitcast (i64 (i64)* @func_i64 to <4 x float> (<4 x float>)*)
+@alias_v4f32_to_i64 = alias <4 x float> (<4 x float>), bitcast (i64 (i64)* @func_i64 to <4 x float> (<4 x float>)*)
; Test cast from scalar to vector of pointers with same number of bits
; We don't know the pointer size at this point, so this can't be done
-@alias_i64_to_v2i32p = alias bitcast (<2 x i32*> (<2 x i32*>)* @func_v2i32p to i64 (i64)*)
+@alias_i64_to_v2i32p = alias i64 (i64), bitcast (<2 x i32*> (<2 x i32*>)* @func_v2i32p to i64 (i64)*)
; Test cast between vector of pointers and scalar with different number of bits
-@alias_v4i32p_to_i64 = alias bitcast (i64 (i64)* @func_i64 to <4 x i32*> (<4 x i32*>)*)
+@alias_v4i32p_to_i64 = alias <4 x i32*> (<4 x i32*>), bitcast (i64 (i64)* @func_i64 to <4 x i32*> (<4 x i32*>)*)
@G2 = global i32 42
@G3 = global [4 x i8] zeroinitializer, align 1
-@A1 = alias bitcast (i8* getelementptr inbounds ([4 x i8], [4 x i8]* @G3, i32 0, i32 2) to i32*)
-@A2 = alias inttoptr (i64 and (i64 ptrtoint (i8* getelementptr inbounds ([4 x i8], [4 x i8]* @G3, i32 0, i32 3) to i64), i64 -4) to i32*)
+@A1 = alias i32, bitcast (i8* getelementptr inbounds ([4 x i8], [4 x i8]* @G3, i32 0, i32 2) to i32*)
+@A2 = alias i32, inttoptr (i64 and (i64 ptrtoint (i8* getelementptr inbounds ([4 x i8], [4 x i8]* @G3, i32 0, i32 3) to i64), i64 -4) to i32*)
define i64 @f1() {
; This cannot be constant folded because G1 is underaligned.
ret i16 %1
}
-@a_alias = weak alias [60 x i8] addrspace(3)* @a_as3
+@a_alias = weak alias [60 x i8], [60 x i8] addrspace(3)* @a_as3
define i32 @foo_alias() nounwind {
%1 = call i32 @llvm.objectsize.i32.p3i8(i8 addrspace(3)* getelementptr inbounds ([60 x i8], [60 x i8] addrspace(3)* @a_alias, i32 0, i32 0), i1 false)
ret i32 %1
ret i32 %1
}
-@globalalias = internal alias [60 x i8]* @a
+@globalalias = internal alias [60 x i8], [60 x i8]* @a
; CHECK-LABEL: @test18(
; CHECK-NEXT: ret i32 60
ret i32 %1
}
-@globalalias2 = weak alias [60 x i8]* @a
+@globalalias2 = weak alias [60 x i8], [60 x i8]* @a
; CHECK-LABEL: @test19(
; CHECK: llvm.objectsize
@A = global i32 0
; CHECK: @A = internal global i32 0
-@B = alias i32* @A
-; CHECK: @B = internal alias i32* @A
+@B = alias i32, i32* @A
+; CHECK: @B = internal alias i32, i32* @A
-@C = alias i32* @A
-; CHECK: @C = internal alias i32* @A
+@C = alias i32, i32* @A
+; CHECK: @C = internal alias i32, i32* @A
define i32 @main() {
%tmp = load i32, i32* @C
; CHECK: @c4_a = internal global i32 0, comdat($c4)
@c4_a = internal global i32 0, comdat($c4)
-; CHECK: @c1_d = alias i32* @c1_c
-@c1_d = alias i32* @c1_c
+; CHECK: @c1_d = alias i32, i32* @c1_c
+@c1_d = alias i32, i32* @c1_c
-; CHECK: @c2_c = internal alias i32* @c2_b
-@c2_c = alias i32* @c2_b
+; CHECK: @c2_c = internal alias i32, i32* @c2_b
+@c2_c = alias i32, i32* @c2_b
-; CHECK: @c4 = alias i32* @c4_a
-@c4 = alias i32* @c4_a
+; CHECK: @c4 = alias i32, i32* @c4_a
+@c4 = alias i32, i32* @c4_a
; CHECK: define void @c1() comdat {
define void @c1() comdat {
; CHECK: @protected.variable = internal global i32 0
@protected.variable = protected global i32 0
-; CHECK: @hidden.alias = internal alias i32* @global
-@hidden.alias = hidden alias i32* @global
-; CHECK: @protected.alias = internal alias i32* @global
-@protected.alias = protected alias i32* @global
+; CHECK: @hidden.alias = internal alias i32, i32* @global
+@hidden.alias = hidden alias i32, i32* @global
+; CHECK: @protected.alias = internal alias i32, i32* @global
+@protected.alias = protected alias i32, i32* @global
; CHECK: define internal void @hidden.function() {
define hidden void @hidden.function() {
; CHECK: @[[JT:.*]] = private constant [2 x <{ i8, i32, i8, i8, i8 }>] [<{ i8, i32, i8, i8, i8 }> <{ i8 -23, i32 trunc (i64 sub (i64 sub (i64 ptrtoint (void ()* @[[FNAME:.*]] to i64), i64 ptrtoint ([2 x <{ i8, i32, i8, i8, i8 }>]* @[[JT]] to i64)), i64 5) to i32), i8 -52, i8 -52, i8 -52 }>, <{ i8, i32, i8, i8, i8 }> <{ i8 -23, i32 trunc (i64 sub (i64 sub (i64 ptrtoint (void ()* @[[GNAME:.*]] to i64), i64 ptrtoint ([2 x <{ i8, i32, i8, i8, i8 }>]* @[[JT]] to i64)), i64 13) to i32), i8 -52, i8 -52, i8 -52 }>], section ".text"
-; CHECK: @f = alias bitcast ([2 x <{ i8, i32, i8, i8, i8 }>]* @[[JT]] to void ()*)
-; CHECK: @g = alias bitcast (<{ i8, i32, i8, i8, i8 }>* getelementptr inbounds ([2 x <{ i8, i32, i8, i8, i8 }>], [2 x <{ i8, i32, i8, i8, i8 }>]* @[[JT]], i64 0, i64 1) to void ()*)
+; CHECK: @f = alias void (), bitcast ([2 x <{ i8, i32, i8, i8, i8 }>]* @[[JT]] to void ()*)
+; CHECK: @g = alias void (), bitcast (<{ i8, i32, i8, i8, i8 }>* getelementptr inbounds ([2 x <{ i8, i32, i8, i8, i8 }>], [2 x <{ i8, i32, i8, i8, i8 }>]* @[[JT]], i64 0, i64 1) to void ()*)
; CHECK: define private void @[[FNAME]]() {
define void @f() {
!llvm.bitsets = !{ !0, !1, !2, !3, !4, !5, !6, !7 }
-; CHECK: @bits_use{{[0-9]*}} = private alias i8* @bits{{[0-9]*}}
-; CHECK: @bits_use.{{[0-9]*}} = private alias i8* @bits{{[0-9]*}}
-; CHECK: @bits_use.{{[0-9]*}} = private alias i8* @bits{{[0-9]*}}
+; CHECK: @bits_use{{[0-9]*}} = private alias i8, i8* @bits{{[0-9]*}}
+; CHECK: @bits_use.{{[0-9]*}} = private alias i8, i8* @bits{{[0-9]*}}
+; CHECK: @bits_use.{{[0-9]*}} = private alias i8, i8* @bits{{[0-9]*}}
-; CHECK: @a = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 0)
-; CHECK: @b = hidden alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 2)
-; CHECK: @c = protected alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 4)
-; CHECK: @d = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 6)
+; CHECK: @a = alias i32, getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 0)
+; CHECK: @b = hidden alias [63 x i32], getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 2)
+; CHECK: @c = protected alias i32, getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 4)
+; CHECK: @d = alias [2 x i32], getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 6)
; CHECK-DARWIN: @aptr = constant i32* getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G:@[^ ]*]], i32 0, i32 0)
@aptr = constant i32* @a
; CHECK-DARWIN: [[G]] = private constant
-; CHECK: @bits{{[0-9]*}} = private alias getelementptr inbounds ([68 x i8], [68 x i8]* [[BA]], i32 0, i32 0)
-; CHECK: @bits.{{[0-9]*}} = private alias getelementptr inbounds ([68 x i8], [68 x i8]* [[BA]], i32 0, i32 0)
+; CHECK: @bits{{[0-9]*}} = private alias i8, getelementptr inbounds ([68 x i8], [68 x i8]* [[BA]], i32 0, i32 0)
+; CHECK: @bits.{{[0-9]*}} = private alias i8, getelementptr inbounds ([68 x i8], [68 x i8]* [[BA]], i32 0, i32 0)
declare i1 @llvm.bitset.test(i8* %ptr, metadata %bitset) nounwind readnone
@func_5_xxx.static_local_3_xxx = internal global i32 3, align 4
@global_3_xxx = common global i32 0, align 4
-@func_7_xxx = weak alias i32 (...)* @aliased_func_7_xxx
+@func_7_xxx = weak alias i32 (...), i32 (...)* @aliased_func_7_xxx
define i32 @aliased_func_7_xxx(...) {
ret i32 0
; RUN: opt < %s -sccp -S | FileCheck %s
@0 = private unnamed_addr constant [2 x i32] [i32 -1, i32 1]
-@"\01??_7A@@6B@" = unnamed_addr alias getelementptr inbounds ([2 x i32], [2 x i32]* @0, i32 0, i32 1)
+@"\01??_7A@@6B@" = unnamed_addr alias i32, getelementptr inbounds ([2 x i32], [2 x i32]* @0, i32 0, i32 1)
; CHECK: ret i32 1
declare void @f()
-@fa = alias void ()* @f
+@fa = alias void (), void ()* @f
; CHECK: Alias must point to a definition
; CHECK-NEXT: @fa
@g = external global i32
-@ga = alias i32* @g
+@ga = alias i32, i32* @g
; CHECK: Alias must point to a definition
; CHECK-NEXT: @ga
-@test2_a = alias i32* @test2_b
-@test2_b = alias i32* @test2_a
+@test2_a = alias i32, i32* @test2_b
+@test2_b = alias i32, i32* @test2_a
; CHECK: Aliases cannot form a cycle
; CHECK-NEXT: i32* @test2_a
; CHECK-NEXT: Aliases cannot form a cycle
@test3_a = global i32 42
-@test3_b = weak alias i32* @test3_a
-@test3_c = alias i32* @test3_b
+@test3_b = weak alias i32, i32* @test3_a
+@test3_c = alias i32, i32* @test3_b
; CHECK: Alias cannot point to a weak alias
; CHECK-NEXT: i32* @test3_c
@data = addrspace(2) global i32 27
-@illegal_alias_data = alias bitcast (i32 addrspace(2)* @data to i32 addrspace(1)*)
+@illegal_alias_data = alias i32, bitcast (i32 addrspace(2)* @data to i32 addrspace(1)*)
@r21 = global i32* @v1
@r22 = global i32(i8*)* @f1
-@a21 = alias i32* @v1
-@a22 = alias bitcast (i32* @v1 to i16*)
+@a21 = alias i32, i32* @v1
+@a22 = alias i16, bitcast (i32* @v1 to i16*)
-@a23 = alias i32(i8*)* @f1
-@a24 = alias bitcast (i32(i8*)* @f1 to i16*)
-@a25 = alias i16* @a24
+@a23 = alias i32(i8*), i32(i8*)* @f1
+@a24 = alias i16, bitcast (i32(i8*)* @f1 to i16*)
+@a25 = alias i16, i16* @a24
; CHECK-NEXT: @b = global i32 1
; CHECK-NOT: alias
-@a = weak alias i32* @b
+@a = weak alias i32, i32* @b
@b = global i32 1
@g1 = global i32 1
@g2 = global i32 2
-@a = alias inttoptr(i32 sub (i32 ptrtoint (i32* @g1 to i32),
+@a = alias inttoptr(i32 sub (i32 ptrtoint (i32, inttoptr(i32 sub (i32 ptrtoint (i32* @g1 to i32),
i32 ptrtoint (i32* @g2 to i32)) to i32*)
@r11 = global i32* @v1
@r12 = global i32 (i8*)* @f1
-@a11 = alias i32* @v1
-@a12 = alias bitcast (i32* @v1 to i16*)
+@a11 = alias i32, i32* @v1
+@a12 = alias i16, bitcast (i32* @v1 to i16*)
-@a13 = alias i32 (i8*)* @f1
-@a14 = alias bitcast (i32 (i8*)* @f1 to i16*)
-@a15 = alias i16* @a14
+@a13 = alias i32 (i8*), i32 (i8*)* @f1
+@a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
+@a15 = alias i16, i16* @a14
; CHECK: $c1 = comdat any
; CHECK: $c2 = comdat any
; CHECK: @v11 = internal global i32 41, comdat($c2)
-; CHECK: @a11 = alias i32* @v1{{$}}
-; CHECK: @a12 = alias bitcast (i32* @v1 to i16*)
+; CHECK: @a11 = alias i32, i32* @v1{{$}}
+; CHECK: @a12 = alias i16, bitcast (i32* @v1 to i16*)
-; CHECK: @a13 = alias i32 (i8*)* @f1{{$}}
-; CHECK: @a14 = alias bitcast (i32 (i8*)* @f1 to i16*)
+; CHECK: @a13 = alias i32 (i8*), i32 (i8*)* @f1{{$}}
+; CHECK: @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*)
-; CHECK: @a21 = alias i32* @v11{{$}}
-; CHECK: @a22 = alias bitcast (i32* @v11 to i16*)
+; CHECK: @a21 = alias i32, i32* @v11{{$}}
+; CHECK: @a22 = alias i16, bitcast (i32* @v11 to i16*)
-; CHECK: @a23 = alias i32 (i8*)* @f12{{$}}
-; CHECK: @a24 = alias bitcast (i32 (i8*)* @f12 to i16*)
+; CHECK: @a23 = alias i32 (i8*), i32 (i8*)* @f12{{$}}
+; CHECK: @a24 = alias i16, bitcast (i32 (i8*)* @f12 to i16*)
; CHECK: define weak_odr protected i32 @f1(i8*) comdat($c1) {
; CHECK-NEXT: bb10:
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
-; CHECK0-DAG: @afoo = alias [2 x i8*]* @foo
+; CHECK0-DAG: @afoo = alias [2 x i8*], [2 x i8*]* @foo
; CHECK1-DAG: @afoo = external global [2 x i8*]
-@afoo = alias [2 x i8*]* @foo
+@afoo = alias [2 x i8*], [2 x i8*]* @foo
; CHECK0-DAG: declare void @abar()
-; CHECK1-DAG: @abar = alias void ()* @bar
-@abar = alias void ()* @bar
+; CHECK1-DAG: @abar = alias void (), void ()* @bar
+@abar = alias void (), void ()* @bar
@foo = global [2 x i8*] [i8* bitcast (void ()* @bar to i8*), i8* bitcast (void ()* @abar to i8*)]