1 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
3 @gv.decl = external constant [8 x i8]
4 @gv.def = constant [8 x i8] zeroinitializer
6 @gv.associated.func.decl = external addrspace(1) constant [8 x i8], !associated !0
7 @gv.associated.func.def = external addrspace(1) constant [8 x i8], !associated !1
9 @gv.associated.gv.decl = external addrspace(1) constant [8 x i8], !associated !2
10 @gv.associated.gv.def = external addrspace(1) constant [8 x i8], !associated !3
12 @alias = alias i32, ptr @gv.def
14 @gv.associated.alias.gv.def = external addrspace(1) constant [8 x i8], !associated !4
16 @gv.associated.alias.addrspacecast = external addrspace(1) constant [8 x i8], !associated !5
17 @alias.addrspacecast = alias i32, ptr addrspace(1) addrspacecast (ptr @gv.def to ptr addrspace(1))
20 @gv.def.associated.addrspacecast = external addrspace(1) constant [8 x i8], !associated !6
22 @ifunc = dso_local ifunc i32 (i32), ptr @ifunc_resolver
23 @gv.associated.ifunc = external constant [8 x i8], !associated !7
25 @gv.associated.null = external constant [8 x i8], !associated !8
26 @gv.associated.inttoptr = external constant [8 x i8], !associated !9
27 @gv.associated.poison = external constant [8 x i8], !associated !10
28 @gv.associated.undef = external constant [8 x i8], !associated !11
29 @associated.addrspacecast.null = external addrspace(1) constant [8 x i8], !associated !12
33 ; CHECK: @[[GV_DECL:[a-zA-Z0-9_$"\\.-]+]] = external constant [8 x i8]
34 ; CHECK: @[[GV_DEF:[a-zA-Z0-9_$"\\.-]+]] = constant [8 x i8] zeroinitializer
35 ; CHECK: @[[GV_ASSOCIATED_FUNC_DECL:[a-zA-Z0-9_$"\\.-]+]] = external addrspace(1) constant [8 x i8], !associated !0
36 ; CHECK: @[[GV_ASSOCIATED_FUNC_DEF:[a-zA-Z0-9_$"\\.-]+]] = external addrspace(1) constant [8 x i8], !associated !1
37 ; CHECK: @[[GV_ASSOCIATED_GV_DECL:[a-zA-Z0-9_$"\\.-]+]] = external addrspace(1) constant [8 x i8], !associated !2
38 ; CHECK: @[[GV_ASSOCIATED_GV_DEF:[a-zA-Z0-9_$"\\.-]+]] = external addrspace(1) constant [8 x i8], !associated !3
39 ; CHECK: @[[GV_ASSOCIATED_ALIAS_GV_DEF:[a-zA-Z0-9_$"\\.-]+]] = external addrspace(1) constant [8 x i8], !associated !4
40 ; CHECK: @[[GV_ASSOCIATED_ALIAS_ADDRSPACECAST:[a-zA-Z0-9_$"\\.-]+]] = external addrspace(1) constant [8 x i8], !associated !5
41 ; CHECK: @[[GV_DEF_ASSOCIATED_ADDRSPACECAST:[a-zA-Z0-9_$"\\.-]+]] = external addrspace(1) constant [8 x i8], !associated !6
42 ; CHECK: @[[GV_ASSOCIATED_IFUNC:[a-zA-Z0-9_$"\\.-]+]] = external constant [8 x i8], !associated !7
43 ; CHECK: @[[GV_ASSOCIATED_NULL:[a-zA-Z0-9_$"\\.-]+]] = external constant [8 x i8], !associated !8
44 ; CHECK: @[[GV_ASSOCIATED_INTTOPTR:[a-zA-Z0-9_$"\\.-]+]] = external constant [8 x i8], !associated !9
45 ; CHECK: @[[GV_ASSOCIATED_POISON:[a-zA-Z0-9_$"\\.-]+]] = external constant [8 x i8], !associated !10
46 ; CHECK: @[[GV_ASSOCIATED_UNDEF:[a-zA-Z0-9_$"\\.-]+]] = external constant [8 x i8], !associated !11
47 ; CHECK: @[[ALIAS:[a-zA-Z0-9_$"\\.-]+]] = alias i32, ptr @gv.def
48 ; CHECK: @[[ALIAS_ADDRSPACECAST:[a-zA-Z0-9_$"\\.-]+]] = alias i32, addrspacecast (ptr @gv.def to ptr addrspace(1))
49 ; CHECK: @[[IFUNC:[a-zA-Z0-9_$"\\.-]+]] = dso_local ifunc i32 (i32), ptr @ifunc_resolver
51 define ptr @ifunc_resolver() {
52 ; CHECK-LABEL: @ifunc_resolver(
53 ; CHECK-NEXT: ret ptr null
59 declare void @func.decl()
60 define void @func.def() {
61 ; CHECK-LABEL: @func.def(
62 ; CHECK-NEXT: ret void
67 !0 = !{ ptr @func.decl }
68 !1 = !{ ptr @func.def }
69 !2 = !{ ptr @gv.decl }
72 !5 = !{ ptr addrspace(1) @alias.addrspacecast }
73 !6 = !{ ptr addrspace(1) addrspacecast (ptr @gv.def to ptr addrspace(1)) }
76 !9 = !{ ptr inttoptr (i64 12345 to ptr) }
79 !12 = !{ptr addrspace(1) addrspacecast (ptr null to ptr addrspace(1))}
81 ; CHECK: [[META0:![0-9]+]] = !{ptr @func.decl}
82 ; CHECK: [[META1:![0-9]+]] = !{ptr @func.def}
83 ; CHECK: [[META2:![0-9]+]] = !{ptr @gv.decl}
84 ; CHECK: [[META3:![0-9]+]] = !{ptr @gv.def}
85 ; CHECK: [[META4:![0-9]+]] = !{ptr @alias}
86 ; CHECK: [[META5:![0-9]+]] = !{ptr addrspace(1) @alias.addrspacecast}
87 ; CHECK: [[META6:![0-9]+]] = !{ptr addrspace(1) addrspacecast (ptr @gv.def to ptr addrspace(1))}
88 ; CHECK: [[META7:![0-9]+]] = !{ptr @ifunc}
89 ; CHECK: [[META8:![0-9]+]] = !{ptr null}
90 ; CHECK: [[META9:![0-9]+]] = !{ptr inttoptr (i64 12345 to ptr)}
91 ; CHECK: [[META10:![0-9]+]] = !{ptr poison}
92 ; CHECK: [[META11:![0-9]+]] = !{ptr undef}