; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
-; CHECK0-DAG: @afoo = alias [2 x i8*], [2 x i8*]* @foo
-; CHECK1-DAG: @afoo = external global [2 x i8*]
-@afoo = alias [2 x i8*], [2 x i8*]* @foo
+; CHECK0-DAG: @afoo = alias [2 x ptr], ptr @foo
+; CHECK1-DAG: @afoo = external global [2 x ptr]
+@afoo = alias [2 x ptr], ptr @foo
; CHECK0-DAG: declare void @abar()
-; CHECK1-DAG: @abar = alias void (), void ()* @bar
-@abar = alias void (), void ()* @bar
+; CHECK1-DAG: @abar = alias void (), ptr @bar
+@abar = alias void (), ptr @bar
-@foo = global [2 x i8*] [i8* bitcast (void ()* @bar to i8*), i8* bitcast (void ()* @abar to i8*)]
+@foo = global [2 x ptr] [ptr @bar, ptr @abar]
define void @bar() {
- store [2 x i8*] zeroinitializer, [2 x i8*]* @foo
- store [2 x i8*] zeroinitializer, [2 x i8*]* @afoo
+ store [2 x ptr] zeroinitializer, ptr @foo
+ store [2 x ptr] zeroinitializer, ptr @afoo
ret void
}
; RUN: llvm-dis -o - %t3 | FileCheck --check-prefix=CHECK1234 %s
; RUN: llvm-dis -o - %t4 | FileCheck --check-prefix=CHECK1234 %s
-; CHECK0: @xxx = global [2 x i8*] [i8* blockaddress(@f, %exit), i8* blockaddress(@g, %exit)]
-; CHECK1234: @xxx = external global [2 x i8*]
+; CHECK0: @xxx = global [2 x ptr] [ptr blockaddress(@f, %exit), ptr blockaddress(@g, %exit)]
+; CHECK1234: @xxx = external global [2 x ptr]
; CHECK1234-NOT: blockaddress
-@xxx = global [2 x i8*] [i8* blockaddress(@f, %exit), i8* blockaddress(@g, %exit)]
+@xxx = global [2 x ptr] [ptr blockaddress(@f, %exit), ptr blockaddress(@g, %exit)]
; CHECK0: define i32 @f()
; CHECK1234: declare i32 @f()
ret i32 0
}
-; CHECK0: define i8* @h()
-; CHECK1234: declare i8* @h()
-define i8* @h(){
+; CHECK0: define ptr @h()
+; CHECK1234: declare ptr @h()
+define ptr @h(){
entry:
- ret i8* blockaddress(@f, %exit)
+ ret ptr blockaddress(@f, %exit)
}
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
-; CHECK0: @foo = global i8* bitcast
-; CHECK1: @foo = external global i8*
-@foo = global i8* bitcast (i8** @bar to i8*)
+; CHECK0: @foo = global ptr @bar
+; CHECK1: @foo = external global ptr
+@foo = global ptr @bar
-; CHECK0: @bar = external global i8*
-; CHECK1: @bar = global i8* bitcast
-@bar = global i8* bitcast (i8** @foo to i8*)
+; CHECK0: @bar = external global ptr
+; CHECK1: @bar = global ptr @foo
+@bar = global ptr @foo
; CHECK0: declare void @bar()
; CHECK0-NOT: personality
-; CHECK1: define void @bar() personality i8* bitcast (void ()* @foo to i8*)
-define void @bar() personality i8* bitcast (void ()* @foo to i8*)
+; CHECK1: define void @bar() personality ptr @foo
+define void @bar() personality ptr @foo
{
ret void
}
; Function Attrs: nounwind
define i32 @main(i32 %x) {
entry:
- %call = call fastcc i32 @foo(i32 %x, i32* nonnull @a)
+ %call = call fastcc i32 @foo(i32 %x, ptr nonnull @a)
%call1 = call fastcc i32 @baz(i32 %x)
%add = add nsw i32 %call, %call1
ret i32 %add
; Function Attrs: nounwind
define fastcc i32 @baz(i32 %x) {
entry:
- store i32 %x, i32* @global_storage, align 4
+ store i32 %x, ptr @global_storage, align 4
%shl = shl i32 %x, %x
ret i32 %shl
}
; Function Attrs: noinline nounwind
-define fastcc i32 @foo(i32 %a, i32* nocapture %b) {
+define fastcc i32 @foo(i32 %a, ptr nocapture %b) {
entry:
call fastcc void @local_func()
%call = call fastcc i32 @bar(i32 %a)
- %0 = load i32, i32* @global_storage, align 4
+ %0 = load i32, ptr @global_storage, align 4
%call1 = call fastcc i32 @baz(i32 %0)
%add = add nsw i32 %call, %call1
- store i32 %add, i32* %b, align 4
+ store i32 %add, ptr %b, align 4
%call.i = call fastcc i32 @baz(i32 %add) #2
%add.i = add nsw i32 %call.i, 2
- %1 = load volatile i32, i32* @local_var, align 4
+ %1 = load volatile i32, ptr @local_var, align 4
%add3 = add nsw i32 %add.i, %1
ret i32 %add3
}
; Function Attrs: noinline nounwind
define internal fastcc void @local_func() section ".text" {
entry:
- %0 = load i32, i32* @global_storage, align 4
- %call = call fastcc i32 @foo(i32 %0, i32* null)
- store volatile i32 %call, i32* @local_var, align 4
+ %0 = load i32, ptr @global_storage, align 4
+ %call = call fastcc i32 @foo(i32 %0, ptr null)
+ store volatile i32 %call, ptr @local_var, align 4
ret void
}
; CHECK1: define i32 @funExternal2
-@funInternalAlias = internal alias i32 (), i32 ()* @funInternal
+@funInternalAlias = internal alias i32 (), ptr @funInternal
define internal i32 @funInternal() {
entry:
; Checks are not critical here - verifier will assert if we fail.
; CHECK0: @g1 = global i32 99
; CHECK0: @c1Alias = external global i8
-; CHECK0: @g1Alias = internal alias i8, bitcast (i32* @g1 to i8*)
+; CHECK0: @g1Alias = internal alias i8, ptr @g1
; CHECK1: @g1 = external global i32
-; CHECK1: @c1Alias = internal alias i8, inttoptr (i64 42 to i8*)
+; CHECK1: @c1Alias = internal alias i8, inttoptr (i64 42 to ptr)
; Third file is actually empty.
; CHECK2: @g1 = external global i32
@g1 = global i32 99
-@g1Alias = internal alias i8, bitcast (i32* @g1 to i8*)
-@c1Alias = internal alias i8, inttoptr (i64 42 to i8*)
-@funExternalAlias = alias i8 (), i8 ()* @funExternal
+@g1Alias = internal alias i8, ptr @g1
+@c1Alias = internal alias i8, inttoptr (i64 42 to ptr)
+@funExternalAlias = alias i8 (), ptr @funExternal
define i8 @funExternal() {
entry:
- %x = load i8, i8* @g1Alias
+ %x = load i8, ptr @g1Alias
ret i8 %x
}
define i8 @funExternal2() {
entry:
- %x = load i8, i8* @c1Alias
+ %x = load i8, ptr @c1Alias
%y = call i8 @funExternalAlias()
%z = add i8 %x, %y
ret i8 %z
define internal i32 @foo() {
entry:
- store i64 5, i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla, i32 0, i32 0), align 8
- store i32 -1, i32* bitcast (i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla2, i32 0, i32 1) to i32*), align 8
+ store i64 5, ptr @bla, align 8
+ store i32 -1, ptr getelementptr inbounds (%struct.anon, ptr @bla2, i32 0, i32 1), align 8
ret i32 0
}
define internal i32 @baz() {
entry:
- store i64 5, i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla, i32 0, i32 0), align 8
- store i32 -1, i32* bitcast (i64* getelementptr inbounds (%struct.anon, %struct.anon* @bla2, i32 0, i32 1) to i32*), align 8
+ store i64 5, ptr @bla, align 8
+ store i32 -1, ptr getelementptr inbounds (%struct.anon, ptr @bla2, i32 0, i32 1), align 8
ret i32 0
}
; CHECK2: @funExternalAlias = alias
; CHECK2: define i32 @funExternal
-@funInternalAlias = alias i32 (), i32 ()* @funInternal
-@funExternalAlias = alias i32 (), i32 ()* @funExternal
-@funInternal2Alias = alias i32 (), i32 ()* @funInternal2
-@funExternal2Alias = alias i32 (), i32 ()* @funExternal2
+@funInternalAlias = alias i32 (), ptr @funInternal
+@funExternalAlias = alias i32 (), ptr @funExternal
+@funInternal2Alias = alias i32 (), ptr @funInternal2
+@funExternal2Alias = alias i32 (), ptr @funExternal2
define internal i32 @funInternal() {
entry:
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
-; CHECK0: declare dso_local %struct.anon* @local0
-; CHECK0: declare dso_local i8** @local1
+; CHECK0: declare dso_local ptr @local0
+; CHECK0: declare dso_local ptr @local1
; CHECK1: @bla
; CHECK1: @ptr
-; CHECK1: define internal %struct.anon* @local0
-; CHECK1: define internal i8** @local1
+; CHECK1: define internal ptr @local0
+; CHECK1: define internal ptr @local1
%struct.anon = type { i64, i64 }
@bla = internal global %struct.anon { i64 1, i64 2 }, align 8
-@ptr = internal global i8* bitcast (%struct.anon* @bla to i8*), align 4
+@ptr = internal global ptr @bla, align 4
-define internal %struct.anon* @local0() {
- ret %struct.anon* @bla
+define internal ptr @local0() {
+ ret ptr @bla
}
-define internal i8** @local1() {
- ret i8** @ptr
+define internal ptr @local1() {
+ ret ptr @ptr
}