; Function Attrs: noinline norecurse nounwind optnone sspstrong uwtable
define dso_local i32 @main() #0 {
%1 = alloca i32, align 4
- store i32 0, i32* %1, align 4
+ store i32 0, ptr %1, align 4
%2 = call i32 @"?f@@YAHXZ"()
ret i32 %2
}
target triple = "x86_64-pc-windows-msvc19.0.24215"
%class.baz = type { %class.bar }
-%class.bar = type { i32 (...)** }
+%class.bar = type { ptr }
$"\01?x@bar@@UEBA_NXZ" = comdat any
$"\01??_Gbaz@@UEAAPEAXI@Z" = comdat any
-@"\01??_7baz@@6B@" = linkonce_odr unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (i8* (%class.baz*, i32)* @"\01??_Gbaz@@UEAAPEAXI@Z" to i8*), i8* bitcast (i1 (%class.bar*)* @"\01?x@bar@@UEBA_NXZ" to i8*)] }, comdat, !type !0, !type !1
+@"\01??_7baz@@6B@" = linkonce_odr unnamed_addr constant { [2 x ptr] } { [2 x ptr] [ptr @"\01??_Gbaz@@UEAAPEAXI@Z", ptr @"\01?x@bar@@UEBA_NXZ"] }, comdat, !type !0, !type !1
define void @"\01?qux@@YAXXZ"() local_unnamed_addr {
ret void
}
-define linkonce_odr i8* @"\01??_Gbaz@@UEAAPEAXI@Z"(%class.baz* %this, i32 %should_call_delete) unnamed_addr comdat {
- ret i8* null
+define linkonce_odr ptr @"\01??_Gbaz@@UEAAPEAXI@Z"(ptr %this, i32 %should_call_delete) unnamed_addr comdat {
+ ret ptr null
}
-define linkonce_odr zeroext i1 @"\01?x@bar@@UEBA_NXZ"(%class.bar* %this) unnamed_addr comdat {
+define linkonce_odr zeroext i1 @"\01?x@bar@@UEBA_NXZ"(ptr %this) unnamed_addr comdat {
ret i1 false
}
@_tls_index = global i32 0
@_tls_used = global %IMAGE_TLS_DIRECTORY32 {
- i32 ptrtoint (i8* @_tls_start to i32),
- i32 ptrtoint (i8* @_tls_end to i32),
- i32 ptrtoint (i32* @_tls_index to i32),
+ i32 ptrtoint (ptr @_tls_start to i32),
+ i32 ptrtoint (ptr @_tls_end to i32),
+ i32 ptrtoint (ptr @_tls_index to i32),
i32 0,
i32 0,
i32 0
@_tls_index = global i64 0
@_tls_used = global %IMAGE_TLS_DIRECTORY64 {
- i64 ptrtoint (i8* @_tls_start to i64),
- i64 ptrtoint (i8* @_tls_end to i64),
- i64 ptrtoint (i64* @_tls_index to i64),
+ i64 ptrtoint (ptr @_tls_start to i64),
+ i64 ptrtoint (ptr @_tls_end to i64),
+ i64 ptrtoint (ptr @_tls_index to i64),
i64 0,
i32 0,
i32 0
target triple = "x86_64-pc-windows-msvc19.21.27702"
%struct.Init = type { %struct.S }
-%struct.S = type { i32 (...)** }
+%struct.S = type { ptr }
%rtti.CompleteObjectLocator = type { i32, i32, i32, i32, i32, i32 }
-%rtti.TypeDescriptor7 = type { i8**, i8*, [8 x i8] }
+%rtti.TypeDescriptor7 = type { ptr, ptr, [8 x i8] }
%rtti.ClassHierarchyDescriptor = type { i32, i32, i32, i32 }
%rtti.BaseClassDescriptor = type { i32, i32, i32, i32, i32, i32, i32 }
$"??_R1A@?0A@EA@S@@8" = comdat any
@"?d@@3UInit@@A" = dso_local local_unnamed_addr global %struct.Init zeroinitializer, align 8
-@anon.bcb2691509de99310dddb690fcdb4cdc.0 = private unnamed_addr constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (%rtti.CompleteObjectLocator* @"??_R4S@@6B@" to i8*), i8* bitcast (void (%struct.S*)* @"?foo@S@@UEAAXXZ" to i8*)] }, comdat($"??_SS@@6B@"), !type !0
-@"??_R4S@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUS@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3S@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.CompleteObjectLocator* @"??_R4S@@6B@" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat
-@"??_7type_info@@6B@" = external constant i8*
-@"??_R0?AUS@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"??_7type_info@@6B@", i8* null, [8 x i8] c".?AUS@@\00" }, comdat
+@anon.bcb2691509de99310dddb690fcdb4cdc.0 = private unnamed_addr constant { [2 x ptr] } { [2 x ptr] [ptr @"??_R4S@@6B@", ptr @"?foo@S@@UEAAXXZ"] }, comdat($"??_SS@@6B@"), !type !0
+@"??_R4S@@6B@" = linkonce_odr constant %rtti.CompleteObjectLocator { i32 1, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R0?AUS@@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R3S@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32), i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R4S@@6B@" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32) }, comdat
+@"??_7type_info@@6B@" = external constant ptr
+@"??_R0?AUS@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { ptr @"??_7type_info@@6B@", ptr null, [8 x i8] c".?AUS@@\00" }, comdat
@__ImageBase = external dso_local constant i8
-@"??_R3S@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint ([2 x i32]* @"??_R2S@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat
-@"??_R2S@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.BaseClassDescriptor* @"??_R1A@?0A@EA@S@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0], comdat
-@"??_R1A@?0A@EA@S@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor7* @"??_R0?AUS@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.ClassHierarchyDescriptor* @"??_R3S@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, comdat
-@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_t.cpp, i8* null }]
+@"??_R3S@@8" = linkonce_odr constant %rtti.ClassHierarchyDescriptor { i32 0, i32 0, i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R2S@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32) }, comdat
+@"??_R2S@@8" = linkonce_odr constant [2 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R1A@?0A@EA@S@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32), i32 0], comdat
+@"??_R1A@?0A@EA@S@@8" = linkonce_odr constant %rtti.BaseClassDescriptor { i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R0?AUS@@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32), i32 0, i32 0, i32 -1, i32 0, i32 64, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R3S@@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32) }, comdat
+@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I_t.cpp, ptr null }]
-@"??_SS@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @anon.bcb2691509de99310dddb690fcdb4cdc.0, i32 0, i32 0, i32 1)
+@"??_SS@@6B@" = unnamed_addr alias ptr, getelementptr inbounds ({ [2 x ptr] }, ptr @anon.bcb2691509de99310dddb690fcdb4cdc.0, i32 0, i32 0, i32 1)
declare dso_local void @"?undefined_ref@@YAXXZ"() local_unnamed_addr #0
-declare dllimport void @"?foo@S@@UEAAXXZ"(%struct.S*) unnamed_addr #0
+declare dllimport void @"?foo@S@@UEAAXXZ"(ptr) unnamed_addr #0
; Function Attrs: nounwind sspstrong uwtable
define internal void @_GLOBAL__sub_I_t.cpp() #1 {
entry:
- store i32 (...)** bitcast (i8** @"??_SS@@6B@" to i32 (...)**), i32 (...)*** getelementptr inbounds (%struct.Init, %struct.Init* @"?d@@3UInit@@A", i64 0, i32 0, i32 0), align 8
+ store ptr @"??_SS@@6B@", ptr @"?d@@3UInit@@A", align 8
tail call void @"?undefined_ref@@YAXXZ"() #2
ret void
}
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.21.27702"
-%struct.S = type { i32 (...)** }
+%struct.S = type { ptr }
; Function Attrs: norecurse nounwind readnone sspstrong uwtable
-define dso_local void @"?foo@S@@UEAAXXZ"(%struct.S* nocapture %this) unnamed_addr #0 align 2 {
+define dso_local void @"?foo@S@@UEAAXXZ"(ptr nocapture %this) unnamed_addr #0 align 2 {
entry:
ret void
}
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"
-@f = weak alias void(), void()* @g
+@f = weak alias void(), ptr @g
define void @g() {
ret void
define i32 @entry() {
entry:
- %0 = load i32, i32* @variable
+ %0 = load i32, ptr @variable
ret i32 %0
}
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.12.25835"
-declare dllimport void @do_indirect_call(void ()*)
+declare dllimport void @do_indirect_call(ptr)
define dso_local i32 @main() local_unnamed_addr {
entry:
- tail call void @do_indirect_call(void ()* nonnull @my_handler)
+ tail call void @do_indirect_call(ptr nonnull @my_handler)
ret i32 0
}
target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-unknown-windows"
-define void @start(i8* %a, i8* %b) {
+define void @start(ptr %a, ptr %b) {
entry:
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 1024, i1 false)
+ call void @llvm.memcpy.p0.p0.i64(ptr %a, ptr %b, i64 1024, i1 false)
ret void
}
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1)
define void @main() {
entry:
%array4096 = alloca [4096 x i8]
- call void @foo([4096 x i8]* %array4096)
+ call void @foo(ptr %array4096)
ret void
}
-declare void @foo([4096 x i8]*)
+declare void @foo(ptr)
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.12.25835"
-define dllexport i8* @icf_ptr() {
+define dllexport ptr @icf_ptr() {
entry:
- ret i8* null
+ ret ptr null
}
define dllexport i64 @icf_int() {
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.11.0"
-define dso_local i32 @main(i32 %argc, i8** nocapture readnone %0) local_unnamed_addr {
+define dso_local i32 @main(i32 %argc, ptr nocapture readnone %0) local_unnamed_addr {
entry:
ret i32 %argc
}
; using floats.
@_fltused = dllexport global i32 0, align 4
-define void @foo(<4 x i32>* %p, <4 x float>* %q, i1 %t) nounwind {
+define void @foo(ptr %p, ptr %q, i1 %t) nounwind {
entry:
br label %loop
loop:
- store <4 x i32><i32 1073741824, i32 1073741824, i32 1073741824, i32 1073741824>, <4 x i32>* %p
- store <4 x float><float 2.0, float 2.0, float 2.0, float 2.0>, <4 x float>* %q
+ store <4 x i32><i32 1073741824, i32 1073741824, i32 1073741824, i32 1073741824>, ptr %p
+ store <4 x float><float 2.0, float 2.0, float 2.0, float 2.0>, ptr %q
br i1 %t, label %loop, label %ret
ret:
ret void
module asm "__tls_index = 1"
module asm "__tls_array = 2"
-define i8* @main() {
+define ptr @main() {
; CHECK: movl 1, %eax
; CHECK: movl %fs:2, %ecx
; CHECK: movl (%ecx,%eax,4), %eax
; CHECK: leal (%eax), %eax
- ret i8* @foo
+ ret ptr @foo
}
define dso_local i32 @main() #0 !dbg !9 {\r
%1 = alloca i32, align 4\r
%2 = alloca i8, align 1\r
- store i32 0, i32* %1, align 4\r
- call void @llvm.dbg.declare(metadata i8* %2, metadata !13, metadata !DIExpression()), !dbg !15\r
- store i8 0, i8* %2, align 1, !dbg !15\r
- %3 = load i8, i8* %2, align 1, !dbg !16\r
+ store i32 0, ptr %1, align 4\r
+ call void @llvm.dbg.declare(metadata ptr %2, metadata !13, metadata !DIExpression()), !dbg !15\r
+ store i8 0, ptr %2, align 1, !dbg !15\r
+ %3 = load i8, ptr %2, align 1, !dbg !16\r
%4 = zext i8 %3 to i32, !dbg !16\r
ret i32 %4, !dbg !16\r
}\r
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.0.24215"
-%"class.bar" = type { i32 (...)**, i8*, i8*, i8*, i32 }
+%"class.bar" = type { ptr, ptr, ptr, ptr, i32 }
define i32 @main() {
ret i32 0
}
-define available_externally zeroext i1 @"\01?x@bar@@UEBA_NXZ"(%"class.bar"* %this) unnamed_addr align 2 {
+define available_externally zeroext i1 @"\01?x@bar@@UEBA_NXZ"(ptr %this) unnamed_addr align 2 {
ret i1 false
}
@aligned_thread_local = thread_local global i32 42, align 32
define i32 @main() {
- %t = load i32, i32* @aligned_thread_local
+ %t = load i32, ptr @aligned_thread_local
ret i32 %t
}
@aligned_thread_local = thread_local global i32 42, align 64
define i32 @main() {
- %t = load i32, i32* @aligned_thread_local
+ %t = load i32, ptr @aligned_thread_local
ret i32 %t
}
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"
-@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to i8*)], section "llvm.metadata"
+@llvm.used = appending global [1 x ptr] [ptr @foo], section "llvm.metadata"
define void @foo() {
ret void
target triple = "x86_64-unknown-linux"
-@fn2 = global void()* null;
+@fn2 = global ptr null;
define dso_local i32 @bar(i32 signext %i) local_unnamed_addr {
entry:
%idxprom = sext i32 %i to i64
- %arrayidx = getelementptr inbounds [5 x i32], [5 x i32]* @block, i64 0, i64 %idxprom
- %0 = load i32, i32* %arrayidx, align 8
+ %arrayidx = getelementptr inbounds [5 x i32], ptr @block, i64 0, i64 %idxprom
+ %0 = load i32, ptr %arrayidx, align 8
ret i32 %0
}
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
-%struct.A = type { i32 (...)** }
+%struct.A = type { ptr }
-@_ZTV1A = unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !vcall_visibility !1
+@_ZTV1A = unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1A1fEi, ptr @_ZN1A1nEi] }, !type !0, !vcall_visibility !1
-define i32 @_ZN1A1fEi(%struct.A* %this, i32 %a) #0 {
+define i32 @_ZN1A1fEi(ptr %this, i32 %a) #0 {
ret i32 0;
}
-define i32 @_ZN1A1nEi(%struct.A* %this, i32 %a) #0 {
+define i32 @_ZN1A1nEi(ptr %this, i32 %a) #0 {
ret i32 0;
}
define i32 @foo(i32 %goo) {
entry:
%goo.addr = alloca i32, align 4
- store i32 %goo, i32* %goo.addr, align 4
- %0 = load i32, i32* %goo.addr, align 4
- %1 = load i32, i32* %goo.addr, align 4
+ store i32 %goo, ptr %goo.addr, align 4
+ %0 = load i32, ptr %goo.addr, align 4
+ %1 = load i32, ptr %goo.addr, align 4
%mul = mul nsw i32 %0, %1
ret i32 %mul
}
define i32 @blah(i32 %meh) #0 {
entry:
%meh.addr = alloca i32, align 4
- store i32 %meh, i32* %meh.addr, align 4
- %0 = load i32, i32* %meh.addr, align 4
+ store i32 %meh, ptr %meh.addr, align 4
+ %0 = load i32, ptr %meh.addr, align 4
%sub = sub nsw i32 %0, 48
ret i32 %sub
}
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
%zed = type { i16 }
-define void @bar(%zed* %this) {
- store %zed* %this, %zed** null
+define void @bar(ptr %this) {
+ store ptr %this, ptr null
ret void
}
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define weak_odr protected i32 @foo(i8* %this) {
+define weak_odr protected i32 @foo(ptr %this) {
ret i32 42
}
@blah = external global i8, align 1
-define i8* @_start() {
- ret i8* @blah
+define ptr @_start() {
+ ret ptr @blah
}
ret i32 0
}
-define void @dummy() optnone noinline personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @dummy() optnone noinline personality ptr @__gxx_personality_v0 {
invoke void @dummy() to label %cont unwind label %lpad
cont:
ret void
lpad:
- %lp = landingpad { i8*, i32 } cleanup
- resume { i8*, i32 } %lp
+ %lp = landingpad { ptr, i32 } cleanup
+ resume { ptr, i32 } %lp
}
@data = internal constant [0 x i32] []
-define i32* @_start() nounwind readonly {
+define ptr @_start() nounwind readonly {
entry:
; CHECK-SMALL-LABEL: <_start>:
; CHECK-SMALL: movl $2097440, %eax
; CHECK-LARGE-LABEL: <_start>:
; CHECK-LARGE: movabsq $2097440, %rax
- ret i32* getelementptr ([0 x i32], [0 x i32]* @data, i64 0, i64 0)
+ ret ptr @data
}
$__profc_foo = comdat nodeduplicate
@__profc_foo = private global i64 1, comdat, align 8
-@__profd_foo = private global i64* @__profc_foo, comdat($__profc_foo), align 8
+@__profd_foo = private global ptr @__profc_foo, comdat($__profc_foo), align 8
declare void @b()
define i64 @foo() {
- %v = load i64, i64* @__profc_foo
+ %v = load i64, ptr @__profc_foo
%inc = add i64 1, %v
- store i64 %inc, i64* @__profc_foo
+ store i64 %inc, ptr @__profc_foo
ret i64 %inc
}
$__profc_foo = comdat nodeduplicate
@__profc_foo = weak hidden global i64 2, comdat, align 8
-@__profd_foo = private global i64* @__profc_foo, comdat($__profc_foo)
+@__profd_foo = private global ptr @__profc_foo, comdat($__profc_foo)
define weak i64 @foo() {
- %v = load i64, i64* @__profc_foo
+ %v = load i64, ptr @__profc_foo
%inc = add i64 1, %v
- store i64 %inc, i64* @__profc_foo
+ store i64 %inc, ptr @__profc_foo
ret i64 %inc
}
$__profc_foo = comdat nodeduplicate
@__profc_foo = weak hidden global i64 3, comdat, align 8
-@__profd_foo = private global i64* @__profc_foo, comdat($__profc_foo)
+@__profd_foo = private global ptr @__profc_foo, comdat($__profc_foo)
define weak i64 @foo() {
- %v = load i64, i64* @__profc_foo
+ %v = load i64, ptr @__profc_foo
%inc = add i64 1, %v
- store i64 %inc, i64* @__profc_foo
+ store i64 %inc, ptr @__profc_foo
ret i64 %inc
}
@b = common hidden global i32 0, align 4
define i32 @f() {
- %t = load i32, i32* @b, align 4
+ %t = load i32, ptr @b, align 4
ret i32 %t
}
; CHECK-DAG: @b = internal global i32 0, align 4
target triple = "x86_64-unknown-linux-gnu"
@a = common hidden global i32 0, align 8
define i32 @f() {
- %t = load i32, i32* @a, align 4
+ %t = load i32, ptr @a, align 4
ret i32 %t
}
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
+@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @ctor, ptr null }]
define void @ctor() {
call void asm "nop", ""()
ret void
target triple = "x86_64-unknown-linux-gnu"
%struct.Cat = type { %struct.Animal }
-%struct.Animal = type { i32 (...)** }
+%struct.Animal = type { ptr }
$_ZTS6Animal = comdat any
$_ZTI6Animal = comdat any
@.str = private unnamed_addr constant [5 x i8] c"Meow\00", align 1
-@_ZTV3Cat = dso_local unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI3Cat to i8*), i8* bitcast (void (%struct.Cat*)* @_ZNK3Cat9makeNoiseEv to i8*)] }, align 8, !type !0, !type !1, !type !2, !type !3
-@_ZTVN10__cxxabiv120__si_class_type_infoE = external dso_local global i8*
+@_ZTV3Cat = dso_local unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI3Cat, ptr @_ZNK3Cat9makeNoiseEv] }, align 8, !type !0, !type !1, !type !2, !type !3
+@_ZTVN10__cxxabiv120__si_class_type_infoE = external dso_local global ptr
@_ZTS3Cat = dso_local constant [5 x i8] c"3Cat\00", align 1
-@_ZTVN10__cxxabiv117__class_type_infoE = external dso_local global i8*
+@_ZTVN10__cxxabiv117__class_type_infoE = external dso_local global ptr
@_ZTS6Animal = linkonce_odr dso_local constant [8 x i8] c"6Animal\00", comdat, align 1
-@_ZTI6Animal = linkonce_odr dso_local constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @_ZTS6Animal, i32 0, i32 0) }, comdat, align 8
-@_ZTI3Cat = dso_local constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @_ZTS3Cat, i32 0, i32 0), i8* bitcast ({ i8*, i8* }* @_ZTI6Animal to i8*) }, align 8
+@_ZTI6Animal = linkonce_odr dso_local constant { ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i64 2), ptr @_ZTS6Animal }, comdat, align 8
+@_ZTI3Cat = dso_local constant { ptr, ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2), ptr @_ZTS3Cat, ptr @_ZTI6Animal }, align 8
-define dso_local void @_ZNK3Cat9makeNoiseEv(%struct.Cat* nocapture nonnull readnone dereferenceable(8) %this) unnamed_addr align 2 {
+define dso_local void @_ZNK3Cat9makeNoiseEv(ptr nocapture nonnull readnone dereferenceable(8) %this) unnamed_addr align 2 {
entry:
- %call = tail call i32 @puts(i8* nonnull dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
+ %call = tail call i32 @puts(ptr nonnull dereferenceable(1) @.str)
ret void
}
-declare dso_local noundef i32 @puts(i8* nocapture noundef readonly) local_unnamed_addr
+declare dso_local noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr
-define dso_local void @_Z14doThingWithCatP6Animal(%struct.Animal* %a) local_unnamed_addr {
+define dso_local void @_Z14doThingWithCatP6Animal(ptr %a) local_unnamed_addr {
entry:
- %tobool.not = icmp eq %struct.Animal* %a, null
+ %tobool.not = icmp eq ptr %a, null
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %entry
- %0 = bitcast %struct.Animal* %a to %struct.Cat*
- %1 = bitcast %struct.Animal* %a to void (%struct.Cat*)***
- %vtable = load void (%struct.Cat*)**, void (%struct.Cat*)*** %1, align 8, !tbaa !4
- %2 = bitcast void (%struct.Cat*)** %vtable to i8*
- %3 = tail call i1 @llvm.type.test(i8* %2, metadata !"_ZTS3Cat")
- tail call void @llvm.assume(i1 %3)
- %4 = load void (%struct.Cat*)*, void (%struct.Cat*)** %vtable, align 8
- tail call void %4(%struct.Cat* nonnull dereferenceable(8) %0)
+ %vtable = load ptr, ptr %a, align 8, !tbaa !4
+ %0 = tail call i1 @llvm.type.test(ptr %vtable, metadata !"_ZTS3Cat")
+ tail call void @llvm.assume(i1 %0)
+ %1 = load ptr, ptr %vtable, align 8
+ tail call void %1(ptr nonnull dereferenceable(8) %a)
br label %if.end
if.end: ; preds = %if.then, %entry
ret void
}
-declare i1 @llvm.type.test(i8*, metadata)
+declare i1 @llvm.type.test(ptr, metadata)
declare void @llvm.assume(i1 noundef)
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-%struct.Animal = type { i32 (...)** }
+%struct.Animal = type { ptr }
%struct.Cat = type { %struct.Animal }
-@_ZTV3Cat = available_externally dso_local unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast (i8** @_ZTI3Cat to i8*), i8* bitcast (void (%struct.Cat*)* @_ZNK3Cat9makeNoiseEv to i8*)] }, align 8, !type !0, !type !1, !type !2, !type !3
-@_ZTI3Cat = external dso_local constant i8*
-@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast ({ [3 x i8*] }* @_ZTV3Cat to i8*)], section "llvm.metadata"
+@_ZTV3Cat = available_externally dso_local unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI3Cat, ptr @_ZNK3Cat9makeNoiseEv] }, align 8, !type !0, !type !1, !type !2, !type !3
+@_ZTI3Cat = external dso_local constant ptr
+@llvm.compiler.used = appending global [1 x ptr] [ptr @_ZTV3Cat], section "llvm.metadata"
-declare dso_local void @_ZNK3Cat9makeNoiseEv(%struct.Cat* nonnull dereferenceable(8)) unnamed_addr
+declare dso_local void @_ZNK3Cat9makeNoiseEv(ptr nonnull dereferenceable(8)) unnamed_addr
define dso_local void @_Z17useDoThingWithCatv() local_unnamed_addr {
entry:
- %call = tail call noalias nonnull dereferenceable(8) i8* @_Znwm(i64 8)
- %0 = bitcast i8* %call to i32 (...)***
- store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTV3Cat, i64 0, inrange i32 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8, !tbaa !4
- %1 = bitcast i8* %call to %struct.Animal*
- tail call void @_Z14doThingWithCatP6Animal(%struct.Animal* nonnull %1)
+ %call = tail call noalias nonnull dereferenceable(8) ptr @_Znwm(i64 8)
+ store ptr getelementptr inbounds ({ [3 x ptr] }, ptr @_ZTV3Cat, i64 0, inrange i32 0, i64 2), ptr %call, align 8, !tbaa !4
+ tail call void @_Z14doThingWithCatP6Animal(ptr nonnull %call)
ret void
}
-declare dso_local nonnull i8* @_Znwm(i64) local_unnamed_addr
+declare dso_local nonnull ptr @_Znwm(i64) local_unnamed_addr
-declare dso_local void @_Z14doThingWithCatP6Animal(%struct.Animal*) local_unnamed_addr
+declare dso_local void @_Z14doThingWithCatP6Animal(ptr) local_unnamed_addr
!0 = !{i64 16, !"_ZTS3Cat"}
!1 = !{i64 16, !"_ZTSM3CatKFvvE.virtual"}
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
-%struct.A = type { i32 (...)** }
+%struct.A = type { ptr }
%struct.B = type { %struct.A }
%struct.C = type { %struct.A }
-%struct.D = type { i32 (...)** }
+%struct.D = type { ptr }
-@_ZTV1B = linkonce_odr unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.B*, i32)* @_ZN1B1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !type !1, !vcall_visibility !5
-@_ZTV1C = linkonce_odr unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.C*, i32)* @_ZN1C1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !type !2, !vcall_visibility !5
-@_ZTV1D = linkonce_odr unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.D*, i32)* @_ZN1D1mEi to i8*)] }, !type !3, !vcall_visibility !5
+@_ZTV1B = linkonce_odr unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1B1fEi, ptr @_ZN1A1nEi] }, !type !0, !type !1, !vcall_visibility !5
+@_ZTV1C = linkonce_odr unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1C1fEi, ptr @_ZN1A1nEi] }, !type !0, !type !2, !vcall_visibility !5
+@_ZTV1D = linkonce_odr unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr undef, ptr @_ZN1D1mEi] }, !type !3, !vcall_visibility !5
;; Prevent the vtables from being dead code eliminated.
-@llvm.used = appending global [3 x i8*] [ i8* bitcast ( { [4 x i8*] }* @_ZTV1B to i8*), i8* bitcast ( { [4 x i8*] }* @_ZTV1C to i8*), i8* bitcast ( { [3 x i8*] }* @_ZTV1D to i8*)]
+@llvm.used = appending global [3 x ptr] [ ptr @_ZTV1B, ptr @_ZTV1C, ptr @_ZTV1D]
; CHECK-IR-LABEL: define dso_local i32 @_start
-define i32 @_start(%struct.A* %obj, %struct.D* %obj2, i32 %a) {
+define i32 @_start(ptr %obj, ptr %obj2, i32 %a) {
entry:
- %0 = bitcast %struct.A* %obj to i8***
- %vtable = load i8**, i8*** %0
- %1 = bitcast i8** %vtable to i8*
- %p = call i1 @llvm.type.test(i8* %1, metadata !"_ZTS1A")
+ %vtable = load ptr, ptr %obj
+ %p = call i1 @llvm.type.test(ptr %vtable, metadata !"_ZTS1A")
call void @llvm.assume(i1 %p)
- %fptrptr = getelementptr i8*, i8** %vtable, i32 1
- %2 = bitcast i8** %fptrptr to i32 (%struct.A*, i32)**
- %fptr1 = load i32 (%struct.A*, i32)*, i32 (%struct.A*, i32)** %2, align 8
+ %fptrptr = getelementptr ptr, ptr %vtable, i32 1
+ %fptr1 = load ptr, ptr %fptrptr, align 8
;; Check that the call was devirtualized.
; CHECK-IR: %call = tail call i32 @_ZN1A1nEi
; CHECK-AONLY-IR: %call = tail call i32 @_ZN1A1nEi
; CHECK-NODEVIRT-IR: %call = tail call i32 %fptr1
- %call = tail call i32 %fptr1(%struct.A* nonnull %obj, i32 %a)
+ %call = tail call i32 %fptr1(ptr nonnull %obj, i32 %a)
- %3 = bitcast i8** %vtable to i32 (%struct.A*, i32)**
- %fptr22 = load i32 (%struct.A*, i32)*, i32 (%struct.A*, i32)** %3, align 8
+ %fptr22 = load ptr, ptr %vtable, align 8
;; We still have to call it as virtual.
; CHECK-IR: %call3 = tail call i32 %fptr22
; CHECK-AONLY-IR: %call3 = tail call i32 %fptr22
; CHECK-NODEVIRT-IR: %call3 = tail call i32 %fptr22
- %call3 = tail call i32 %fptr22(%struct.A* nonnull %obj, i32 %call)
+ %call3 = tail call i32 %fptr22(ptr nonnull %obj, i32 %call)
- %4 = bitcast %struct.D* %obj2 to i8***
- %vtable2 = load i8**, i8*** %4
- %5 = bitcast i8** %vtable2 to i8*
- %p2 = call i1 @llvm.type.test(i8* %5, metadata !4)
+ %vtable2 = load ptr, ptr %obj2
+ %p2 = call i1 @llvm.type.test(ptr %vtable2, metadata !4)
call void @llvm.assume(i1 %p2)
- %6 = bitcast i8** %vtable2 to i32 (%struct.D*, i32)**
- %fptr33 = load i32 (%struct.D*, i32)*, i32 (%struct.D*, i32)** %6, align 8
+ %fptr33 = load ptr, ptr %vtable2, align 8
;; Check that the call was devirtualized.
; CHECK-IR: %call4 = tail call i32 @_ZN1D1mEi
; CHECK-AONLY-IR: %call4 = tail call i32 %fptr33
; CHECK-NODEVIRT-IR: %call4 = tail call i32 %fptr33
- %call4 = tail call i32 %fptr33(%struct.D* nonnull %obj2, i32 %call3)
+ %call4 = tail call i32 %fptr33(ptr nonnull %obj2, i32 %call3)
ret i32 %call4
}
; CHECK-IR-LABEL: ret i32
; CHECK-IR-LABEL: }
-declare i1 @llvm.type.test(i8*, metadata)
+declare i1 @llvm.type.test(ptr, metadata)
declare void @llvm.assume(i1)
-define i32 @_ZN1B1fEi(%struct.B* %this, i32 %a) #0 {
+define i32 @_ZN1B1fEi(ptr %this, i32 %a) #0 {
ret i32 0;
}
-define i32 @_ZN1A1nEi(%struct.A* %this, i32 %a) #0 {
+define i32 @_ZN1A1nEi(ptr %this, i32 %a) #0 {
ret i32 0;
}
-define i32 @_ZN1C1fEi(%struct.C* %this, i32 %a) #0 {
+define i32 @_ZN1C1fEi(ptr %this, i32 %a) #0 {
ret i32 0;
}
-define i32 @_ZN1D1mEi(%struct.D* %this, i32 %a) #0 {
+define i32 @_ZN1D1mEi(ptr %this, i32 %a) #0 {
ret i32 0;
}
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
-%struct.A = type { i32 (...)** }
+%struct.A = type { ptr }
%struct.B = type { %struct.A }
-@_ZTV1A = available_externally unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !vcall_visibility !2
-@_ZTV1B = linkonce_odr unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.B*, i32)* @_ZN1B1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !type !1, !vcall_visibility !2
+@_ZTV1A = available_externally unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1A1fEi, ptr @_ZN1A1nEi] }, !type !0, !vcall_visibility !2
+@_ZTV1B = linkonce_odr unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1B1fEi, ptr @_ZN1A1nEi] }, !type !0, !type !1, !vcall_visibility !2
;; Prevent the vtables from being dead code eliminated.
-@llvm.used = appending global [2 x i8*] [ i8* bitcast ( { [4 x i8*] }* @_ZTV1A to i8*), i8* bitcast ( { [4 x i8*] }* @_ZTV1B to i8*)]
+@llvm.used = appending global [2 x ptr] [ ptr @_ZTV1A, ptr @_ZTV1B]
; CHECK-IR-LABEL: @_start(
-define i32 @_start(%struct.A* %obj, i32 %a) {
+define i32 @_start(ptr %obj, i32 %a) {
entry:
- %0 = bitcast %struct.A* %obj to i8***
- %vtable = load i8**, i8*** %0
- %1 = bitcast i8** %vtable to i8*
- %p = call i1 @llvm.type.test(i8* %1, metadata !"_ZTS1A")
+ %vtable = load ptr, ptr %obj
+ %p = call i1 @llvm.type.test(ptr %vtable, metadata !"_ZTS1A")
call void @llvm.assume(i1 %p)
- %fptrptr = getelementptr i8*, i8** %vtable, i32 1
- %2 = bitcast i8** %fptrptr to i32 (%struct.A*, i32)**
- %fptr1 = load i32 (%struct.A*, i32)*, i32 (%struct.A*, i32)** %2, align 8
+ %fptrptr = getelementptr ptr, ptr %vtable, i32 1
+ %fptr1 = load ptr, ptr %fptrptr, align 8
;; Check that the call was devirtualized.
; CHECK-IR: %call = tail call i32 @_ZN1A1nEi
- %call = tail call i32 %fptr1(%struct.A* nonnull %obj, i32 %a)
+ %call = tail call i32 %fptr1(ptr nonnull %obj, i32 %a)
ret i32 %call
}
; CHECK-IR-LABEL: ret i32
; CHECK-IR-LABEL: }
-declare i1 @llvm.type.test(i8*, metadata)
+declare i1 @llvm.type.test(ptr, metadata)
declare void @llvm.assume(i1)
-define available_externally i32 @_ZN1A1fEi(%struct.A* %this, i32 %a) #0 {
+define available_externally i32 @_ZN1A1fEi(ptr %this, i32 %a) #0 {
ret i32 0
}
-define available_externally i32 @_ZN1A1nEi(%struct.A* %this, i32 %a) #0 {
+define available_externally i32 @_ZN1A1nEi(ptr %this, i32 %a) #0 {
ret i32 0
}
-define linkonce_odr i32 @_ZN1B1fEi(%struct.B* %this, i32 %a) #0 {
+define linkonce_odr i32 @_ZN1B1fEi(ptr %this, i32 %a) #0 {
ret i32 0
}
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
-%struct.A = type { i32 (...)** }
+%struct.A = type { ptr }
%struct.B = type { %struct.A }
-@_ZTV1A = available_externally unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !vcall_visibility !2
-@_ZTV1B = linkonce_odr unnamed_addr constant { [4 x i8*] } { [4 x i8*] [i8* null, i8* undef, i8* bitcast (i32 (%struct.B*, i32)* @_ZN1B1fEi to i8*), i8* bitcast (i32 (%struct.A*, i32)* @_ZN1A1nEi to i8*)] }, !type !0, !type !1, !vcall_visibility !2
+@_ZTV1A = available_externally unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1A1fEi, ptr @_ZN1A1nEi] }, !type !0, !vcall_visibility !2
+@_ZTV1B = linkonce_odr unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1B1fEi, ptr @_ZN1A1nEi] }, !type !0, !type !1, !vcall_visibility !2
;; Prevent the vtables from being dead code eliminated.
-@llvm.used = appending global [2 x i8*] [ i8* bitcast ( { [4 x i8*] }* @_ZTV1A to i8*), i8* bitcast ( { [4 x i8*] }* @_ZTV1B to i8*)]
+@llvm.used = appending global [2 x ptr] [ ptr @_ZTV1A, ptr @_ZTV1B]
; CHECK-IR-LABEL: define dso_local i32 @_start
-define i32 @_start(%struct.A* %obj, i32 %a) {
+define i32 @_start(ptr %obj, i32 %a) {
entry:
- %0 = bitcast %struct.A* %obj to i8***
- %vtable = load i8**, i8*** %0
- %1 = bitcast i8** %vtable to i8*
- %p = call i1 @llvm.type.test(i8* %1, metadata !"_ZTS1A")
+ %vtable = load ptr, ptr %obj
+ %p = call i1 @llvm.type.test(ptr %vtable, metadata !"_ZTS1A")
call void @llvm.assume(i1 %p)
- %fptrptr = getelementptr i8*, i8** %vtable, i32 1
- %2 = bitcast i8** %fptrptr to i32 (%struct.A*, i32)**
- %fptr1 = load i32 (%struct.A*, i32)*, i32 (%struct.A*, i32)** %2, align 8
+ %fptrptr = getelementptr ptr, ptr %vtable, i32 1
+ %fptr1 = load ptr, ptr %fptrptr, align 8
;; Check that the call was devirtualized.
; CHECK-IR: %call = tail call i32 @_ZN1A1nEi
; CHECK-NODEVIRT-IR: %call = tail call i32 %fptr1
- %call = tail call i32 %fptr1(%struct.A* nonnull %obj, i32 %a)
+ %call = tail call i32 %fptr1(ptr nonnull %obj, i32 %a)
ret i32 %call
}
; CHECK-IR-LABEL: ret i32
; CHECK-IR-LABEL: }
-declare i1 @llvm.type.test(i8*, metadata)
+declare i1 @llvm.type.test(ptr, metadata)
declare void @llvm.assume(i1)
-define available_externally i32 @_ZN1A1fEi(%struct.A* %this, i32 %a) #0 {
+define available_externally i32 @_ZN1A1fEi(ptr %this, i32 %a) #0 {
ret i32 0
}
-define available_externally i32 @_ZN1A1nEi(%struct.A* %this, i32 %a) #0 {
+define available_externally i32 @_ZN1A1nEi(ptr %this, i32 %a) #0 {
ret i32 0
}
-define linkonce_odr i32 @_ZN1B1fEi(%struct.B* %this, i32 %a) #0 {
+define linkonce_odr i32 @_ZN1B1fEi(ptr %this, i32 %a) #0 {
ret i32 0
}
define i32 @foo(i32 %in) {
somelabel:
- %GV = load i32, i32* @GlobalValueName
+ %GV = load i32, ptr @GlobalValueName
%add = add i32 %in, %GV
ret i32 %add
}
ret void
}
-@use_baz = global void ()* @baz
+@use_baz = global ptr @baz
; Check what gets internalized.
; CHECK: define dso_local void @_start()
ret void
}
-@llvm.used = appending global [1 x i8*] [ i8* bitcast (void ()* @f to i8*)]
+@llvm.used = appending global [1 x ptr] [ ptr @f]
; Check that f is not internalized.
; CHECK: define hidden void @f()
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define void @_start(i8* %a, i8* %b) {
+define void @_start(ptr %a, ptr %b) {
entry:
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 1024, i1 false)
+ call void @llvm.memcpy.p0.p0.i64(ptr %a, ptr %b, i64 1024, i1 false)
ret void
}
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1)
@.str = private unnamed_addr constant [4 x i8] c"Hey\00", align 1
; Should not encounter a duplicate symbol error for @llvm.global_ctors
-@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
+@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @ctor, ptr null }]
define internal void @ctor() {
ret void
}
; REQUIRES: x86
; RUN: llvm-as %s -o %t.o
-; RUN: rm -f %t2.*
+; RUN: rm -f ptr
; RUN: echo "foo = 1;" > %t.script
; RUN: ld.lld %t.o -o %t2 --script %t.script -save-temps
;; Combined module is not empty, but it will be empty after optimization.
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
+@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @ctor, ptr null }]
define void @ctor() {
ret void
}
target triple = "x86_64-unknown-linux-gnu"
@junk = global i32 0
-define i32* @somefunk() {
- ret i32* @junk
+define ptr @somefunk() {
+ ret ptr @junk
}
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define weak void @foo(i32* %p) {
- store i32 5, i32* %p, align 4, !tbaa !0
+define weak void @foo(ptr %p) {
+ store i32 5, ptr %p, align 4, !tbaa !0
ret void
}
@g = dso_local global i32 3, align 4
-define void @foo(void (i32)* %f) !dbg !4 {
+define void @foo(ptr %f) !dbg !4 {
entry:
; CHECK: .pseudoprobe [[#GUID:]] 1 0 0
; CHECK: .pseudoprobe [[#GUID]] 2 1 0
call void %f(i32 1), !dbg !13
- %0 = load i32, i32* @g, align 4
+ %0 = load i32, ptr @g, align 4
%inc = add nsw i32 %0, 1
- store i32 %inc, i32* @g, align 4
+ store i32 %inc, ptr @g, align 4
ret void
}
@foo = external global i32
define i32 @bar() {
- %t = load i32, i32* @foo
+ %t = load i32, ptr @foo
ret i32 %t
}
@foo = external global i32
define i32 @main() {
- %t = load i32, i32* @foo
+ %t = load i32, ptr @foo
ret i32 %t
}
@foo = external dso_local global i32
define i32 @main() {
- %t = load i32, i32* @foo
+ %t = load i32, ptr @foo
ret i32 %t
}
@__start_foo_section = external global i32
@__stop_bar_section = external global i32
-define hidden i32* @use1() {
- ret i32* @__start_foo_section
+define hidden ptr @use1() {
+ ret ptr @__start_foo_section
}
-define i32* @use2() {
- ret i32* @__stop_bar_section
+define ptr @use2() {
+ ret ptr @__stop_bar_section
}
; CHECK-NOT: zed_section
target triple = "x86_64-unknown-linux-gnu"
@foobar = external hidden global i32
-define i32* @_start() {
- ret i32* @foobar
+define ptr @_start() {
+ ret ptr @foobar
}
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define i32 @foo(i32* %a) {
+define i32 @foo(ptr %a) {
entry:
br label %for.body
for.body:
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%red.05 = phi i32 [ 0, %entry ], [ %add, %for.body ]
- %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
- %0 = load i32, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
+ %0 = load i32, ptr %arrayidx, align 4
%add = add nsw i32 %0, %red.05
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp eq i64 %indvars.iv.next, 255
@tsp_int = thread_local global i32 1
define void @_start() {
- %val = load i32, i32* @tsp_int
+ %val = load i32, ptr @tsp_int
ret void
}
target triple = "x86_64-unknown-linux-gnu"
define void @foo() {
- call void @bar(i8* null)
+ call void @bar(ptr null)
ret void
}
-declare void @bar(i8*)
+declare void @bar(ptr)
; CHECK: define void @foo() {
; CHECK-NEXT: call void @bar(ptr null)
%zed = type { i8 }
define void @foo() {
- call void @bar(%zed* null)
+ call void @bar(ptr null)
ret void
}
-declare void @bar(%zed*)
+declare void @bar(ptr)
; CHECK: define void @foo() {
; CHECK-NEXT: call void @bar(ptr null)
@.str = private unnamed_addr constant [6 x i8] c"blah\0A\00", align 1
define i32 @_start() {
- %str = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0))
+ %str = call i32 (ptr, ...) @printf(ptr @.str)
ret i32 0
}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
; Check that puts symbol is present in the dynamic symbol table and
; there's a relocation for it.
@a = internal unnamed_addr constant i8 42
-define i8* @f() {
- ret i8* @a
+define ptr @f() {
+ ret ptr @a
}
; CHECK: @a = internal unnamed_addr constant i8 42
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define weak_odr i32 @foo(i8* %this) {
+define weak_odr i32 @foo(ptr %this) {
ret i32 41
}
#--- resume.ll
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define dso_local void @_Z1fv() optnone noinline personality i8* bitcast (void ()* @throw to i8*) {
+define dso_local void @_Z1fv() optnone noinline personality ptr @throw {
invoke void @throw()
to label %unreachable unwind label %lpad
lpad:
- %1 = landingpad { i8*, i32 }
+ %1 = landingpad { ptr, i32 }
cleanup
- resume { i8*, i32 } %1
+ resume { ptr, i32 } %1
unreachable:
unreachable
}
declare void @_CFBigNumGetInt128(...)
define void @main() {
- call void bitcast (void (...)* @_CFBigNumGetInt128 to void ()*)()
+ call void @_CFBigNumGetInt128()
ret void
}
!llvm.linker.options = !{!0, !0, !1}
declare void @_CFBigNumGetInt128(...)
-declare i8* @__cxa_allocate_exception(i64)
+declare ptr @__cxa_allocate_exception(i64)
define void @main() {
- call void bitcast (void (...)* @_CFBigNumGetInt128 to void ()*)()
- call i8* @__cxa_allocate_exception(i64 4)
+ call void @_CFBigNumGetInt128()
+ call ptr @__cxa_allocate_exception(i64 4)
ret void
}
@"_OBJC_$_CATEGORY_Foo_$_Bar" = internal global %struct._category_t { i8 123 },
section "__DATA, __objc_const", align 8
-@"OBJC_LABEL_CATEGORY_$" = private global [1 x i8*] [
- i8* bitcast (%struct._category_t* @"_OBJC_$_CATEGORY_Foo_$_Bar" to i8*)
+@"OBJC_LABEL_CATEGORY_$" = private global [1 x ptr] [
+ ptr @"_OBJC_$_CATEGORY_Foo_$_Bar"
], section "__DATA,__objc_catlist,regular,no_dead_strip", align 8
-@llvm.compiler.used = appending global [1 x i8*] [
- i8* bitcast ([1 x i8*]* @"OBJC_LABEL_CATEGORY_$" to i8*)
+@llvm.compiler.used = appending global [1 x ptr] [
+ ptr @"OBJC_LABEL_CATEGORY_$"
], section "llvm.metadata"
;--- main.s
@data = internal constant [0 x i32] []
-define i32* @main() nounwind readonly {
+define ptr @main() nounwind readonly {
entry:
; CHECK-SMALL-LABEL: <_main>:
; CHECK-SMALL: leaq [[#]](%rip), %rax
; CHECK-LARGE-LABEL: <_main>:
; CHECK-LARGE: movabsq $[[#]], %rax
- ret i32* getelementptr ([0 x i32], [0 x i32]* @data, i64 0, i64 0)
+ ret ptr @data
}
@foo = external global i8
define void @f() {
- %1 = load i8, i8* @foo
+ %1 = load i8, ptr @foo
ret void
}
@local_unnamed_always_const = linkonce_odr local_unnamed_addr constant i8 42
@local_unnamed_sometimes_const = linkonce_odr local_unnamed_addr constant i8 42
@local_unnamed = linkonce_odr local_unnamed_addr global i8 42
-@used = hidden constant [6 x i8*] [i8* @global_unnamed,
- i8* @global_unnamed_sometimes_linkonce, i8* @local_unnamed,
- i8* @local_unnamed_const, i8* @local_unnamed_always_const,
- i8* @local_unnamed_sometimes_const]
-@llvm.used = appending global [1 x [6 x i8*]*] [[6 x i8*]* @used]
+@used = hidden constant [6 x ptr] [ptr @global_unnamed,
+ ptr @global_unnamed_sometimes_linkonce, ptr @local_unnamed,
+ ptr @local_unnamed_const, ptr @local_unnamed_always_const,
+ ptr @local_unnamed_sometimes_const]
+@llvm.used = appending global [1 x ptr] [ptr @used]
define void @main() {
ret void
target triple = "x86_64-apple-darwin"
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
-define void @foo(i8* %a, i8* %b) {
- call void (...) @llvm.objc.clang.arc.use(i8* %a, i8* %b) nounwind
+define void @foo(ptr %a, ptr %b) {
+ call void (...) @llvm.objc.clang.arc.use(ptr %a, ptr %b) nounwind
ret void
}
@constantData = constant [3 x i8] c"abc", comdat($foo)
define i32 @comdatFn() comdat($foo) {
- ret i32 ptrtoint ([3 x i8]* @constantData to i32)
+ ret i32 ptrtoint (ptr @constantData to i32)
}
define internal void @do_init() comdat($foo) {
ret void
}
-%0 = type { i32, void ()*, i8* }
-@llvm.global_ctors = appending global [1 x %0 ] [%0 { i32 65535, void ()* @do_init, i8* null }]
+%0 = type { i32, ptr, ptr }
+@llvm.global_ctors = appending global [1 x %0 ] [%0 { i32 65535, ptr @do_init, ptr null }]
; Everything above this is part of the `foo` comdat group
define i32 @callComdatFn1() {
- ret i32 ptrtoint (i32 ()* @comdatFn to i32)
+ ret i32 ptrtoint (ptr @comdatFn to i32)
}
@constantData = constant [3 x i8] c"abc", comdat($foo)
define i32 @comdatFn() comdat($foo) {
- ret i32 ptrtoint ([3 x i8]* @constantData to i32)
+ ret i32 ptrtoint (ptr @constantData to i32)
}
define internal void @do_init() comdat($foo) {
ret void
}
-%0 = type { i32, void ()*, i8* }
-@llvm.global_ctors = appending global [1 x %0] [ %0 { i32 65535, void ()* @do_init, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @constantData, i32 0, i32 0) }]
+%0 = type { i32, ptr, ptr }
+@llvm.global_ctors = appending global [1 x %0] [ %0 { i32 65535, ptr @do_init, ptr @constantData }]
; Everything above this is part of the `foo` comdat group
define i32 @callComdatFn2() {
- ret i32 ptrtoint (i32 ()* @comdatFn to i32)
+ ret i32 ptrtoint (ptr @comdatFn to i32)
}
entry:
call void @llvm.dbg.value(metadata i32 %p, metadata !20, metadata !DIExpression()), !dbg !21
%and = and i32 %p, 1, !dbg !22
- %arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* @y, i32 0, i32 %and, !dbg !23
- %0 = load i32, i32* %arrayidx, align 4, !dbg !24, !tbaa !25
+ %arrayidx = getelementptr inbounds [2 x i32], ptr @y, i32 0, i32 %and, !dbg !23
+ %0 = load i32, ptr %arrayidx, align 4, !dbg !24, !tbaa !25
%inc = add nsw i32 %0, 1, !dbg !24
- store i32 %inc, i32* %arrayidx, align 4, !dbg !24, !tbaa !25
+ store i32 %inc, ptr %arrayidx, align 4, !dbg !24, !tbaa !25
ret void, !dbg !29
}
ret void
}
-@llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [
- { i32, void ()*, i8* } { i32 2002, void ()* @myctor, i8* null },
- { i32, void ()*, i8* } { i32 101, void ()* @myctor, i8* null },
- { i32, void ()*, i8* } { i32 202, void ()* @myctor, i8* null }
+@llvm.global_ctors = appending global [3 x { i32, ptr, ptr }] [
+ { i32, ptr, ptr } { i32 2002, ptr @myctor, ptr null },
+ { i32, ptr, ptr } { i32 101, ptr @myctor, ptr null },
+ { i32, ptr, ptr } { i32 202, ptr @myctor, ptr null }
]
-@llvm.global_dtors = appending global [3 x { i32, void ()*, i8* }] [
- { i32, void ()*, i8* } { i32 2002, void ()* @mydtor, i8* null },
- { i32, void ()*, i8* } { i32 101, void ()* @mydtor, i8* null },
- { i32, void ()*, i8* } { i32 202, void ()* @mydtor, i8* null }
+@llvm.global_dtors = appending global [3 x { i32, ptr, ptr }] [
+ { i32, ptr, ptr } { i32 2002, ptr @mydtor, ptr null },
+ { i32, ptr, ptr } { i32 101, ptr @mydtor, ptr null },
+ { i32, ptr, ptr } { i32 202, ptr @mydtor, ptr null }
]
}
-define i32* @get_global1A() {
+define ptr @get_global1A() {
entry:
- ret i32* @colliding_global1
+ ret ptr @colliding_global1
}
-define i32* @get_global2A() {
+define ptr @get_global2A() {
entry:
- ret i32* @colliding_global2
+ ret ptr @colliding_global2
}
-define i32* @get_global3A() {
+define ptr @get_global3A() {
entry:
- ret i32* @colliding_global3
+ ret ptr @colliding_global3
}
-define i32 ()* @get_func1A() {
+define ptr @get_func1A() {
entry:
- ret i32 ()* @colliding_func1
+ ret ptr @colliding_func1
}
-define i32 ()* @get_func2A() {
+define ptr @get_func2A() {
entry:
- ret i32 ()* @colliding_func2
+ ret ptr @colliding_func2
}
-define i32 ()* @get_func3A() {
+define ptr @get_func3A() {
entry:
- ret i32 ()* @colliding_func3
+ ret ptr @colliding_func3
}
}
-define i32* @get_global1B() {
+define ptr @get_global1B() {
entry:
- ret i32* @colliding_global1
+ ret ptr @colliding_global1
}
-define i32* @get_global2B() {
+define ptr @get_global2B() {
entry:
- ret i32* @colliding_global2
+ ret ptr @colliding_global2
}
-define i32* @get_global3B() {
+define ptr @get_global3B() {
entry:
- ret i32* @colliding_global3
+ ret ptr @colliding_global3
}
-define i32 ()* @get_func1B() {
+define ptr @get_func1B() {
entry:
- ret i32 ()* @colliding_func1
+ ret ptr @colliding_func1
}
-define i32 ()* @get_func2B() {
+define ptr @get_func2B() {
entry:
- ret i32 ()* @colliding_func2
+ ret ptr @colliding_func2
}
-define i32 ()* @get_func3B() {
+define ptr @get_func3B() {
entry:
- ret i32 ()* @colliding_func3
+ ret ptr @colliding_func3
}
define i32 @f1() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f2() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f3() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f4() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f5() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f6() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f7() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f8() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f9() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f10() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f11() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f12() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f13() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f14() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f15() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f16() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f17() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f18() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f19() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f20() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f21() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f22() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f23() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f24() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f25() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f26() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f27() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f28() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f29() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f30() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f31() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f32() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f33() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f34() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f35() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f36() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f37() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f38() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f39() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f40() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f41() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f42() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f43() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f44() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f45() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f46() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f47() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f48() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f49() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f50() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f51() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f52() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f53() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f54() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f55() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f56() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f57() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f58() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f59() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f60() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f61() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f62() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f63() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f64() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f65() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f66() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f67() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f68() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f69() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f70() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f71() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f72() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f73() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f74() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f75() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f76() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f77() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f78() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f79() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f80() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f81() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f82() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f83() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f84() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f85() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f86() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f87() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f88() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f89() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f90() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f91() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f92() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f93() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f94() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f95() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f96() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f97() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f98() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f99() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f100() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f101() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f102() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f103() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f104() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f105() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f106() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f107() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f108() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f109() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f110() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f111() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f112() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f113() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f114() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f115() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f116() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f117() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f118() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f119() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f120() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f121() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f122() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f123() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f124() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f125() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f126() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f127() {
entry:
- %0 = load i32, i32* @foo, align 4
+ %0 = load i32, ptr @foo, align 4
ret i32 %0
}
define i32 @f128() {
entry:
- %0 = load i32, i32* @g0, align 4
+ %0 = load i32, ptr @g0, align 4
ret i32 %0
}
define i32 @f129() {
entry:
- %0 = load i32, i32* @g0, align 4
+ %0 = load i32, ptr @g0, align 4
ret i32 %0
}
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-emscripten"
-declare void @llvm.wasm.throw(i32, i8*)
+declare void @llvm.wasm.throw(i32, ptr)
-define void @foo(i8* %p) {
- call void @llvm.wasm.throw(i32 0, i8* %p)
+define void @foo(ptr %p) {
+ call void @llvm.wasm.throw(i32 0, ptr %p)
ret void
}
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-emscripten"
-declare void @llvm.wasm.throw(i32, i8*)
+declare void @llvm.wasm.throw(i32, ptr)
-define void @bar(i8* %p) {
- call void @llvm.wasm.throw(i32 0, i8* %p)
+define void @bar(ptr %p) {
+ call void @llvm.wasm.throw(i32 0, ptr %p)
ret void
}
ret i32 0
}
-@alias_fn = weak alias i32 (), i32 ()* @direct_fn
+@alias_fn = weak alias i32 (), ptr @direct_fn
define i32 @call_direct() #0 {
entry:
define i32 @call_alias_ptr() #0 {
entry:
- %fnptr = alloca i32 ()*, align 8
- store i32 ()* @alias_fn, i32 ()** %fnptr, align 8
- %0 = load i32 ()*, i32 ()** %fnptr, align 8
+ %fnptr = alloca ptr, align 8
+ store ptr @alias_fn, ptr %fnptr, align 8
+ %0 = load ptr, ptr %fnptr, align 8
%call = call i32 %0()
ret i32 %call
}
define i32 @call_direct_ptr() #0 {
entry:
- %fnptr = alloca i32 ()*, align 8
- store i32 ()* @direct_fn, i32 ()** %fnptr, align 8
- %0 = load i32 ()*, i32 ()** %fnptr, align 8
+ %fnptr = alloca ptr, align 8
+ store ptr @direct_fn, ptr %fnptr, align 8
+ %0 = load ptr, ptr %fnptr, align 8
%call = call i32 %0()
ret i32 %call
}
@used_data = hidden global i32 2, align 4
define hidden i64 @unused_function(i64 %arg) {
- %1 = load i64, i64* @unused_data, align 4
+ %1 = load i64, ptr @unused_data, align 4
ret i64 %1
}
define hidden i32 @used_function() {
- %1 = load i32, i32* @used_data, align 4
+ %1 = load i32, ptr @used_data, align 4
ret i32 %1
}
ret i32 0
}
-@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [
- { i32, void ()*, i8* } { i32 1, void ()* @func1, i8* null }
+@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [
+ { i32, ptr, ptr } { i32 1, ptr @func1, ptr null }
]
-@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [
- { i32, void ()*, i8* } { i32 1, void ()* @func2, i8* null }
+@llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [
+ { i32, ptr, ptr } { i32 1, ptr @func2, ptr null }
]
; Check that we have exactly the needed exports: `memory` because that's
ret void
}
-@llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [
- { i32, void ()*, i8* } { i32 1001, void ()* @func1, i8* null },
- { i32, void ()*, i8* } { i32 101, void ()* @func1, i8* null },
- { i32, void ()*, i8* } { i32 101, void ()* @func2, i8* null },
- { i32, void ()*, i8* } { i32 4000, void ()* @externCtor, i8* null }
+@llvm.global_ctors = appending global [4 x { i32, ptr, ptr }] [
+ { i32, ptr, ptr } { i32 1001, ptr @func1, ptr null },
+ { i32, ptr, ptr } { i32 101, ptr @func1, ptr null },
+ { i32, ptr, ptr } { i32 101, ptr @func2, ptr null },
+ { i32, ptr, ptr } { i32 4000, ptr @externCtor, ptr null }
]
-@llvm.global_dtors = appending global [4 x { i32, void ()*, i8* }] [
- { i32, void ()*, i8* } { i32 1001, void ()* @func3, i8* null },
- { i32, void ()*, i8* } { i32 101, void ()* @func3, i8* null },
- { i32, void ()*, i8* } { i32 101, void ()* @func4, i8* null },
- { i32, void ()*, i8* } { i32 4000, void ()* @externDtor, i8* null }
+@llvm.global_dtors = appending global [4 x { i32, ptr, ptr }] [
+ { i32, ptr, ptr } { i32 1001, ptr @func3, ptr null },
+ { i32, ptr, ptr } { i32 101, ptr @func3, ptr null },
+ { i32, ptr, ptr } { i32 101, ptr @func4, ptr null },
+ { i32, ptr, ptr } { i32 4000, ptr @externDtor, ptr null }
]
; RUN: wasm-ld --allow-undefined %t.o %t.global-ctor-dtor.o -o %t.wasm
define internal i32 @baz() local_unnamed_addr {
entry:
- %0 = load i32, i32* @bar, align 4
+ %0 = load i32, ptr @bar, align 4
ret i32 %0
}
define i32 @foo(i32 %goo) {
entry:
%goo.addr = alloca i32, align 4
- store i32 %goo, i32* %goo.addr, align 4
- %0 = load i32, i32* %goo.addr, align 4
- %1 = load i32, i32* %goo.addr, align 4
+ store i32 %goo, ptr %goo.addr, align 4
+ %0 = load i32, ptr %goo.addr, align 4
+ %1 = load i32, ptr %goo.addr, align 4
%mul = mul nsw i32 %0, %1
ret i32 %mul
}
define i32 @blah(i32 %meh) #0 {
entry:
%meh.addr = alloca i32, align 4
- store i32 %meh, i32* %meh.addr, align 4
- %0 = load i32, i32* %meh.addr, align 4
+ store i32 %meh, ptr %meh.addr, align 4
+ %0 = load i32, ptr %meh.addr, align 4
%sub = sub nsw i32 %0, 48
ret i32 %sub
}
@foo = hidden global i32 1
define void @_start() {
- %1 = load atomic i32, i32* @foo unordered, align 4
+ %1 = load atomic i32, ptr @foo unordered, align 4
ret void
}
target triple = "wasm32-unknown-unknown"
define void @_start() {
- call i8* @foo()
+ call ptr @foo()
ret void
}
-define i8* @foo() {
- %1 = call i8* @llvm.returnaddress(i32 0)
- ret i8* %1
+define ptr @foo() {
+ %1 = call ptr @llvm.returnaddress(i32 0)
+ ret ptr %1
}
-declare i8* @llvm.returnaddress(i32)
+declare ptr @llvm.returnaddress(i32)
; CHECK: error: {{.*}} WebAssembly hasn't implemented __builtin_return_address
target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
-define void @_start(i8* %a, i8* %b) {
+define void @_start(ptr %a, ptr %b) {
entry:
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 1024, i1 false)
+ call void @llvm.memcpy.p0.p0.i64(ptr %a, ptr %b, i64 1024, i1 false)
ret void
}
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1)
; CHECK: - Type: CUSTOM
; CHECK-NEXT: Name: name
@g_half = global half 0.0
define void @_start() {
- %val1 = load float, float* @g_float
+ %val1 = load float, ptr @g_float
%v0 = fptrunc float %val1 to half
- store half %v0, half* @g_half
+ store half %v0, ptr @g_half
ret void
}
define i32 @foo() {
entry:
%0 = call i32 @missing_func()
- %1 = load i32, i32* @missing_data, align 4
+ %1 = load i32, ptr @missing_data, align 4
ret i32 %1
}
@tls_int = dso_local thread_local global i32 99
define i32 @get_tls() #0 {
- %val = load i32, i32* @tls_int
+ %val = load i32, ptr @tls_int
ret i32 %val
}
; differently with respect to signature checking.
declare i32 @foo()
-@ptr = global i8* bitcast (i32 ()* @foo to i8*), align 8
+@ptr = global ptr @foo, align 8
; Ensure access to ptr is not inlined below, even under LTO
-@llvm.used = appending global [1 x i8**] [i8** @ptr], section "llvm.metadata"
+@llvm.used = appending global [1 x ptr] [ptr @ptr], section "llvm.metadata"
define void @_start() {
call i32 @bar()
- %addr = load i32 ()*, i32 ()** bitcast (i8** @ptr to i32 ()**), align 8
+ %addr = load ptr, ptr @ptr, align 8
call i32 %addr()
ret void
@foo = external global i32
define void @_start() {
- %val = load i32, i32* @foo, align 4
+ %val = load i32, ptr @foo, align 4
%tobool = icmp ne i32 %val, 0
br i1 %tobool, label %callbar, label %return
@hidden_float = hidden global float 2.0
@missing_float = extern_weak global float
-@ret32_ptr = global i32 (float)* @ret32, align 4
+@ret32_ptr = global ptr @ret32, align 4
-define i32 (float)* @getaddr_external() {
- ret i32 (float)* @ret32;
+define ptr @getaddr_external() {
+ ret ptr @ret32;
}
-define i32 (float)* @getaddr_missing_function() {
- ret i32 (float)* @missing_function;
+define ptr @getaddr_missing_function() {
+ ret ptr @missing_function;
}
-define i32 ()* @getaddr_hidden() {
- ret i32 ()* @hidden_func;
+define ptr @getaddr_hidden() {
+ ret ptr @hidden_func;
}
-define float* @getaddr_missing_float() {
- ret float* @missing_float
+define ptr @getaddr_missing_float() {
+ ret ptr @missing_float
}
define hidden i32 @hidden_func() {
define void @_start() {
entry:
- %f = load float, float* @hidden_float, align 4
- %addr = load i32 (float)*, i32 (float)** @ret32_ptr, align 4
- %arg = load float, float* @global_float, align 4
+ %f = load float, ptr @hidden_float, align 4
+ %addr = load ptr, ptr @ret32_ptr, align 4
+ %arg = load float, ptr @global_float, align 4
call i32 %addr(float %arg)
- %addr2 = call i32 (float)* @getaddr_external()
- %arg2 = load float, float* @hidden_float, align 4
+ %addr2 = call ptr @getaddr_external()
+ %arg2 = load float, ptr @hidden_float, align 4
call i32 %addr2(float %arg2)
- %addr3 = call i32 ()* @getaddr_hidden()
+ %addr3 = call ptr @getaddr_hidden()
call i32 %addr3()
ret void
@data = global i32 2, align 4
@data_external = external global i32
-@indirect_func = local_unnamed_addr global i32 ()* @foo, align 4
+@indirect_func = local_unnamed_addr global ptr @foo, align 4
-@data_addr = local_unnamed_addr global i32* @data, align 4
-@data_addr_external = local_unnamed_addr global i32* @data_external, align 4
+@data_addr = local_unnamed_addr global ptr @data, align 4
+@data_addr_external = local_unnamed_addr global ptr @data_external, align 4
define hidden i32 @foo() {
entry:
; To ensure we use __stack_pointer
%ptr = alloca i32
- %0 = load i32, i32* @data, align 4
- %1 = load i32 ()*, i32 ()** @indirect_func, align 4
+ %0 = load i32, ptr @data, align 4
+ %1 = load ptr, ptr @indirect_func, align 4
call i32 %1()
ret i32 %0
}
-define default i32** @get_data_address() {
+define default ptr @get_data_address() {
entry:
- ret i32** @data_addr_external
+ ret ptr @data_addr_external
}
define void @_start() {
declare extern_weak i32 @bar_import() local_unnamed_addr
@data_import = external global i64
-@func_addr1 = hidden global i32()* @my_func, align 4
-@func_addr2 = hidden global i32()* @foo_import, align 4
-@func_addr3 = hidden global i32()* @bar_import, align 4
-@data_addr1 = hidden global i64* @data_import, align 8
+@func_addr1 = hidden global ptr @my_func, align 4
+@func_addr2 = hidden global ptr @foo_import, align 4
+@func_addr3 = hidden global ptr @bar_import, align 4
+@data_addr1 = hidden global ptr @data_import, align 8
$func_comdat = comdat any
@data_comdat = weak_odr constant [3 x i8] c"abc", comdat($func_comdat)
define linkonce_odr i32 @func_comdat() comdat {
entry:
- ret i32 ptrtoint ([3 x i8]* @data_comdat to i32)
+ ret i32 ptrtoint (ptr @data_comdat to i32)
}
; Test that __attribute__(used) (i.e NO_STRIP) is preserved in the relocated symbol table
-@llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @my_func to i8*)], section "llvm.metadata"
+@llvm.used = appending global [1 x ptr] [ptr @my_func], section "llvm.metadata"
define void @_start() {
ret void
.section .text,"",@
foo:
# %ptr = alloca i32
- # %0 = load i32, i32* @data, align 4
- # %1 = load i32 ()*, i32 ()** @indirect_func, align 4
+ # %0 = load i32, ptr @data, align 4
+ # %1 = load ptr, ptr @indirect_func, align 4
# call i32 %1()
# ret i32 %0
.functype foo () -> (i32)
.section .text,"",@
foo:
# %ptr = alloca i32
- # %0 = load i32, i32* @data, align 4
- # %1 = load i32 ()*, i32 ()** @indirect_func, align 4
+ # %0 = load i32, ptr @data, align 4
+ # %1 = load ptr, ptr @indirect_func, align 4
# call i32 %1()
# ret i32 %0
.functype foo () -> (i32)
; Simply taking the address of the function should *not* generate the
; the signature mismatch warning.
-@ptr = dso_local global i8* bitcast (void ()* @ret32 to i8*), align 8
+@ptr = dso_local global ptr @ret32, align 8
define hidden void @_start() local_unnamed_addr {
- %addr = load i32 ()*, i32 ()** bitcast (i8** @ptr to i32 ()**), align 8
+ %addr = load ptr, ptr @ptr, align 8
call i32 %addr()
ret void
}
@foo = global i32 3, section "mysection", align 4
@bar = global i32 4, section "mysection", align 4
-@__start_mysection = external global i8*
-@__stop_mysection = external global i8*
+@__start_mysection = external global ptr
+@__stop_mysection = external global ptr
-define i8** @get_start() {
- ret i8** @__start_mysection
+define ptr @get_start() {
+ ret ptr @__start_mysection
}
-define i8** @get_end() {
- ret i8** @__stop_mysection
+define ptr @get_end() {
+ ret ptr @__stop_mysection
}
define void @_start() {
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-emscripten"
-declare void @foo(i8*)
-declare void @bar(i8*)
+declare void @foo(ptr)
+declare void @bar(ptr)
define void @_start() {
- call void @foo(i8* null)
- call void @bar(i8* null)
+ call void @foo(ptr null)
+ call void @bar(ptr null)
ret void
}
target triple = "wasm32-unknown-unknown"
; Takes the address of the external foo() resulting in undefined external
-@bar = global i8* bitcast (i32 ()* @foo to i8*), align 4
-@llvm.used = appending global [1 x i8**] [i8** @bar], section "llvm.metadata"
+@bar = global ptr @foo, align 4
+@llvm.used = appending global [1 x ptr] [ptr @bar], section "llvm.metadata"
declare i32 @foo() #0