llvm.org GIT mirror llvm / d571205
Use "weak alias" instead of "alias weak" Before this patch we had @a = weak global ... but @b = alias weak ... The patch changes aliases to look more like global variables. Looking at some really old code suggests that the reason was that the old bison based parser had a reduction for alias linkages and another one for global variable linkages. Putting the alias first avoided the reduce/reduce conflict. The days of the old .ll parser are long gone. The new one parses just "linkage" and a later check is responsible for deciding if a linkage is valid in a given context. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214355 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 5 years ago
43 changed file(s) with 159 addition(s) and 163 deletion(s). Raw diff Collapse all Expand all
697697
698698 Syntax::
699699
700 @ = [Visibility] [DLLStorageClass] [ThreadLocal] [unnamed_addr] alias [Linkage] @
700 @ = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal] [unnamed_addr] alias @
701701
702702 The linkage must be one of ``private``, ``internal``, ``linkonce``, ``weak``,
703703 ``linkonce_odr``, ``weak_odr``, ``external``. Note that some system linkers
480480 parseOptionalUnnamedAddr(UnnamedAddr))
481481 return true;
482482
483 if (HasLinkage || Lex.getKind() != lltok::kw_alias)
483 if (Lex.getKind() != lltok::kw_alias)
484484 return ParseGlobal(Name, NameLoc, Linkage, HasLinkage, Visibility,
485485 DLLStorageClass, TLM, UnnamedAddr);
486 return ParseAlias(Name, NameLoc, Visibility, DLLStorageClass, TLM,
486 return ParseAlias(Name, NameLoc, Linkage, Visibility, DLLStorageClass, TLM,
487487 UnnamedAddr);
488488 }
489489
509509 parseOptionalUnnamedAddr(UnnamedAddr))
510510 return true;
511511
512 if (HasLinkage || Lex.getKind() != lltok::kw_alias)
512 if (Lex.getKind() != lltok::kw_alias)
513513 return ParseGlobal(Name, NameLoc, Linkage, HasLinkage, Visibility,
514514 DLLStorageClass, TLM, UnnamedAddr);
515 return ParseAlias(Name, NameLoc, Visibility, DLLStorageClass, TLM,
515
516 return ParseAlias(Name, NameLoc, Linkage, Visibility, DLLStorageClass, TLM,
516517 UnnamedAddr);
517518 }
518519
690691 }
691692
692693 /// ParseAlias:
693 /// ::= GlobalVar '=' OptionalVisibility OptionalDLLStorageClass
694 /// OptionalThreadLocal OptionalUnNammedAddr 'alias'
695 /// OptionalLinkage Aliasee
694 /// ::= GlobalVar '=' OptionalLinkage OptionalVisibility
695 /// OptionalDLLStorageClass OptionalThreadLocal
696 /// OptionalUnNammedAddr 'alias' Aliasee
696697 ///
697698 /// Aliasee
698699 /// ::= TypeAndValue
699700 ///
700701 /// Everything through OptionalUnNammedAddr has already been parsed.
701702 ///
702 bool LLParser::ParseAlias(const std::string &Name, LocTy NameLoc,
703 bool LLParser::ParseAlias(const std::string &Name, LocTy NameLoc, unsigned L,
703704 unsigned Visibility, unsigned DLLStorageClass,
704705 GlobalVariable::ThreadLocalMode TLM,
705706 bool UnnamedAddr) {
706707 assert(Lex.getKind() == lltok::kw_alias);
707708 Lex.Lex();
708 LocTy LinkageLoc = Lex.getLoc();
709 unsigned L;
710 if (ParseOptionalLinkage(L))
711 return true;
712709
713710 GlobalValue::LinkageTypes Linkage = (GlobalValue::LinkageTypes) L;
714711
715712 if(!GlobalAlias::isValidLinkage(Linkage))
716 return Error(LinkageLoc, "invalid linkage type for alias");
713 return Error(NameLoc, "invalid linkage type for alias");
717714
718715 if (!isValidVisibilityForLinkage(Visibility, L))
719 return Error(LinkageLoc,
716 return Error(NameLoc,
720717 "symbol with local linkage must have default visibility");
721718
722719 Constant *Aliasee;
257257 bool HasLinkage, unsigned Visibility,
258258 unsigned DLLStorageClass,
259259 GlobalVariable::ThreadLocalMode TLM, bool UnnamedAddr);
260 bool ParseAlias(const std::string &Name, LocTy Loc, unsigned Visibility,
261 unsigned DLLStorageClass,
260 bool ParseAlias(const std::string &Name, LocTy Loc, unsigned Linkage,
261 unsigned Visibility, unsigned DLLStorageClass,
262262 GlobalVariable::ThreadLocalMode TLM, bool UnnamedAddr);
263263 bool parseComdat();
264264 bool ParseStandaloneMetadata();
15081508 PrintLLVMName(Out, GA);
15091509 Out << " = ";
15101510 }
1511 PrintLinkage(GA->getLinkage(), Out);
15111512 PrintVisibility(GA->getVisibility(), Out);
15121513 PrintDLLStorageClass(GA->getDLLStorageClass(), Out);
15131514 PrintThreadLocalModel(GA->getThreadLocalMode(), Out);
15151516 Out << "unnamed_addr ";
15161517
15171518 Out << "alias ";
1518
1519 PrintLinkage(GA->getLinkage(), Out);
15201519
15211520 const Constant *Aliasee = GA->getAliasee();
15221521
11 ; PR1645
22
33 @__gthread_active_ptr.5335 = internal constant i8* bitcast (i32 (i32)* @__gthrw_pthread_cancel to i8*)
4 @__gthrw_pthread_cancel = alias weak i32 (i32)* @pthread_cancel
4 @__gthrw_pthread_cancel = weak alias i32 (i32)* @pthread_cancel
55
66
77
22 ; Test that global aliases are allowed to be constant addrspacecast
33
44 @i = internal addrspace(1) global i8 42
5 @ia = alias internal addrspacecast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(3)*)
6 ; CHECK: @ia = alias internal addrspacecast (i8 addrspace(2)* addrspace(1)* bitcast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(1)*) to i8 addrspace(2)* addrspace(3)*)
5 @ia = internal alias addrspacecast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(3)*)
6 ; 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)*)
11
22 @global = global i32 0
33
4 @alias = hidden alias internal i32* @global
4 @alias = internal hidden alias i32* @global
55 ; CHECK: symbol with local linkage must have default visibility
11
22 @global = global i32 0
33
4 @alias = protected alias internal i32* @global
4 @alias = internal protected alias i32* @global
55 ; CHECK: symbol with local linkage must have default visibility
11
22 @global = global i32 0
33
4 @alias = hidden alias private i32* @global
4 @alias = private hidden alias i32* @global
55 ; CHECK: symbol with local linkage must have default visibility
11
22 @global = global i32 0
33
4 @alias = protected alias private i32* @global
4 @alias = private protected alias i32* @global
55 ; CHECK: symbol with local linkage must have default visibility
2525 @global = global i32 0
2626
2727 @default.internal.alias = alias internal i32* @global
28 ; CHECK: @default.internal.alias = alias internal i32* @global
28 ; CHECK: @default.internal.alias = internal alias i32* @global
2929
3030 @hidden.internal.alias = hidden alias internal i32* @global
31 ; CHECK: @hidden.internal.alias = alias internal i32* @global
31 ; CHECK: @hidden.internal.alias = internal alias i32* @global
3232
3333 @protected.internal.alias = protected alias internal i32* @global
34 ; CHECK: @protected.internal.alias = alias internal i32* @global
34 ; CHECK: @protected.internal.alias = internal alias i32* @global
3535
3636 @default.private.alias = alias private i32* @global
37 ; CHECK: @default.private.alias = alias private i32* @global
37 ; CHECK: @default.private.alias = private alias i32* @global
3838
3939 @hidden.private.alias = hidden alias private i32* @global
40 ; CHECK: @hidden.private.alias = alias private i32* @global
40 ; CHECK: @hidden.private.alias = private alias i32* @global
4141
4242 @protected.private.alias = protected alias private i32* @global
43 ; CHECK: @protected.private.alias = alias private i32* @global
43 ; CHECK: @protected.private.alias = private alias i32* @global
4444
4545 define internal void @default.internal() {
4646 ; CHECK: define internal void @default.internal
2424 define i32 @foo_f() {
2525 ret i32 0
2626 }
27 @bar_f = alias weak %FunTy* @foo_f
27 @bar_f = weak alias %FunTy* @foo_f
2828
29 @bar_i = alias internal i32* @bar
29 @bar_i = internal alias i32* @bar
3030
3131 @A = alias bitcast (i32* @bar to i64*)
3232
2929 %"struct.qdesigner_internal::GridLayout" = type { %"struct.qdesigner_internal::Layout", %"struct.QPair", %"struct.qdesigner_internal::Grid"* }
3030 %"struct.qdesigner_internal::Layout" = type { %struct.QObject, %"struct.QList", %struct.QWidget*, %"struct.QHash >", %struct.QWidget*, %struct.QDesignerFormWindowInterface*, i8, %"struct.QPair", %struct.QRect, i8 }
3131
32 @_ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; [#uses=0]
33 @_ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; [#uses=0]
34 @_ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; [#uses=0]
35 @_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; [#uses=0]
36 @_ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel ; [#uses=0]
37 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0]
38 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0]
39 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0]
40 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%struct.pthread_mutex_t*, %struct.Alignment*)* @pthread_mutex_init ; [#uses=0]
41 @_ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0]
42 @_ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; [#uses=0]
43 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%struct.Alignment*)* @pthread_mutexattr_init ; [#uses=0]
44 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%struct.Alignment*, i32)* @pthread_mutexattr_settype ; [#uses=0]
45 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%struct.Alignment*)* @pthread_mutexattr_destroy ; *)*> [#uses=0]
32 @_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*)* @pthread_once ; *)*> [#uses=0]
33 @_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32)* @pthread_getspecific ; [#uses=0]
34 @_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*)* @pthread_setspecific ; [#uses=0]
35 @_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = weak alias i32 (i64*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; [#uses=0]
36 @_ZL22__gthrw_pthread_cancelm = weak alias i32 (i64)* @pthread_cancel ; [#uses=0]
37 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0]
38 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0]
39 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0]
40 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%struct.pthread_mutex_t*, %struct.Alignment*)* @pthread_mutex_init ; [#uses=0]
41 @_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0]
42 @_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32)* @pthread_key_delete ; [#uses=0]
43 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%struct.Alignment*)* @pthread_mutexattr_init ; [#uses=0]
44 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%struct.Alignment*, i32)* @pthread_mutexattr_settype ; [#uses=0]
45 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%struct.Alignment*)* @pthread_mutexattr_destroy ; [#uses=0]
4646
4747 define void @_ZN18qdesigner_internal10GridLayout9buildGridEv(%"struct.qdesigner_internal::GridLayout"* %this) nounwind {
4848 entry:
0 ; RUN: llc < %s -mtriple=i686-pc-linux-gnu | FileCheck %s
11
2 @__gthrw_pthread_once = alias weak i32 (i32*, void ()*)* @pthread_once ; [#uses=0]
2 @__gthrw_pthread_once = weak alias i32 (i32*, void ()*)* @pthread_once ; [#uses=0]
33
44 define weak i32 @pthread_once(i32*, void ()*) {
55 ret i32 0
2929 ret i32 0
3030 }
3131 ; CHECK-DAG: .weak bar_f
32 @bar_f = alias weak %FunTy* @foo_f
32 @bar_f = weak alias %FunTy* @foo_f
3333
34 @bar_l = alias linkonce_odr i32* @bar
34 @bar_l = linkonce_odr alias i32* @bar
3535 ; CHECK-DAG: .weak bar_l
3636
37 @bar_i = alias internal i32* @bar
37 @bar_i = internal alias i32* @bar
3838
3939 ; CHECK-DAG: .globl A
4040 @A = alias bitcast (i32* @bar to i64*)
6969
7070 ; CHECK: .weak weak_alias
7171 ; CHECK: weak_alias = f1
72 @weak_alias = dllexport alias weak_odr void()* @f1
72 @weak_alias = weak_odr dllexport alias void()* @f1
7373
7474 @blob = global [6 x i8] c"\B8*\00\00\00\C3", section ".text", align 16
7575 @blob_alias = dllexport alias bitcast ([6 x i8]* @blob to i32 ()*)
8888
8989 ; CHECK: .weak _weak_alias
9090 ; CHECK: _weak_alias = _f1
91 @weak_alias = dllexport alias weak_odr void()* @f1
91 @weak_alias = weak_odr dllexport alias void()* @f1
9292
9393
9494 ; CHECK: .section .drectve
1212 ; CHECK: leal v@TLSGD
1313 ; CHECK: __tls_get_addr
1414
15 @alias = alias internal i32* @v
15 @alias = internal alias i32* @v
1616 define i32 @f_alias() nounwind {
1717 entry:
1818 %t = load i32* @v
44 ret i32 0
55 }
66
7 @i = alias internal i32 ()* @f
7 @i = internal alias i32 ()* @f
88 @j = alias i32 ()* @f
99
1010 define i32 @main(i32 %argc, i8** %argv) {
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
11 ; RUN: grep "callq g@PLT" %t1
22
3 @g = alias weak i32 ()* @f
3 @g = weak alias i32 ()* @f
44
55 define void @h() {
66 entry:
88 %class.anon = type { i8 }
99 %class.anon.0 = type { i8 }
1010
11 @"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = alias internal void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"
12 @"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = alias internal void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"
11 @"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = internal alias void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"
12 @"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = internal alias void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"
1313
1414 define void @_ZN17BPLFunctionWriter9writeExprEv(%class.BPLFunctionWriter* %this) nounwind uwtable align 2 {
1515 entry:
2020 define i32 @foo_f() {
2121 ret i32 0
2222 }
23 @bar_f = alias weak_odr %FunTy* @foo_f
23 @bar_f = weak_odr alias %FunTy* @foo_f
2424 @bar_ff = alias i32()* @bar_f
2525
26 @bar_i = alias internal i32* @bar
26 @bar_i = internal alias i32* @bar
2727
2828 @A = alias bitcast (i32* @bar to i64*)
2929
77 target triple = "x86_64-unknown-linux-gnu"
88 @foo = weak global i32 0 ; [#uses=1]
99
10 @bar = alias weak i32* @foo ; [#uses=1]
10 @bar = weak alias i32* @foo ; [#uses=1]
1111
1212 define i32 @baz() nounwind {
1313 entry:
66 %union.pthread_mutexattr_t = type { [4 x i8] }
77 %union.pthread_cond_t = type { [48 x i8] }
88
9 @_ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once
10 @_ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific
11 @_ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific
12 @_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create
13 @_ZL20__gthrw_pthread_joinmPPv = alias weak i32 (i64, i8**)* @pthread_join
14 @_ZL21__gthrw_pthread_equalmm = alias weak i32 (i64, i64)* @pthread_equal
15 @_ZL20__gthrw_pthread_selfv = alias weak i64 ()* @pthread_self
16 @_ZL22__gthrw_pthread_detachm = alias weak i32 (i64)* @pthread_detach
17 @_ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel
18 @_ZL19__gthrw_sched_yieldv = alias weak i32 ()* @sched_yield
19 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock
20 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock
21 @_ZL31__gthrw_pthread_mutex_timedlockP15pthread_mutex_tPK8timespec = alias weak i32 (%union.pthread_mutex_t*, %struct.timespec*)* @pthread_mutex_timedlock
22 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock
23 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init
24 @_ZL29__gthrw_pthread_mutex_destroyP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_destroy
25 @_ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t = alias weak i32 (%union.pthread_cond_t*)* @pthread_cond_broadcast
26 @_ZL27__gthrw_pthread_cond_signalP14pthread_cond_t = alias weak i32 (%union.pthread_cond_t*)* @pthread_cond_signal
27 @_ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t = alias weak i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*)* @pthread_cond_wait
28 @_ZL30__gthrw_pthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec = alias weak i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*)* @pthread_cond_timedwait
29 @_ZL28__gthrw_pthread_cond_destroyP14pthread_cond_t = alias weak i32 (%union.pthread_cond_t*)* @pthread_cond_destroy
30 @_ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create
31 @_ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete
32 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init
33 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype
34 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy
9 @_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*)* @pthread_once
10 @_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32)* @pthread_getspecific
11 @_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*)* @pthread_setspecific
12 @_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = weak alias i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create
13 @_ZL20__gthrw_pthread_joinmPPv = weak alias i32 (i64, i8**)* @pthread_join
14 @_ZL21__gthrw_pthread_equalmm = weak alias i32 (i64, i64)* @pthread_equal
15 @_ZL20__gthrw_pthread_selfv = weak alias i64 ()* @pthread_self
16 @_ZL22__gthrw_pthread_detachm = weak alias i32 (i64)* @pthread_detach
17 @_ZL22__gthrw_pthread_cancelm = weak alias i32 (i64)* @pthread_cancel
18 @_ZL19__gthrw_sched_yieldv = weak alias i32 ()* @sched_yield
19 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock
20 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock
21 @_ZL31__gthrw_pthread_mutex_timedlockP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_mutex_t*, %struct.timespec*)* @pthread_mutex_timedlock
22 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock
23 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init
24 @_ZL29__gthrw_pthread_mutex_destroyP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_destroy
25 @_ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_broadcast
26 @_ZL27__gthrw_pthread_cond_signalP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_signal
27 @_ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*)* @pthread_cond_wait
28 @_ZL30__gthrw_pthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*)* @pthread_cond_timedwait
29 @_ZL28__gthrw_pthread_cond_destroyP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_destroy
30 @_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*)* @pthread_key_create
31 @_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32)* @pthread_key_delete
32 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init
33 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype
34 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy
3535
3636 declare extern_weak i32 @pthread_once(i32*, void ()*)
3737
99 %union.pthread_cond_t = type { [48 x i8] }
1010
1111 @_ZN13HexxagonBoardC1ERKS_ = alias void (%struct.HexxagonBoard*, %struct.HexxagonBoard*)* @_ZN13HexxagonBoardC2ERKS_
12 @_ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once
13 @_ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific
14 @_ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific
15 @_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create
16 @_ZL20__gthrw_pthread_joinmPPv = alias weak i32 (i64, i8**)* @pthread_join
17 @_ZL21__gthrw_pthread_equalmm = alias weak i32 (i64, i64)* @pthread_equal
18 @_ZL20__gthrw_pthread_selfv = alias weak i64 ()* @pthread_self
19 @_ZL22__gthrw_pthread_detachm = alias weak i32 (i64)* @pthread_detach
20 @_ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel
21 @_ZL19__gthrw_sched_yieldv = alias weak i32 ()* @sched_yield
22 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock
23 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock
24 @_ZL31__gthrw_pthread_mutex_timedlockP15pthread_mutex_tPK8timespec = alias weak i32 (%union.pthread_mutex_t*, %struct.timespec*)* @pthread_mutex_timedlock
25 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock
26 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init
27 @_ZL29__gthrw_pthread_mutex_destroyP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_destroy
28 @_ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t = alias weak i32 (%union.pthread_cond_t*)* @pthread_cond_broadcast
29 @_ZL27__gthrw_pthread_cond_signalP14pthread_cond_t = alias weak i32 (%union.pthread_cond_t*)* @pthread_cond_signal
30 @_ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t = alias weak i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*)* @pthread_cond_wait
31 @_ZL30__gthrw_pthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec = alias weak i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*)* @pthread_cond_timedwait
32 @_ZL28__gthrw_pthread_cond_destroyP14pthread_cond_t = alias weak i32 (%union.pthread_cond_t*)* @pthread_cond_destroy
33 @_ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create
34 @_ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete
35 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init
36 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype
37 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy
12 @_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*)* @pthread_once
13 @_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32)* @pthread_getspecific
14 @_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*)* @pthread_setspecific
15 @_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = weak alias i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create
16 @_ZL20__gthrw_pthread_joinmPPv = weak alias i32 (i64, i8**)* @pthread_join
17 @_ZL21__gthrw_pthread_equalmm = weak alias i32 (i64, i64)* @pthread_equal
18 @_ZL20__gthrw_pthread_selfv = weak alias i64 ()* @pthread_self
19 @_ZL22__gthrw_pthread_detachm = weak alias i32 (i64)* @pthread_detach
20 @_ZL22__gthrw_pthread_cancelm = weak alias i32 (i64)* @pthread_cancel
21 @_ZL19__gthrw_sched_yieldv = weak alias i32 ()* @sched_yield
22 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock
23 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock
24 @_ZL31__gthrw_pthread_mutex_timedlockP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_mutex_t*, %struct.timespec*)* @pthread_mutex_timedlock
25 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock
26 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init
27 @_ZL29__gthrw_pthread_mutex_destroyP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_destroy
28 @_ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_broadcast
29 @_ZL27__gthrw_pthread_cond_signalP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_signal
30 @_ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*)* @pthread_cond_wait
31 @_ZL30__gthrw_pthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*)* @pthread_cond_timedwait
32 @_ZL28__gthrw_pthread_cond_destroyP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_destroy
33 @_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*)* @pthread_key_create
34 @_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32)* @pthread_key_delete
35 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init
36 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype
37 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy
3838
3939 define void @_ZN13HexxagonBoardC2ERKS_(%struct.HexxagonBoard*, %struct.HexxagonBoard*) uwtable align 2 {
4040 ret void
77 @v3 = weak hidden global i32 0
88
99 ; Aliases
10 @a1 = hidden alias weak i32* @v1
11 @a2 = protected alias weak i32* @v2
12 @a3 = hidden alias weak i32* @v3
10 @a1 = weak hidden alias i32* @v1
11 @a2 = weak protected alias i32* @v2
12 @a3 = weak hidden alias i32* @v3
1313
1414 ; Functions
1515 define weak hidden void @f1() {
2727 @g4 = private global i32 42
2828
2929 @a1 = alias i32* @g1
30 @a2 = alias internal i32* @g1
30 @a2 = internal alias i32* @g1
3131
3232 define void @f1() {
3333 ret void
1616 %"struct.std::pair > > >,bool>" = type { %"struct.std::_Rb_tree_iterator > > >", i8 }
1717 %"struct.std::pair" = type { i8*, i8* }
1818
19 @_ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; [#uses=0]
20 @_ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; [#uses=0]
21 @_ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; [#uses=0]
22 @_ZL22__gthrw_pthread_createPmPK16__pthread_attr_sPFPvS3_ES3_ = alias weak i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; [#uses=0]
23 @_ZL22__gthrw_pthread_cancelm = alias weak i32 (i32)* @pthread_cancel ; [#uses=0]
24 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0]
25 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0]
26 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0]
27 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%struct.pthread_mutex_t*, %struct.__sched_param*)* @pthread_mutex_init ; [#uses=0]
28 @_ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0]
29 @_ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; [#uses=0]
30 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%struct.__sched_param*)* @pthread_mutexattr_init ; [#uses=0]
31 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%struct.__sched_param*, i32)* @pthread_mutexattr_settype ; [#uses=0]
32 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%struct.__sched_param*)* @pthread_mutexattr_destroy ; *)*> [#uses=0]
19 @_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*)* @pthread_once ; *)*> [#uses=0]
20 @_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32)* @pthread_getspecific ; [#uses=0]
21 @_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*)* @pthread_setspecific ; [#uses=0]
22 @_ZL22__gthrw_pthread_createPmPK16__pthread_attr_sPFPvS3_ES3_ = weak alias i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; [#uses=0]
23 @_ZL22__gthrw_pthread_cancelm = weak alias i32 (i32)* @pthread_cancel ; [#uses=0]
24 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0]
25 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0]
26 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0]
27 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%struct.pthread_mutex_t*, %struct.__sched_param*)* @pthread_mutex_init ; [#uses=0]
28 @_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0]
29 @_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32)* @pthread_key_delete ; [#uses=0]
30 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%struct.__sched_param*)* @pthread_mutexattr_init ; [#uses=0]
31 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%struct.__sched_param*, i32)* @pthread_mutexattr_settype ; [#uses=0]
32 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%struct.__sched_param*)* @pthread_mutexattr_destroy ; [#uses=0]
3333
3434 declare fastcc void @_ZNSt10_Select1stISt4pairIKPvS1_EEC1Ev() nounwind readnone
3535
44 @A = global i32 0
55 ; CHECK: @A = global i32 0
66
7 @D = alias internal i32* @A
7 @D = internal alias i32* @A
88 ; DEAD-NOT: @D
99
1010 @L1 = alias i32* @A
1111 ; CHECK: @L1 = alias i32* @A
1212
13 @L2 = alias internal i32* @L1
14 ; CHECK: @L2 = alias internal i32* @L1
13 @L2 = internal alias i32* @L1
14 ; CHECK: @L2 = internal alias i32* @L1
1515
1616 @L3 = alias i32* @L2
1717 ; CHECK: @L3 = alias i32* @L2
0 ; RUN: opt < %s -globaldce
11
2 @A = alias internal void ()* @F
2 @A = internal alias void ()* @F
33 define internal void @F() { ret void }
1212 ret void
1313 }
1414
15 @b = alias internal void ()* @g
15 @b = internal alias void ()* @g
1616 ; CHECK-NOT: @b
1717
1818 define void @h() {
88 @bar1 = alias void ()* @bar2
99 ; CHECK: @bar1 = alias void ()* @bar2
1010
11 @weak1 = alias weak void ()* @bar2
12 ; CHECK: @weak1 = alias weak void ()* @bar2
11 @weak1 = weak alias void ()* @bar2
12 ; CHECK: @weak1 = weak alias void ()* @bar2
1313
1414 @bar4 = private unnamed_addr constant [2 x i8*] zeroinitializer
15 @foo4 = unnamed_addr alias linkonce_odr getelementptr inbounds ([2 x i8*]* @bar4, i32 0, i32 1)
16 ; CHECK: @foo4 = unnamed_addr alias linkonce_odr getelementptr inbounds ([2 x i8*]* @bar4, i32 0, i32 1)
15 @foo4 = linkonce_odr unnamed_addr alias getelementptr inbounds ([2 x i8*]* @bar4, i32 0, i32 1)
16 ; CHECK: @foo4 = linkonce_odr unnamed_addr alias getelementptr inbounds ([2 x i8*]* @bar4, i32 0, i32 1)
1717
1818 define void @bar2() {
1919 ret void
66 @i = internal addrspace(1) global i8 42
77
88 ; CHECK: @ia = internal addrspace(1) global i8 42
9 @ia = alias internal i8 addrspace(1)* @i
9 @ia = internal alias i8 addrspace(1)* @i
1010
1111 @llvm.used = appending global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* @ca to i8*)], section "llvm.metadata"
1212 ; CHECK-DAG: @llvm.used = appending global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* @ca to i8*)], section "llvm.metadata"
1717 @sameAsUsed = global [1 x i8*] [i8* addrspacecast(i8 addrspace(1)* @ca to i8*)]
1818 ; CHECK-DAG: @sameAsUsed = global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* @c to i8*)]
1919
20 @ca = alias internal i8 addrspace(1)* @c
21 ; CHECK: @ca = alias internal i8 addrspace(1)* @c
20 @ca = internal alias i8 addrspace(1)* @c
21 ; CHECK: @ca = internal alias i8 addrspace(1)* @c
2222
2323 define i8 addrspace(1)* @h() {
2424 ret i8 addrspace(1)* @ca
0 ; RUN: opt -S -globalopt < %s | FileCheck %s
11
22 @_Z17in_custom_section = internal global i8 42, section "CUSTOM"
3 @in_custom_section = dllexport alias internal i8* @_Z17in_custom_section
3 @in_custom_section = internal dllexport alias i8* @_Z17in_custom_section
44
55 ; CHECK: @in_custom_section = internal dllexport global i8 42, section "CUSTOM"
66
33
44 @i = internal global i8 42
55 ; CHECK: @ia = internal global i8 42
6 @ia = alias internal i8* @i
6 @ia = internal alias i8* @i
77
88 @llvm.used = appending global [3 x i8*] [i8* bitcast (void ()* @fa to i8*), i8* bitcast (void ()* @f to i8*), i8* @ca], section "llvm.metadata"
99 ; 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"
1717 @other = global i32* bitcast (void ()* @fa to i32*)
1818 ; CHECK-DAG: @other = global i32* bitcast (void ()* @f to i32*)
1919
20 @fa = alias internal void ()* @f
21 ; CHECK: @fa = alias internal void ()* @f
20 @fa = internal alias void ()* @f
21 ; CHECK: @fa = internal alias void ()* @f
2222
23 @fa2 = alias internal void ()* @f
23 @fa2 = internal alias void ()* @f
2424 ; CHECK-NOT: @fa2
2525
26 @fa3 = alias internal void ()* @f
26 @fa3 = internal alias void ()* @f
2727 ; CHECK: @fa3
2828
29 @ca = alias internal i8* @c
30 ; CHECK: @ca = alias internal i8* @c
29 @ca = internal alias i8* @c
30 ; CHECK: @ca = internal alias i8* @c
3131
3232 define void @f() {
3333 ret void
0 ; RUN: opt < %s -instcombine -S | grep icmp
11 ; PR1646
22
3 @__gthrw_pthread_cancel = alias weak i32 (i32)* @pthread_cancel ; [#uses=1]
3 @__gthrw_pthread_cancel = weak alias i32 (i32)* @pthread_cancel ; [#uses=1]
44 @__gthread_active_ptr.5335 = internal constant i8* bitcast (i32 (i32)* @__gthrw_pthread_cancel to i8*) ; [#uses=1]
55 define weak i32 @pthread_cancel(i32) {
66 ret i32 0
0 ; RUN: opt < %s -instcombine -S | grep icmp
11 ; PR1678
22
3 @A = alias weak void ()* @B ; [#uses=1]
3 @A = weak alias void ()* @B ; [#uses=1]
44
55 define weak void @B() {
66 ret void
3131 ret i16 %1
3232 }
3333
34 @a_alias = alias weak [60 x i8] addrspace(3)* @a_as3
34 @a_alias = weak alias [60 x i8] addrspace(3)* @a_as3
3535 define i32 @foo_alias() nounwind {
3636 %1 = call i32 @llvm.objectsize.i32.p3i8(i8 addrspace(3)* getelementptr inbounds ([60 x i8] addrspace(3)* @a_alias, i32 0, i32 0), i1 false)
3737 ret i32 %1
255255 ret i32 7
256256 }
257257
258 @globalalias = alias internal [60 x i8]* @a
258 @globalalias = internal alias [60 x i8]* @a
259259
260260 ; CHECK-LABEL: @test18(
261261 ; CHECK-NEXT: ret i32 60
265265 ret i32 %1
266266 }
267267
268 @globalalias2 = alias weak [60 x i8]* @a
268 @globalalias2 = weak alias [60 x i8]* @a
269269
270270 ; CHECK-LABEL: @test19(
271271 ; CHECK: llvm.objectsize
33 ; CHECK: @A = internal global i32 0
44
55 @B = alias i32* @A
6 ; CHECK: @B = alias internal i32* @A
6 ; CHECK: @B = internal alias i32* @A
77
88 @C = alias i32* @A
9 ; CHECK: @C = alias internal i32* @A
9 ; CHECK: @C = internal alias i32* @A
1010
1111 define i32 @main() {
1212 %tmp = load i32* @C
99 ; CHECK: @protected.variable = internal global i32 0
1010 @protected.variable = protected global i32 0
1111
12 ; CHECK: @hidden.alias = alias internal i32* @global
12 ; CHECK: @hidden.alias = internal alias i32* @global
1313 @hidden.alias = hidden alias i32* @global
14 ; CHECK: @protected.alias = alias internal i32* @global
14 ; CHECK: @protected.alias = internal alias i32* @global
1515 @protected.alias = protected alias i32* @global
1616
1717 ; CHECK: define internal void @hidden.function() {
1111 @func_5_xxx.static_local_3_xxx = internal global i32 3, align 4
1212 @global_3_xxx = common global i32 0, align 4
1313
14 @func_7_xxx = alias weak i32 (...)* @aliased_func_7_xxx
14 @func_7_xxx = weak alias i32 (...)* @aliased_func_7_xxx
1515
1616 define i32 @aliased_func_7_xxx(...) {
1717 ret i32 0
2020
2121
2222 @test3_a = global i32 42
23 @test3_b = alias weak i32* @test3_a
23 @test3_b = weak alias i32* @test3_a
2424 @test3_c = alias i32* @test3_b
2525 ; CHECK: Alias cannot point to a weak alias
2626 ; CHECK-NEXT: i32* @test3_c