1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
2 ; RUN: llvm-as --opaque-pointers < %s | llvm-dis --opaque-pointers | FileCheck %s
3 ; RUN: llvm-as < %s | llvm-dis --opaque-pointers | FileCheck %s
4 ; RUN: llvm-as --opaque-pointers < %s | llvm-dis | FileCheck %s
5 ; RUN: opt --opaque-pointers < %s -S | FileCheck %s
6 ; RUN: verify-uselistorder --opaque-pointers < %s
10 ; CHECK: @g = external global i16
11 @g = external global i16
13 ; CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1, ptr null, ptr null }]
14 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* null, i8* null }]
16 ; CHECK: @ga = alias i18, ptr @g2
18 @ga = alias i18, i18* @g2
20 ; CHECK: @ga2 = alias i19, ptr @g2
21 @ga2 = alias i19, i19* bitcast (i18* @g2 to i19*)
23 ; CHECK: @gi = ifunc i20 (), ptr @f
24 @gi = ifunc i20 (), i20 ()* ()* bitcast (void (i32*)* @f to i20 ()* ()*)
26 define void @f(i32* %p) {
27 ; CHECK-LABEL: define {{[^@]+}}@f
28 ; CHECK-SAME: (ptr [[P:%.*]]) {
29 ; CHECK-NEXT: [[A:%.*]] = alloca i17, align 4
30 ; CHECK-NEXT: call void @fn.fwd(i32 0)
31 ; CHECK-NEXT: store i32 0, ptr @g.fwd, align 4
32 ; CHECK-NEXT: ret void
35 call void @fn.fwd(i32 0)
36 store i32 0, i32* @g.fwd
41 declare void @fn.fwd(i32)
43 define void @f2(i32** %p) {
44 ; CHECK-LABEL: define {{[^@]+}}@f2
45 ; CHECK-SAME: (ptr [[P:%.*]]) {
46 ; CHECK-NEXT: unreachable
51 define void @f3(i32 addrspace(1)* addrspace(2)* %p) {
52 ; CHECK-LABEL: define {{[^@]+}}@f3
53 ; CHECK-SAME: (ptr addrspace(2) [[P:%.*]]) {
54 ; CHECK-NEXT: unreachable
59 define void @f4(%ty* %p) {
60 ; CHECK-LABEL: define {{[^@]+}}@f4
61 ; CHECK-SAME: (ptr [[P:%.*]]) {
62 ; CHECK-NEXT: unreachable
67 define void @remangle_intrinsic() {
68 ; CHECK-LABEL: define {{[^@]+}}@remangle_intrinsic() {
69 ; CHECK-NEXT: [[A:%.*]] = alloca ptr, align 8
70 ; CHECK-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave()
71 ; CHECK-NEXT: call void @llvm.stackprotector(ptr null, ptr [[A]])
72 ; CHECK-NEXT: [[TMP2:%.*]] = call <2 x i64> @llvm.masked.expandload.v2i64(ptr null, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
73 ; CHECK-NEXT: ret void
76 call i8* @llvm.stacksave()
77 call void @llvm.stackprotector(i8* null, i8** %a)
78 call <2 x i64> @llvm.masked.expandload.v2i64(i64* null, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
82 define i32* @constexpr_gep() {
83 ; CHECK-LABEL: define {{[^@]+}}@constexpr_gep() {
84 ; CHECK-NEXT: ret ptr getelementptr (i32, ptr getelementptr (i8, ptr null, i64 4), i64 1)
86 ret i32* getelementptr(i32, i32* bitcast (i8* getelementptr (i8, i8* null, i64 4) to i32*), i64 1)
89 declare i8* @llvm.stacksave()
90 declare void @llvm.stackprotector(i8*, i8**)
91 declare <2 x i64> @llvm.masked.expandload.v2i64(i64*, <2 x i1>, <2 x i64>)