1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
2 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
3 ; RUN: opt < %s -S | FileCheck %s
4 ; RUN: verify-uselistorder < %s
8 ; CHECK: @g = external global i16
9 @g = external global i16
11 ; CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1, ptr null, ptr null }]
12 @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1, ptr null, ptr null }]
14 ; CHECK: @ga = alias i18, ptr @g2
16 @ga = alias i18, ptr @g2
18 ; CHECK: @ga2 = alias i19, ptr @g2
19 @ga2 = alias i19, ptr @g2
21 ; CHECK: @gi = ifunc i20 (), ptr @resolver
22 @gi = ifunc i20 (), ptr @resolver
25 define ptr @resolver() {
26 %load = load i32, ptr @g.fwd
27 %ptr = inttoptr i32 %load to ptr
31 define void @f(ptr %p) {
32 ; CHECK-LABEL: define {{[^@]+}}@f
33 ; CHECK-SAME: (ptr [[P:%.*]]) {
34 ; CHECK-NEXT: [[A:%.*]] = alloca i17, align 4
35 ; CHECK-NEXT: call void @fn.fwd(i32 0)
36 ; CHECK-NEXT: store i32 0, ptr @g.fwd, align 4
37 ; CHECK-NEXT: ret void
40 call void @fn.fwd(i32 0)
41 store i32 0, ptr @g.fwd
46 declare void @fn.fwd(i32)
48 define void @f2(ptr %p) {
49 ; CHECK-LABEL: define {{[^@]+}}@f2
50 ; CHECK-SAME: (ptr [[P:%.*]]) {
51 ; CHECK-NEXT: unreachable
56 define void @f3(ptr addrspace(2) %p) {
57 ; CHECK-LABEL: define {{[^@]+}}@f3
58 ; CHECK-SAME: (ptr addrspace(2) [[P:%.*]]) {
59 ; CHECK-NEXT: unreachable
64 define void @f4(ptr %p) {
65 ; CHECK-LABEL: define {{[^@]+}}@f4
66 ; CHECK-SAME: (ptr [[P:%.*]]) {
67 ; CHECK-NEXT: unreachable
72 define void @remangle_intrinsic() {
73 ; CHECK-LABEL: define {{[^@]+}}@remangle_intrinsic() {
74 ; CHECK-NEXT: [[A:%.*]] = alloca ptr, align 8
75 ; CHECK-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
76 ; CHECK-NEXT: call void @llvm.stackprotector(ptr null, ptr [[A]])
77 ; CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.masked.expandload.v2i64(ptr null, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
78 ; CHECK-NEXT: ret void
81 call ptr @llvm.stacksave()
82 call void @llvm.stackprotector(ptr null, ptr %a)
83 call <2 x i64> @llvm.masked.expandload.v2i64(ptr null, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
87 define ptr @constexpr_gep() {
88 ; CHECK-LABEL: define {{[^@]+}}@constexpr_gep() {
89 ; CHECK-NEXT: ret ptr getelementptr (i32, ptr getelementptr (i8, ptr null, i64 4), i64 1)
91 ret ptr getelementptr(i32, ptr getelementptr (i8, ptr null, i64 4), i64 1)
94 declare ptr @llvm.stacksave()
95 declare void @llvm.stackprotector(ptr, ptr)
96 declare <2 x i64> @llvm.masked.expandload.v2i64(ptr, <2 x i1>, <2 x i64>)