; Fixed by delaying binding of variable names until _after_ the method symtab is
; created.
;
-@X = global i32 4 ; <i32*> [#uses=0]
+@X = global i32 4 ; <ptr> [#uses=0]
-declare i32 @xxx(i32*)
+declare i32 @xxx(ptr)
; declaration for a method was found, that this would cause spurious conflicts
; to be detected between locals and globals.
;
-@Var = external global i32 ; <i32*> [#uses=0]
+@Var = external global i32 ; <ptr> [#uses=0]
define void @foo() {
- %Var = alloca i32 ; <i32*> [#uses=0]
+ %Var = alloca i32 ; <ptr> [#uses=0]
ret void
}
define i32 @createtask() {
%v1 = alloca i32 ;; Alloca should have one use!
- %reg112 = load i32, i32* %v1 ;; This load should not use the global!
+ %reg112 = load i32, ptr %v1 ;; This load should not use the global!
ret i32 %reg112
}
%Ty = type opaque
-define %Ty* @func() {
- ret %Ty* null
+define ptr @func() {
+ ret ptr null
}
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
;
; RUN: verify-uselistorder %s
-@str = internal global [6 x i8] c"\22foo\22\00" ; <[6 x i8]*> [#uses=0]
+@str = internal global [6 x i8] c"\22foo\22\00" ; <ptr> [#uses=0]
; RUN: llvm-as < %s | llvm-dis | llvm-as
; RUN: verify-uselistorder %s
-declare void (i32)* @foo()
+declare ptr @foo()
define void @test() {
- call void (i32)* () @foo( ) ; <%ty*>:1 [#uses=0]
+ call ptr () @foo( ) ; <ptr>:1 [#uses=0]
ret void
}
; RUN: llvm-as %s -o /dev/null
; RUN: verify-uselistorder %s
-@.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1]
+@.LC0 = internal global [12 x i8] c"hello world\00" ; <ptr> [#uses=1]
-define i8* @test() {
+define ptr @test() {
; <label>:0
br label %BB1
BB1: ; preds = %BB2, %0
- %ret = phi i8* [ getelementptr ([12 x i8], [12 x i8]* @.LC0, i64 0, i64 0), %0 ], [ null, %BB2 ] ; <i8*> [#uses=1]
- ret i8* %ret
+ %ret = phi ptr [ @.LC0, %0 ], [ null, %BB2 ] ; <ptr> [#uses=1]
+ ret ptr %ret
BB2: ; No predecessors!
br label %BB1
; RUN: llvm-as %s -o /dev/null
; RUN: verify-uselistorder %s
-@.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1]
+@.LC0 = internal global [12 x i8] c"hello world\00" ; <ptr> [#uses=1]
-define i8* @test() {
- ret i8* getelementptr ([12 x i8], [12 x i8]* @.LC0, i64 0, i64 0)
+define ptr @test() {
+ ret ptr @.LC0
}
; RUN: llvm-as < %s | llvm-dis | llvm-as
; RUN: verify-uselistorder %s
-@.LC0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1]
-@X = global i8* null ; <i8**> [#uses=0]
+@.LC0 = internal global [4 x i8] c"foo\00" ; <ptr> [#uses=1]
+@X = global ptr null ; <ptr> [#uses=0]
-declare i32 @puts(i8*)
+declare i32 @puts(ptr)
define void @main() {
bb1:
- %reg211 = call i32 @puts( i8* getelementptr ([4 x i8], [4 x i8]* @.LC0, i64 0, i64 0) ) ; <i32> [#uses=0]
+ %reg211 = call i32 @puts( ptr @.LC0 ) ; <i32> [#uses=0]
ret void
}
; RUN: verify-uselistorder %s
%CHESS_POSITION = type { i32, i32 }
-@pawn_probes = external global i32 ; <i32*> [#uses=0]
-@pawn_hash_mask = external global i32 ; <i32*> [#uses=0]
-@search = external global %CHESS_POSITION ; <%CHESS_POSITION*> [#uses=2]
+@pawn_probes = external global i32 ; <ptr> [#uses=0]
+@pawn_hash_mask = external global i32 ; <ptr> [#uses=0]
+@search = external global %CHESS_POSITION ; <ptr> [#uses=2]
define void @Evaluate() {
- %reg1321 = getelementptr %CHESS_POSITION, %CHESS_POSITION* @search, i64 0, i32 1 ; <i32*> [#uses=1]
- %reg114 = load i32, i32* %reg1321 ; <i32> [#uses=0]
- %reg1801 = getelementptr %CHESS_POSITION, %CHESS_POSITION* @search, i64 0, i32 0 ; <i32*> [#uses=1]
- %reg182 = load i32, i32* %reg1801 ; <i32> [#uses=0]
+ %reg1321 = getelementptr %CHESS_POSITION, ptr @search, i64 0, i32 1 ; <ptr> [#uses=1]
+ %reg114 = load i32, ptr %reg1321 ; <i32> [#uses=0]
+ %reg1801 = getelementptr %CHESS_POSITION, ptr @search, i64 0, i32 0 ; <ptr> [#uses=1]
+ %reg182 = load i32, ptr %reg1801 ; <i32> [#uses=0]
ret void
}
;; int foo[30000]
;;; We should not be soo slow for such a simple case!
-@foo = global [30000 x i32] zeroinitializer ; <[30000 x i32]*> [#uses=0]
+@foo = global [30000 x i32] zeroinitializer ; <ptr> [#uses=0]
declare void @__main()
; RUN: llvm-as < %s | llvm-dis
; RUN: verify-uselistorder %s
-%Domain = type { %Domain**, %Domain* }
-@D = global %Domain zeroinitializer ; <%Domain*> [#uses=0]
+%Domain = type { ptr, ptr }
+@D = global %Domain zeroinitializer ; <ptr> [#uses=0]
; RUN: llvm-as %s -o /dev/null
; RUN: verify-uselistorder %s
-@X = external global i32*
-@X1 = external global %T*
-@X2 = external global i32*
+@X = external global ptr
+@X1 = external global ptr
+@X2 = external global ptr
%T = type {i32}
; There should be absolutely no problem with this testcase.
define i32 @test(i32 %arg1, i32 %arg2) {
- ret i32 ptrtoint (i32 (i32, i32)* @test to i32)
+ ret i32 ptrtoint (ptr @test to i32)
}
; RUN: verify-uselistorder %s
define void @test() {
- call void (...) bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* null, i32 0 )
+ call void (...) @AddString( ptr null, i32 0 )
ret void
}
-define void @AddString(i16* %tmp.124, i32 %tmp.127) {
- call void (...) bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* %tmp.124, i32 %tmp.127 )
+define void @AddString(ptr %tmp.124, i32 %tmp.127) {
+ call void (...) @AddString( ptr %tmp.124, i32 %tmp.127 )
ret void
}
; RUN: opt < %s -passes=instcombine,simplifycfg -S | not grep br
; RUN: verify-uselistorder %s
-@.str_1 = internal constant [6 x i8] c"_Bool\00" ; <[6 x i8]*> [#uses=2]
+@.str_1 = internal constant [6 x i8] c"_Bool\00" ; <ptr> [#uses=2]
define i32 @test() {
- %tmp.54 = load i8, i8* getelementptr ([6 x i8], [6 x i8]* @.str_1, i64 0, i64 1) ; <i8> [#uses=1]
+ %tmp.54 = load i8, ptr getelementptr ([6 x i8], ptr @.str_1, i64 0, i64 1) ; <i8> [#uses=1]
%tmp.55 = icmp ne i8 %tmp.54, 66 ; <i1> [#uses=1]
br i1 %tmp.55, label %then.7, label %endif.7
; RUN: llvm-as < %s | llvm-dis | not grep getelementptr
; RUN: verify-uselistorder %s
-@A = external global { float } ; <{ float }*> [#uses=2]
-@0 = global i32* bitcast ({ float }* @A to i32*) ; <i32**>:0 [#uses=0]
+@A = external global { float } ; <ptr> [#uses=2]
+@0 = global ptr @A ; <ptr>:0 [#uses=0]
; RUN: verify-uselistorder %s
define i32 @test() {
- ret i32 ashr (i32 ptrtoint (i32 ()* @test to i32), i32 2)
+ ret i32 ashr (i32 ptrtoint (ptr @test to i32), i32 2)
}
; RUN: llvm-as < %s | llvm-dis | not grep " bitcast ("
; RUN: verify-uselistorder %s
-@.Base64_1 = external constant [4 x i8] ; <[4 x i8]*> [#uses=1]
+@.Base64_1 = external constant [4 x i8] ; <ptr> [#uses=1]
define i8 @test(i8 %Y) {
%X = bitcast i8 %Y to i8 ; <i8> [#uses=1]
- %tmp.13 = add i8 %X, sub (i8 0, i8 ptrtoint ([4 x i8]* @.Base64_1 to i8)) ; <i8> [#uses=1]
+ %tmp.13 = add i8 %X, sub (i8 0, i8 ptrtoint (ptr @.Base64_1 to i8)) ; <i8> [#uses=1]
ret i8 %tmp.13
}
; RUN: not grep "getelementptr.*getelementptr"
; RUN: verify-uselistorder %s
-%struct.TTriangleItem = type { i8*, i8*, [3 x %struct.TUVVertex] }
+%struct.TTriangleItem = type { ptr, ptr, [3 x %struct.TUVVertex] }
%struct.TUVVertex = type { i16, i16, i16, i16 }
-@data_triangleItems = internal constant [2908 x %struct.TTriangleItem] zeroinitializer; <[2908 x %struct.TTriangleItem]*> [#uses=2]
+@data_triangleItems = internal constant [2908 x %struct.TTriangleItem] zeroinitializer; <ptr> [#uses=2]
define void @foo() {
- store i16 0, i16* getelementptr ([2908 x %struct.TTriangleItem], [2908 x %struct.TTriangleItem]* @data_triangleItems, i64 0, i64 0, i32 2, i64 0, i32 0)
+ store i16 0, ptr getelementptr ([2908 x %struct.TTriangleItem], ptr @data_triangleItems, i64 0, i64 0, i32 2, i64 0, i32 0)
ret void
}
br i1 %tmp.103, label %endif.6, label %else.0
else.0: ; preds = %no_exit.2
- store i16 0, i16* null
+ store i16 0, ptr null
br label %endif.6
endif.6: ; preds = %else.0, %no_exit.2
define i32 @foo() {
- ret i32 and (i32 ptrtoint (i32()* @foo to i32), i32 1)
+ ret i32 and (i32 ptrtoint (ptr @foo to i32), i32 1)
}
define i32 @foo2() {
- ret i32 and (i32 1, i32 ptrtoint (i32()* @foo2 to i32))
+ ret i32 and (i32 1, i32 ptrtoint (ptr @foo2 to i32))
}
define i1 @foo3() {
- ret i1 icmp ne (i1()* @foo3, i1()* null)
+ ret i1 icmp ne (ptr @foo3, ptr null)
}
; RUN: llvm-as %s -o /dev/null
; RUN: verify-uselistorder %s
-define i32* @t1({ float, i32 }* %X) {
- %W = getelementptr { float, i32 }, { float, i32 }* %X, i32 20, i32 1 ; <i32*> [#uses=0]
- %X.upgrd.1 = getelementptr { float, i32 }, { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=0]
- %Y = getelementptr { float, i32 }, { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=1]
- %Z = getelementptr { float, i32 }, { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=0]
- ret i32* %Y
+define ptr @t1(ptr %X) {
+ %W = getelementptr { float, i32 }, ptr %X, i32 20, i32 1 ; <ptr> [#uses=0]
+ %X.upgrd.1 = getelementptr { float, i32 }, ptr %X, i64 20, i32 1 ; <ptr> [#uses=0]
+ %Y = getelementptr { float, i32 }, ptr %X, i64 20, i32 1 ; <ptr> [#uses=1]
+ %Z = getelementptr { float, i32 }, ptr %X, i64 20, i32 1 ; <ptr> [#uses=0]
+ ret ptr %Y
}
ret void
loop: ; preds = %loop
- %tmp.4.i9 = getelementptr i32, i32* null, i32 %tmp.5.i10 ; <i32*> [#uses=1]
- %tmp.5.i10 = load i32, i32* %tmp.4.i9 ; <i32> [#uses=1]
+ %tmp.4.i9 = getelementptr i32, ptr null, i32 %tmp.5.i10 ; <ptr> [#uses=1]
+ %tmp.5.i10 = load i32, ptr %tmp.4.i9 ; <i32> [#uses=1]
br label %loop
}
; %typedef.bc_struct = type opaque
-define i1 @someFunc(i32* %tmp.71.reload, %typedef.bc_struct* %n1) {
+define i1 @someFunc(ptr %tmp.71.reload, %typedef.bc_struct %n1) {
ret i1 true
}
; RUN: llvm-as %s -o /dev/null
; RUN: verify-uselistorder %s
-@str = internal constant [4 x i8] c"-ga\00" ; <[4 x i8]*> [#uses=2]
+@str = internal constant [4 x i8] c"-ga\00" ; <ptr> [#uses=2]
-define i32 @main(i32 %argc, i8** %argv) {
+define i32 @main(i32 %argc, ptr %argv) {
entry:
- %tmp65 = getelementptr i8*, i8** %argv, i32 1 ; <i8**> [#uses=1]
- %tmp66 = load i8*, i8** %tmp65 ; <i8*> [#uses=0]
- br i1 icmp ne (i32 sub (i32 ptrtoint (i8* getelementptr ([4 x i8], [4 x i8]* @str, i32 0, i64 1) to i32), i32 ptrtoint ([4 x i8]* @str to i32)), i32 1), label %exit_1, label %exit_2
+ %tmp65 = getelementptr ptr, ptr %argv, i32 1 ; <ptr> [#uses=1]
+ %tmp66 = load ptr, ptr %tmp65 ; <ptr> [#uses=0]
+ br i1 icmp ne (i32 sub (i32 ptrtoint (ptr getelementptr ([4 x i8], ptr @str, i32 0, i64 1) to i32), i32 ptrtoint (ptr @str to i32)), i32 1), label %exit_1, label %exit_2
exit_1: ; preds = %entry
ret i32 0
; PR1117
; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "invalid cast opcode for cast from"
-define i8* @nada(i64 %X) {
- %result = trunc i64 %X to i8*
- ret i8* %result
+define ptr @nada(i64 %X) {
+ %result = trunc i64 %X to ptr
+ ret ptr %result
}
; PR1117
; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "invalid cast opcode for cast from"
-@X = constant i8* trunc (i64 0 to i8*)
+@X = constant ptr trunc (i64 0 to ptr)
; RUN: llvm-as < %s | llvm-dis | grep "align 1024"
; RUN: verify-uselistorder %s
-define i32 @test(i32* %arg) {
+define i32 @test(ptr %arg) {
entry:
- %tmp2 = load i32, i32* %arg, align 1024 ; <i32> [#uses=1]
+ %tmp2 = load i32, ptr %arg, align 1024 ; <i32> [#uses=1]
ret i32 %tmp2
}
; RUN: llvm-as < %s | llvm-dis | grep "align 1024"
; RUN: verify-uselistorder %s
-define void @test(i32* %arg) {
+define void @test(ptr %arg) {
entry:
- store i32 0, i32* %arg, align 1024
+ store i32 0, ptr %arg, align 1024
ret void
}
; RUN: verify-uselistorder %s
; PR1358
-; CHECK: icmp ne (i32 (...)* @test_weak, i32 (...)* null)
-@G = global i1 icmp ne (i32 (...)* @test_weak, i32 (...)* null)
+; CHECK: icmp ne (ptr @test_weak, ptr null)
+@G = global i1 icmp ne (ptr @test_weak, ptr null)
declare extern_weak i32 @test_weak(...)
%struct.bar = type { i32 }
%struct.foo = type { i32 }
-define i32 @"\ 1Func64"(%struct.bar* %F) {
+define i32 @"\ 1Func64"(ptr %F) {
entry:
ret i32 1
}
-define i32 @Func64(%struct.bar* %B) {
+define i32 @Func64(ptr %B) {
entry:
ret i32 0
}
define i32 @test() {
entry:
- %tmp = tail call i32 @"\ 1Func64"( %struct.bar* null ) ; <i32> [#uses=0]
- %tmp1 = tail call i32 @Func64( %struct.bar* null ) ; <i32> [#uses=0]
+ %tmp = tail call i32 @"\ 1Func64"( ptr null ) ; <i32> [#uses=0]
+ %tmp1 = tail call i32 @Func64( ptr null ) ; <i32> [#uses=0]
ret i32 undef
}
; RUN: verify-uselistorder %s
; PR1645
-@__gthread_active_ptr.5335 = internal constant i8* bitcast (i32 (i32)* @__gthrw_pthread_cancel to i8*)
-@__gthrw_pthread_cancel = weak alias i32 (i32), i32 (i32)* @pthread_cancel
+@__gthread_active_ptr.5335 = internal constant ptr @__gthrw_pthread_cancel
+@__gthrw_pthread_cancel = weak alias i32 (i32), ptr @pthread_cancel
; RUN: not llvm-as < %s > /dev/null 2>&1
-declare i32 @atoi(i8*) nounwind readonly
-declare i32 @atoi(i8*)
+declare i32 @atoi(ptr) nounwind readonly
+declare i32 @atoi(ptr)
; RUN: llvm-as < %s | llvm-dis | grep "addrspace(33)" | count 7
; RUN: llvm-as < %s | llvm-dis | grep "addrspace(42)" | count 2
; RUN: llvm-as < %s | llvm-dis | grep "addrspace(66)" | count 2
-; RUN: llvm-as < %s | llvm-dis | grep "addrspace(11)" | count 6
-; RUN: llvm-as < %s | llvm-dis | grep "addrspace(22)" | count 5
+; RUN: llvm-as < %s | llvm-dis | grep "addrspace(11)" | count 3
+; RUN: llvm-as < %s | llvm-dis | grep "addrspace(22)" | count 4
; RUN: verify-uselistorder %s
- %struct.mystruct = type { i32, i32 addrspace(33)*, i32, i32 addrspace(33)* }
-@input = weak addrspace(42) global %struct.mystruct zeroinitializer ; <%struct.mystruct addrspace(42)*> [#uses=1]
-@output = addrspace(66) global %struct.mystruct zeroinitializer ; <%struct.mystruct addrspace(66)*> [#uses=1]
-@y = external addrspace(33) global i32 addrspace(11)* addrspace(22)* ; <i32 addrspace(11)* addrspace(22)* addrspace(33)*> [#uses=1]
+ %struct.mystruct = type { i32, ptr addrspace(33), i32, ptr addrspace(33) }
+@input = weak addrspace(42) global %struct.mystruct zeroinitializer ; <ptr addrspace(42)> [#uses=1]
+@output = addrspace(66) global %struct.mystruct zeroinitializer ; <ptr addrspace(66)> [#uses=1]
+@y = external addrspace(33) global ptr addrspace(22) ; <ptr addrspace(33)> [#uses=1]
define void @foo() {
entry:
- %tmp1 = load i32 addrspace(33)*, i32 addrspace(33)* addrspace(42)* getelementptr (%struct.mystruct, %struct.mystruct addrspace(42)* @input, i32 0, i32 3), align 4 ; <i32 addrspace(33)*> [#uses=1]
- store i32 addrspace(33)* %tmp1, i32 addrspace(33)* addrspace(66)* getelementptr (%struct.mystruct, %struct.mystruct addrspace(66)* @output, i32 0, i32 1), align 4
+ %tmp1 = load ptr addrspace(33), ptr addrspace(42) getelementptr (%struct.mystruct, ptr addrspace(42) @input, i32 0, i32 3), align 4 ; <ptr addrspace(33)> [#uses=1]
+ store ptr addrspace(33) %tmp1, ptr addrspace(66) getelementptr (%struct.mystruct, ptr addrspace(66) @output, i32 0, i32 1), align 4
ret void
}
-define i32 addrspace(11)* @bar(i32 addrspace(11)* addrspace(22)* addrspace(33)* %x) {
+define ptr addrspace(11) @bar(ptr addrspace(33) %x) {
entry:
- %tmp1 = load i32 addrspace(11)* addrspace(22)*, i32 addrspace(11)* addrspace(22)* addrspace(33)* @y, align 4 ; <i32 addrspace(11)* addrspace(22)*> [#uses=2]
- store i32 addrspace(11)* addrspace(22)* %tmp1, i32 addrspace(11)* addrspace(22)* addrspace(33)* %x, align 4
- %tmp5 = load i32 addrspace(11)*, i32 addrspace(11)* addrspace(22)* %tmp1, align 4 ; <i32 addrspace(11)*> [#uses=1]
- ret i32 addrspace(11)* %tmp5
+ %tmp1 = load ptr addrspace(22), ptr addrspace(33) @y, align 4 ; <ptr addrspace(22)> [#uses=2]
+ store ptr addrspace(22) %tmp1, ptr addrspace(33) %x, align 4
+ %tmp5 = load ptr addrspace(11), ptr addrspace(22) %tmp1, align 4 ; <ptr addrspace(11)> [#uses=1]
+ ret ptr addrspace(11) %tmp5
}
declare void @foo(...)
define void @bar() {
- call void (...) @foo(%struct* byval(%struct) null )
+ call void (...) @foo(ptr byval(%struct) null )
ret void
}
; RUN: not llvm-as %s 2>&1 | grep "integer constant must have integer type"
; PR2060
-define i8* @foo() {
- ret i8* 0
+define ptr @foo() {
+ ret ptr 0
}
; RUN: verify-uselistorder %s
; PR3372
-@X = global i32* @0
+@X = global ptr @0
@0 = global i32 4
define void @foo() {
- bitcast i32* null to i32*
+ bitcast ptr null to ptr
ret void
}
; Stripping the name from A should not break references to it.
%A = type opaque
@g1 = external global %A
-@g2 = global %A* @g1
+@g2 = global ptr @g1
@gdtr = external global [0 x i8]
define void @test() {
- call zeroext i1 @paging_map(i64 zext (i32 and (i32 ptrtoint ([0 x i8]* @gdtr to i32), i32 -4096) to i64))
+ call zeroext i1 @paging_map(i64 zext (i32 and (i32 ptrtoint (ptr @gdtr to i32), i32 -4096) to i64))
ret void
}
; RUN: verify-uselistorder %s
@foo = global i32 0
-@bar = constant i32* getelementptr(i32, i32* @foo)
+@bar = constant ptr getelementptr(i32, ptr @foo)
target triple = "x86_64-apple-darwin10.2"
%struct.anon = type { i32, i32 }
-%struct.test = type { i64, %struct.anon, %struct.test* }
+%struct.test = type { i64, %struct.anon, ptr }
-@TestArrayPtr = global %struct.test* getelementptr inbounds ([10 x %struct.test], [10 x %struct.test]* @TestArray, i64 0, i64 3) ; <%struct.test**> [#uses=1]
-@TestArray = common global [10 x %struct.test] zeroinitializer, align 32 ; <[10 x %struct.test]*> [#uses=2]
+@TestArrayPtr = global ptr getelementptr inbounds ([10 x %struct.test], ptr @TestArray, i64 0, i64 3) ; <ptr> [#uses=1]
+@TestArray = common global [10 x %struct.test] zeroinitializer, align 32 ; <ptr> [#uses=2]
define i32 @main() nounwind readonly !dbg !1 {
- %diff1 = alloca i64 ; <i64*> [#uses=2]
+ %diff1 = alloca i64 ; <ptr> [#uses=2]
; CHECK: call void @llvm.dbg.value(metadata i64 72,
- call void @llvm.dbg.declare(metadata i64* %diff1, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
- store i64 72, i64* %diff1, align 8
- %v1 = load %struct.test*, %struct.test** @TestArrayPtr, align 8 ; <%struct.test*> [#uses=1]
- %v2 = ptrtoint %struct.test* %v1 to i64 ; <i64> [#uses=1]
- %v3 = sub i64 %v2, ptrtoint ([10 x %struct.test]* @TestArray to i64) ; <i64> [#uses=1]
- store i64 %v3, i64* %diff1, align 8
+ call void @llvm.dbg.declare(metadata ptr %diff1, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
+ store i64 72, ptr %diff1, align 8
+ %v1 = load ptr, ptr @TestArrayPtr, align 8 ; <ptr> [#uses=1]
+ %v2 = ptrtoint ptr %v1 to i64 ; <i64> [#uses=1]
+ %v3 = sub i64 %v2, ptrtoint (ptr @TestArray to i64) ; <i64> [#uses=1]
+ store i64 %v3, ptr %diff1, align 8
ret i32 4, !dbg !DILocation(scope: !1)
}
@A = global i64 0
-@add = global i64* inttoptr (i64 add (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X + 0 == X
-@sub = global i64* inttoptr (i64 sub (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X - 0 == X
-@mul = global i64* inttoptr (i64 mul (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X * 0 == 0
-@and1 = global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X & 0 == 0
-@and2 = global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 -1) to i64*) ; X & -1 == X
-@or = global i64 or (i64 ptrtoint (i64* @A to i64), i64 -1) ; X | -1 == -1
-@xor = global i64* inttoptr (i64 xor (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X ^ 0 == X
+@add = global ptr inttoptr (i64 add (i64 ptrtoint (ptr @A to i64), i64 0) to ptr) ; X + 0 == X
+@sub = global ptr inttoptr (i64 sub (i64 ptrtoint (ptr @A to i64), i64 0) to ptr) ; X - 0 == X
+@mul = global ptr inttoptr (i64 mul (i64 ptrtoint (ptr @A to i64), i64 0) to ptr) ; X * 0 == 0
+@and1 = global ptr inttoptr (i64 and (i64 ptrtoint (ptr @A to i64), i64 0) to ptr) ; X & 0 == 0
+@and2 = global ptr inttoptr (i64 and (i64 ptrtoint (ptr @A to i64), i64 -1) to ptr) ; X & -1 == X
+@or = global i64 or (i64 ptrtoint (ptr @A to i64), i64 -1) ; X | -1 == -1
+@xor = global ptr inttoptr (i64 xor (i64 ptrtoint (ptr @A to i64), i64 0) to ptr) ; X ^ 0 == X
%Ty = type { i32, i32 }
@B = external global %Ty
; @icmp_ult1 and @icmp_ult2 will be folded by the target-dependent constant folder instead.
-@icmp_ult1 = global i1 icmp ult (i64* @A, i64* getelementptr (i64, i64* @A, i64 1)) ; true
-@icmp_slt = global i1 icmp slt (i64* @A, i64* getelementptr (i64, i64* @A, i64 0)) ; false
-@icmp_ult2 = global i1 icmp ult (i32* getelementptr (%Ty, %Ty* @B, i64 0, i32 0),
- i32* getelementptr (%Ty, %Ty* @B, i64 0, i32 1)) ; true
-;global i1 icmp ne (i64* @A, i64* bitcast (%Ty* @B to i64*)) ; true
+@icmp_ult1 = global i1 icmp ult (ptr @A, ptr getelementptr (i64, ptr @A, i64 1)) ; true
+@icmp_slt = global i1 icmp slt (ptr @A, ptr @A) ; false
+@icmp_ult2 = global i1 icmp ult (ptr @B,
+ ptr getelementptr (%Ty, ptr @B, i64 0, i32 1)) ; true
+;global i1 icmp ne (ptr @A, ptr @B) ; true
; PR2206
-@cons = weak global i32 0, align 8 ; <i32*> [#uses=1]
-@and3 = global i64 and (i64 ptrtoint (i32* @cons to i64), i64 7)
+@cons = weak global i32 0, align 8 ; <ptr> [#uses=1]
+@and3 = global i64 and (i64 ptrtoint (ptr @cons to i64), i64 7)
-@gep1 = global <2 x i8*> getelementptr(i8, <2 x i8*> undef, <2 x i64> <i64 1, i64 1>)
-@gep2 = global <2 x i8*> getelementptr({ i8 }, <2 x { i8 }*> undef, <2 x i64> <i64 1, i64 1>, <2 x i32> <i32 0, i32 0>)
-@gep3 = global <2 x i8*> getelementptr(i8, <2 x i8*> zeroinitializer, <2 x i64> <i64 0, i64 0>)
-@gep4 = global <2 x i8*> getelementptr({ i8 }, <2 x { i8 }*> zeroinitializer, <2 x i64> <i64 0, i64 0>, <2 x i32> <i32 0, i32 0>)
+@gep1 = global <2 x ptr> getelementptr(i8, <2 x ptr> undef, <2 x i64> <i64 1, i64 1>)
+@gep2 = global <2 x ptr> getelementptr({ i8 }, <2 x ptr> undef, <2 x i64> <i64 1, i64 1>, <2 x i32> <i32 0, i32 0>)
+@gep3 = global <2 x ptr> getelementptr(i8, <2 x ptr> zeroinitializer, <2 x i64> <i64 0, i64 0>)
+@gep4 = global <2 x ptr> getelementptr({ i8 }, <2 x ptr> zeroinitializer, <2 x i64> <i64 0, i64 0>, <2 x i32> <i32 0, i32 0>)
; Need a function to make update_test_checks.py work.
;.
; CHECK: @[[A:[a-zA-Z0-9_$"\\.-]+]] = global i64 0
-; CHECK: @[[ADD:[a-zA-Z0-9_$"\\.-]+]] = global i64* @A
-; CHECK: @[[SUB:[a-zA-Z0-9_$"\\.-]+]] = global i64* @A
-; CHECK: @[[MUL:[a-zA-Z0-9_$"\\.-]+]] = global i64* null
-; CHECK: @[[AND1:[a-zA-Z0-9_$"\\.-]+]] = global i64* null
-; CHECK: @[[AND2:[a-zA-Z0-9_$"\\.-]+]] = global i64* @A
+; CHECK: @[[ADD:[a-zA-Z0-9_$"\\.-]+]] = global ptr @A
+; CHECK: @[[SUB:[a-zA-Z0-9_$"\\.-]+]] = global ptr @A
+; CHECK: @[[MUL:[a-zA-Z0-9_$"\\.-]+]] = global ptr null
+; CHECK: @[[AND1:[a-zA-Z0-9_$"\\.-]+]] = global ptr null
+; CHECK: @[[AND2:[a-zA-Z0-9_$"\\.-]+]] = global ptr @A
; CHECK: @[[OR:[a-zA-Z0-9_$"\\.-]+]] = global i64 -1
-; CHECK: @[[XOR:[a-zA-Z0-9_$"\\.-]+]] = global i64* @A
+; CHECK: @[[XOR:[a-zA-Z0-9_$"\\.-]+]] = global ptr @A
; CHECK: @[[B:[a-zA-Z0-9_$"\\.-]+]] = external global [[TY:%.*]]
-; CHECK: @[[ICMP_ULT1:[a-zA-Z0-9_$"\\.-]+]] = global i1 icmp ugt (i64* getelementptr inbounds (i64, i64* @A, i64 1), i64* @A)
+; CHECK: @[[ICMP_ULT1:[a-zA-Z0-9_$"\\.-]+]] = global i1 icmp ugt (ptr getelementptr inbounds (i64, ptr @A, i64 1), ptr @A)
; CHECK: @[[ICMP_SLT:[a-zA-Z0-9_$"\\.-]+]] = global i1 false
-; CHECK: @[[ICMP_ULT2:[a-zA-Z0-9_$"\\.-]+]] = global i1 icmp ult (i32* getelementptr inbounds ([[TY:%.*]], %Ty* @B, i64 0, i32 0), i32* getelementptr inbounds ([[TY]], %Ty* @B, i64 0, i32 1))
+; CHECK: @[[ICMP_ULT2:[a-zA-Z0-9_$"\\.-]+]] = global i1 icmp ugt (ptr getelementptr inbounds ([[TY:%.*]], ptr @B, i64 0, i32 1), ptr @B)
; CHECK: @[[CONS:[a-zA-Z0-9_$"\\.-]+]] = weak global i32 0, align 8
; CHECK: @[[AND3:[a-zA-Z0-9_$"\\.-]+]] = global i64 0
-; CHECK: @[[GEP1:[a-zA-Z0-9_$"\\.-]+]] = global <2 x i8*> undef
-; CHECK: @[[GEP2:[a-zA-Z0-9_$"\\.-]+]] = global <2 x i8*> undef
-; CHECK: @[[GEP3:[a-zA-Z0-9_$"\\.-]+]] = global <2 x i8*> zeroinitializer
-; CHECK: @[[GEP4:[a-zA-Z0-9_$"\\.-]+]] = global <2 x i8*> zeroinitializer
+; CHECK: @[[GEP1:[a-zA-Z0-9_$"\\.-]+]] = global <2 x ptr> undef
+; CHECK: @[[GEP2:[a-zA-Z0-9_$"\\.-]+]] = global <2 x ptr> undef
+; CHECK: @[[GEP3:[a-zA-Z0-9_$"\\.-]+]] = global <2 x ptr> zeroinitializer
+; CHECK: @[[GEP4:[a-zA-Z0-9_$"\\.-]+]] = global <2 x ptr> zeroinitializer
;.
define void @dummy() {
; CHECK-LABEL: @dummy(
; CHECK: addrspacecast
; CHECK: addrspacecast
-@A = global i32* bitcast (i8* null to i32*) ; Cast null -> fold
-@B = global i32** bitcast (i32** @A to i32**) ; Cast to same type -> fold
+@A = global ptr null ; Cast null -> fold
+@B = global ptr @A ; Cast to same type -> fold
@C = global i32 trunc (i64 42 to i32) ; Integral casts
-@D = global i32* bitcast(float* bitcast (i32* @C to float*) to i32*) ; cast of cast ptr->ptr
-@E = global i32 ptrtoint(float* inttoptr (i8 5 to float*) to i32) ; i32 -> ptr -> i32
+@D = global ptr @C ; cast of cast ptr->ptr
+@E = global i32 ptrtoint(ptr inttoptr (i8 5 to ptr) to i32) ; i32 -> ptr -> i32
; Test folding of binary instrs
-@F = global i32* inttoptr (i32 add (i32 5, i32 -5) to i32*)
-@G = global i32* inttoptr (i32 sub (i32 5, i32 5) to i32*)
+@F = global ptr inttoptr (i32 add (i32 5, i32 -5) to ptr)
+@G = global ptr inttoptr (i32 sub (i32 5, i32 5) to ptr)
; Address space cast AS0 null-> AS1 null
-@H = global i32 addrspace(1)* addrspacecast(i32* null to i32 addrspace(1)*)
+@H = global ptr addrspace(1) addrspacecast(ptr null to ptr addrspace(1))
; Address space cast AS1 null-> AS0 null
-@I = global i32* addrspacecast(i32 addrspace(1)* null to i32*)
+@I = global ptr addrspacecast(ptr addrspace(1) null to ptr)
; Bitcast -> GEP
@J = external global { i32 }
-@K = global i32* bitcast ({ i32 }* @J to i32*)
+@K = global ptr @J
; icmp should return true. It's not valid to *dereference* in @B from a pointer
; based on @A, but icmp isn't a dereference.
-; CHECK: @C = global i1 icmp eq (i64* getelementptr inbounds (i64, i64* @A, i64 1), i64* @B)
-@C = global i1 icmp eq (i64* getelementptr inbounds (i64, i64* @A, i64 1), i64* @B)
+; CHECK: @C = global i1 icmp eq (ptr getelementptr inbounds (i64, ptr @A, i64 1), ptr @B)
+@C = global i1 icmp eq (ptr getelementptr inbounds (i64, ptr @A, i64 1), ptr @B)
; Don't fold this completely away either. In theory this could be simplified
; to only use a gep on one side of the icmp though.
-; CHECK: @D = global i1 icmp eq (i64* getelementptr inbounds (i64, i64* @A, i64 1), i64* getelementptr inbounds (i64, i64* @B, i64 2))
-@D = global i1 icmp eq (i64* getelementptr inbounds (i64, i64* @A, i64 1), i64* getelementptr inbounds (i64, i64* @B, i64 2))
+; CHECK: @D = global i1 icmp eq (ptr getelementptr inbounds (i64, ptr @A, i64 1), ptr getelementptr inbounds (i64, ptr @B, i64 2))
+@D = global i1 icmp eq (ptr getelementptr inbounds (i64, ptr @A, i64 1), ptr getelementptr inbounds (i64, ptr @B, i64 2))
-; CHECK: @E = global i64 addrspace(1)* addrspacecast (i64* @A to i64 addrspace(1)*)
-@E = global i64 addrspace(1)* addrspacecast(i64* @A to i64 addrspace(1)*)
+; CHECK: @E = global ptr addrspace(1) addrspacecast (ptr @A to ptr addrspace(1))
+@E = global ptr addrspace(1) addrspacecast(ptr @A to ptr addrspace(1))
; Don't add an inbounds on @weak.gep, since @weak may be null.
-; CHECK: @weak.gep = global i32* getelementptr (i32, i32* @weak, i32 1)
-@weak.gep = global i32* getelementptr (i32, i32* @weak, i32 1)
+; CHECK: @weak.gep = global ptr getelementptr (i32, ptr @weak, i32 1)
+@weak.gep = global ptr getelementptr (i32, ptr @weak, i32 1)
@weak = extern_weak global i32
; An object with weak linkage cannot have it's identity determined at compile time.
-; CHECK: @F = global i1 icmp eq (i32* @weakany, i32* @glob)
-@F = global i1 icmp eq (i32* @weakany, i32* @glob)
+; CHECK: @F = global i1 icmp eq (ptr @weakany, ptr @glob)
+@F = global i1 icmp eq (ptr @weakany, ptr @glob)
@weakany = weak global i32 0
; Empty globals might end up anywhere, even on top of another global.
-; CHECK: @empty.cmp = global i1 icmp eq ([0 x i8]* @empty.1, [0 x i8]* @empty.2)
+; CHECK: @empty.cmp = global i1 icmp eq (ptr @empty.1, ptr @empty.2)
@empty.1 = external global [0 x i8], align 1
@empty.2 = external global [0 x i8], align 1
-@empty.cmp = global i1 icmp eq ([0 x i8]* @empty.1, [0 x i8]* @empty.2)
+@empty.cmp = global i1 icmp eq (ptr @empty.1, ptr @empty.2)
; Two unnamed_addr globals can share an address
-; CHECK: @unnamed.cmp = global i1 icmp eq ([5 x i8]* @unnamed.1, [5 x i8]* @unnamed.2)
+; CHECK: @unnamed.cmp = global i1 icmp eq (ptr @unnamed.1, ptr @unnamed.2)
@unnamed.1 = unnamed_addr constant [5 x i8] c"asdf\00"
@unnamed.2 = unnamed_addr constant [5 x i8] c"asdf\00"
-@unnamed.cmp = global i1 icmp eq ([5 x i8]* @unnamed.1, [5 x i8]* @unnamed.2)
+@unnamed.cmp = global i1 icmp eq (ptr @unnamed.1, ptr @unnamed.2)
@addrspace3 = internal addrspace(3) global i32 undef
-; CHECK: @no.fold.addrspace.icmp.eq.gv.null = global i1 icmp eq (i32 addrspace(3)* @addrspace3, i32 addrspace(3)* null)
-; CHECK: @no.fold.addrspace.icmp.eq.null.gv = global i1 icmp eq (i32 addrspace(3)* @addrspace3, i32 addrspace(3)* null)
-; CHECK: @no.fold.addrspace.icmp.ne.gv.null = global i1 icmp ne (i32 addrspace(3)* @addrspace3, i32 addrspace(3)* null)
-; CHECK: @no.fold.addrspace.icmp.ne.null.gv = global i1 icmp ne (i32 addrspace(3)* @addrspace3, i32 addrspace(3)* null)
-@no.fold.addrspace.icmp.eq.gv.null = global i1 icmp eq (i32 addrspace(3)* @addrspace3, i32 addrspace(3)* null)
-@no.fold.addrspace.icmp.eq.null.gv = global i1 icmp eq (i32 addrspace(3)* null, i32 addrspace(3)* @addrspace3)
-@no.fold.addrspace.icmp.ne.gv.null = global i1 icmp ne (i32 addrspace(3)* @addrspace3, i32 addrspace(3)* null)
-@no.fold.addrspace.icmp.ne.null.gv = global i1 icmp ne (i32 addrspace(3)* null, i32 addrspace(3)* @addrspace3)
+; CHECK: @no.fold.addrspace.icmp.eq.gv.null = global i1 icmp eq (ptr addrspace(3) @addrspace3, ptr addrspace(3) null)
+; CHECK: @no.fold.addrspace.icmp.eq.null.gv = global i1 icmp eq (ptr addrspace(3) @addrspace3, ptr addrspace(3) null)
+; CHECK: @no.fold.addrspace.icmp.ne.gv.null = global i1 icmp ne (ptr addrspace(3) @addrspace3, ptr addrspace(3) null)
+; CHECK: @no.fold.addrspace.icmp.ne.null.gv = global i1 icmp ne (ptr addrspace(3) @addrspace3, ptr addrspace(3) null)
+@no.fold.addrspace.icmp.eq.gv.null = global i1 icmp eq (ptr addrspace(3) @addrspace3, ptr addrspace(3) null)
+@no.fold.addrspace.icmp.eq.null.gv = global i1 icmp eq (ptr addrspace(3) null, ptr addrspace(3) @addrspace3)
+@no.fold.addrspace.icmp.ne.gv.null = global i1 icmp ne (ptr addrspace(3) @addrspace3, ptr addrspace(3) null)
+@no.fold.addrspace.icmp.ne.null.gv = global i1 icmp ne (ptr addrspace(3) null, ptr addrspace(3) @addrspace3)
; Don't add an inbounds on @glob.a3, since it's not inbounds.
-; CHECK: @glob.a3 = alias i32, getelementptr (i32, i32* @glob.a2, i32 1)
+; CHECK: @glob.a3 = alias i32, getelementptr (i32, ptr @glob.a2, i32 1)
@glob = global i32 0
-@glob.a3 = alias i32, getelementptr (i32, i32* @glob.a2, i32 1)
-@glob.a2 = alias i32, getelementptr (i32, i32* @glob.a1, i32 1)
-@glob.a1 = alias i32, i32* @glob
+@glob.a3 = alias i32, getelementptr (i32, ptr @glob.a2, i32 1)
+@glob.a2 = alias i32, getelementptr (i32, ptr @glob.a1, i32 1)
+@glob.a1 = alias i32, ptr @glob
%retval = alloca i32, align 4
%f1 = alloca %class.foo, align 1
%f2 = alloca %class.foo.0, align 1
- store i32 0, i32* %retval, align 4
- call void @llvm.dbg.declare(metadata %class.foo* %f1, metadata !11, metadata !DIExpression()), !dbg !16
- call void @llvm.dbg.declare(metadata %class.foo.0* %f2, metadata !17, metadata !DIExpression()), !dbg !23
+ store i32 0, ptr %retval, align 4
+ call void @llvm.dbg.declare(metadata ptr %f1, metadata !11, metadata !DIExpression()), !dbg !16
+ call void @llvm.dbg.declare(metadata ptr %f2, metadata !17, metadata !DIExpression()), !dbg !23
ret i32 0, !dbg !24
}
; Function Attrs: nounwind readnone speculatable willreturn
declare %struct.S_102 @f_102() nounwind
-@callthis = external global void ()* ; <void ()**> [#uses=50]
+@callthis = external global ptr ; <ptr> [#uses=50]
define void @foo() {
- store void ()* bitcast (%struct.S_102 ()* @f_102 to void ()*), void ()** @callthis, align 8
+ store ptr @f_102, ptr @callthis, align 8
ret void
}
; Make sure some AArch64 intrinsics have the expected attributes.
-; CHECK: declare i64 @llvm.aarch64.ldxr.p0i64(i64*) [[NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
-declare i64 @llvm.aarch64.ldxr.p0i64(i64*)
+; CHECK: declare i64 @llvm.aarch64.ldxr.p0(ptr) [[NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
+declare i64 @llvm.aarch64.ldxr.p0(ptr)
-; CHECK: declare i32 @llvm.aarch64.stxp(i64, i64, i32*) [[NOFREE_NOUNWIND_WILLRETURN]]
-declare i32 @llvm.aarch64.stxp(i64, i64, i32*)
+; CHECK: declare i32 @llvm.aarch64.stxp(i64, i64, ptr) [[NOFREE_NOUNWIND_WILLRETURN]]
+declare i32 @llvm.aarch64.stxp(i64, i64, ptr)
; CHECK: declare i32 @llvm.aarch64.dsb(i32) [[NOFREE_NOUNWIND_WILLRETURN]]
declare i32 @llvm.aarch64.dsb(i32)
; Test that global aliases are allowed to be constant addrspacecast
@i = internal addrspace(1) global i8 42
-@ia = internal alias i8 addrspace(2)*, addrspacecast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(3)*)
-; CHECK: @ia = internal alias i8 addrspace(2)*, addrspacecast (i8 addrspace(2)* addrspace(1)* bitcast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(1)*) to i8 addrspace(2)* addrspace(3)*)
+@ia = internal alias ptr addrspace(2), addrspacecast (ptr addrspace(1) @i to ptr addrspace(3))
+; CHECK: @ia = internal alias ptr addrspace(2), addrspacecast (ptr addrspace(1) @i to ptr addrspace(3))
; RUN: verify-uselistorder %s
; CHECK: @foo
-; CHECK: store { i32, i32 } { i32 7, i32 9 }, { i32, i32 }* %x
+; CHECK: store { i32, i32 } { i32 7, i32 9 }, ptr %x
; CHECK: ret
-define void @foo({i32, i32}* %x) nounwind {
- store {i32, i32}{i32 7, i32 9}, {i32, i32}* %x
+define void @foo(ptr %x) nounwind {
+ store {i32, i32}{i32 7, i32 9}, ptr %x
ret void
}
; CHECK: @foo_empty
-; CHECK: store {} zeroinitializer, {}* %x
+; CHECK: store {} zeroinitializer, ptr %x
; CHECK: ret
-define void @foo_empty({}* %x) nounwind {
- store {}{}, {}* %x
+define void @foo_empty(ptr %x) nounwind {
+ store {}{}, ptr %x
ret void
}
; CHECK: @bar
-; CHECK: store [2 x i32] [i32 7, i32 9], [2 x i32]* %x
+; CHECK: store [2 x i32] [i32 7, i32 9], ptr %x
; CHECK: ret
-define void @bar([2 x i32]* %x) nounwind {
- store [2 x i32][i32 7, i32 9], [2 x i32]* %x
+define void @bar(ptr %x) nounwind {
+ store [2 x i32][i32 7, i32 9], ptr %x
ret void
}
; CHECK: @bar_empty
-; CHECK: store [0 x i32] undef, [0 x i32]* %x
+; CHECK: store [0 x i32] undef, ptr %x
; CHECK: ret
-define void @bar_empty([0 x i32]* %x) nounwind {
- store [0 x i32][], [0 x i32]* %x
+define void @bar_empty(ptr %x) nounwind {
+ store [0 x i32][], ptr %x
ret void
}
; CHECK: @qux
-; CHECK: store <{ i32, i32 }> <{ i32 7, i32 9 }>, <{ i32, i32 }>* %x
+; CHECK: store <{ i32, i32 }> <{ i32 7, i32 9 }>, ptr %x
; CHECK: ret
-define void @qux(<{i32, i32}>* %x) nounwind {
- store <{i32, i32}><{i32 7, i32 9}>, <{i32, i32}>* %x
+define void @qux(ptr %x) nounwind {
+ store <{i32, i32}><{i32 7, i32 9}>, ptr %x
ret void
}
; CHECK: @qux_empty
-; CHECK: store <{}> zeroinitializer, <{}>* %x
+; CHECK: store <{}> zeroinitializer, ptr %x
; CHECK: ret
-define void @qux_empty(<{}>* %x) nounwind {
- store <{}><{}>, <{}>* %x
+define void @qux_empty(ptr %x) nounwind {
+ store <{}><{}>, ptr %x
ret void
}
; CHECK: error: redefinition of global '@bar'
@foo = global i32 0
-@bar = alias i32, i32* @foo
-@bar = alias i32, i32* @foo
+@bar = alias i32, ptr @foo
+@bar = alias i32, ptr @foo
; Globals.
@global = global i32 0
-@alias.ref1 = global i32* getelementptr inbounds (i32, i32* @alias, i64 1)
-@alias.ref2 = global i32* getelementptr inbounds (i32, i32* @alias, i64 1)
+@alias.ref1 = global ptr getelementptr inbounds (i32, ptr @alias, i64 1)
+@alias.ref2 = global ptr getelementptr inbounds (i32, ptr @alias, i64 1)
; Aliases.
-@alias = alias i32, i32* @global
-@alias.ref3 = alias i32, getelementptr inbounds (i32, i32* @alias, i64 1)
-@alias.ref4 = alias i32, getelementptr inbounds (i32, i32* @alias, i64 1)
+@alias = alias i32, ptr @global
+@alias.ref3 = alias i32, getelementptr inbounds (i32, ptr @alias, i64 1)
+@alias.ref4 = alias i32, getelementptr inbounds (i32, ptr @alias, i64 1)
; RUN: not llvm-as %s -o /dev/null 2>/dev/null
-define void @foo(i1* %p) {
- load i1, i1* %p, align 8589934592
+define void @foo(ptr %p) {
+ load i1, ptr %p, align 8589934592
ret void
}
; RUN: not llvm-as %s -o /dev/null 2>/dev/null
-define void @foo(i1* %p) {
- store i1 false, i1* %p, align 8589934592
+define void @foo(ptr %p) {
+ store i1 false, ptr %p, align 8589934592
ret void
}
define void @foo() {
%p = alloca i1, align 4294967296
- load i1, i1* %p, align 4294967296
- store i1 false, i1* %p, align 4294967296
+ load i1, ptr %p, align 4294967296
+ store i1 false, ptr %p, align 4294967296
ret void
}
; Test parse errors when using form of align attribute with parentheses
; CHECK: <stdin>:[[@LINE+1]]:38: error: expected ')'
-define void @missing_rparen(i8* align(4 %ptr) {
+define void @missing_rparen(ptr align(4 %ptr) {
ret void
}
; Test parse errors when using form of align attribute with parentheses
; CHECK: <stdin>:[[@LINE+1]]:42: error: expected '{' in function body
-define void @missing_Lparen(i8* align 4) %ptr) {
+define void @missing_Lparen(ptr align 4) %ptr) {
ret void
}
; Test parse errors when using form of align attribute with parentheses
; CHECK: <stdin>:[[@LINE+1]]:39: error: expected integer
-define void @missing_value(i8* align () %ptr) {
+define void @missing_value(ptr align () %ptr) {
ret void
}
; Test that align(N) is accepted as an alternative syntax to align N
-; CHECK: define void @param_align4(i8* align 4 %ptr) {
-define void @param_align4(i8* align(4) %ptr) {
+; CHECK: define void @param_align4(ptr align 4 %ptr) {
+define void @param_align4(ptr align(4) %ptr) {
ret void
}
-; CHECK: define void @param_align128(i8* align 128 %0) {
-define void @param_align128(i8* align(128)) {
+; CHECK: define void @param_align128(ptr align 128 %0) {
+define void @param_align128(ptr align(128)) {
ret void
}
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-unknown-linux-gnu"
-@f = alias void (), void ()* @0 ; <void ()*> [#uses=0]
-@g = alias void (), void ()* @1 ; <void ()*> [#uses=0]
-@h = external global void ()* ; <void ()*> [#uses=0]
+@f = alias void (), ptr @0 ; <ptr> [#uses=0]
+@g = alias void (), ptr @1 ; <ptr> [#uses=0]
+@h = external global ptr ; <ptr> [#uses=0]
define internal void @0() nounwind {
entry:
- store void()* @0, void()** @h
+ store ptr @0, ptr @h
br label %return
return: ; preds = %entry
; RUN: verify-uselistorder %s
; Basic smoke test for atomic operations.
-define void @f(i32* %x) {
- ; CHECK: load atomic i32, i32* %x unordered, align 4
- load atomic i32, i32* %x unordered, align 4
- ; CHECK: load atomic volatile i32, i32* %x syncscope("singlethread") acquire, align 4
- load atomic volatile i32, i32* %x syncscope("singlethread") acquire, align 4
- ; CHECK: load atomic volatile i32, i32* %x syncscope("agent") acquire, align 4
- load atomic volatile i32, i32* %x syncscope("agent") acquire, align 4
- ; CHECK: store atomic i32 3, i32* %x release, align 4
- store atomic i32 3, i32* %x release, align 4
- ; CHECK: store atomic volatile i32 3, i32* %x syncscope("singlethread") monotonic, align 4
- store atomic volatile i32 3, i32* %x syncscope("singlethread") monotonic, align 4
- ; CHECK: store atomic volatile i32 3, i32* %x syncscope("workgroup") monotonic, align 4
- store atomic volatile i32 3, i32* %x syncscope("workgroup") monotonic, align 4
- ; CHECK: cmpxchg i32* %x, i32 1, i32 0 syncscope("singlethread") monotonic monotonic
- cmpxchg i32* %x, i32 1, i32 0 syncscope("singlethread") monotonic monotonic
- ; CHECK: cmpxchg i32* %x, i32 1, i32 0 syncscope("workitem") monotonic monotonic
- cmpxchg i32* %x, i32 1, i32 0 syncscope("workitem") monotonic monotonic
- ; CHECK: cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel acquire
- cmpxchg volatile i32* %x, i32 0, i32 1 acq_rel acquire
- ; CHECK: cmpxchg i32* %x, i32 42, i32 0 acq_rel monotonic
- cmpxchg i32* %x, i32 42, i32 0 acq_rel monotonic
- ; CHECK: cmpxchg weak i32* %x, i32 13, i32 0 seq_cst monotonic
- cmpxchg weak i32* %x, i32 13, i32 0 seq_cst monotonic
- ; CHECK: atomicrmw add i32* %x, i32 10 seq_cst
- atomicrmw add i32* %x, i32 10 seq_cst
- ; CHECK: atomicrmw volatile xchg i32* %x, i32 10 monotonic
- atomicrmw volatile xchg i32* %x, i32 10 monotonic
- ; CHECK: atomicrmw volatile xchg i32* %x, i32 10 syncscope("agent") monotonic
- atomicrmw volatile xchg i32* %x, i32 10 syncscope("agent") monotonic
+define void @f(ptr %x) {
+ ; CHECK: load atomic i32, ptr %x unordered, align 4
+ load atomic i32, ptr %x unordered, align 4
+ ; CHECK: load atomic volatile i32, ptr %x syncscope("singlethread") acquire, align 4
+ load atomic volatile i32, ptr %x syncscope("singlethread") acquire, align 4
+ ; CHECK: load atomic volatile i32, ptr %x syncscope("agent") acquire, align 4
+ load atomic volatile i32, ptr %x syncscope("agent") acquire, align 4
+ ; CHECK: store atomic i32 3, ptr %x release, align 4
+ store atomic i32 3, ptr %x release, align 4
+ ; CHECK: store atomic volatile i32 3, ptr %x syncscope("singlethread") monotonic, align 4
+ store atomic volatile i32 3, ptr %x syncscope("singlethread") monotonic, align 4
+ ; CHECK: store atomic volatile i32 3, ptr %x syncscope("workgroup") monotonic, align 4
+ store atomic volatile i32 3, ptr %x syncscope("workgroup") monotonic, align 4
+ ; CHECK: cmpxchg ptr %x, i32 1, i32 0 syncscope("singlethread") monotonic monotonic
+ cmpxchg ptr %x, i32 1, i32 0 syncscope("singlethread") monotonic monotonic
+ ; CHECK: cmpxchg ptr %x, i32 1, i32 0 syncscope("workitem") monotonic monotonic
+ cmpxchg ptr %x, i32 1, i32 0 syncscope("workitem") monotonic monotonic
+ ; CHECK: cmpxchg volatile ptr %x, i32 0, i32 1 acq_rel acquire
+ cmpxchg volatile ptr %x, i32 0, i32 1 acq_rel acquire
+ ; CHECK: cmpxchg ptr %x, i32 42, i32 0 acq_rel monotonic
+ cmpxchg ptr %x, i32 42, i32 0 acq_rel monotonic
+ ; CHECK: cmpxchg weak ptr %x, i32 13, i32 0 seq_cst monotonic
+ cmpxchg weak ptr %x, i32 13, i32 0 seq_cst monotonic
+ ; CHECK: atomicrmw add ptr %x, i32 10 seq_cst
+ atomicrmw add ptr %x, i32 10 seq_cst
+ ; CHECK: atomicrmw volatile xchg ptr %x, i32 10 monotonic
+ atomicrmw volatile xchg ptr %x, i32 10 monotonic
+ ; CHECK: atomicrmw volatile xchg ptr %x, i32 10 syncscope("agent") monotonic
+ atomicrmw volatile xchg ptr %x, i32 10 syncscope("agent") monotonic
; CHECK: fence syncscope("singlethread") release
fence syncscope("singlethread") release
; CHECK: fence seq_cst
ret void
}
-define void @fp_atomics(float* %x) {
- ; CHECK: atomicrmw fadd float* %x, float 1.000000e+00 seq_cst
- atomicrmw fadd float* %x, float 1.0 seq_cst
+define void @fp_atomics(ptr %x) {
+ ; CHECK: atomicrmw fadd ptr %x, float 1.000000e+00 seq_cst
+ atomicrmw fadd ptr %x, float 1.0 seq_cst
- ; CHECK: atomicrmw volatile fadd float* %x, float 1.000000e+00 seq_cst
- atomicrmw volatile fadd float* %x, float 1.0 seq_cst
+ ; CHECK: atomicrmw volatile fadd ptr %x, float 1.000000e+00 seq_cst
+ atomicrmw volatile fadd ptr %x, float 1.0 seq_cst
- ; CHECK: atomicrmw fmax float* %x, float 1.000000e+00 seq_cst
- atomicrmw fmax float* %x, float 1.0 seq_cst
+ ; CHECK: atomicrmw fmax ptr %x, float 1.000000e+00 seq_cst
+ atomicrmw fmax ptr %x, float 1.0 seq_cst
- ; CHECK: atomicrmw volatile fmax float* %x, float 1.000000e+00 seq_cst
- atomicrmw volatile fmax float* %x, float 1.0 seq_cst
+ ; CHECK: atomicrmw volatile fmax ptr %x, float 1.000000e+00 seq_cst
+ atomicrmw volatile fmax ptr %x, float 1.0 seq_cst
- ; CHECK: atomicrmw fmin float* %x, float 1.000000e+00 seq_cst
- atomicrmw fmin float* %x, float 1.0 seq_cst
+ ; CHECK: atomicrmw fmin ptr %x, float 1.000000e+00 seq_cst
+ atomicrmw fmin ptr %x, float 1.0 seq_cst
- ; CHECK: atomicrmw volatile fmin float* %x, float 1.000000e+00 seq_cst
- atomicrmw volatile fmin float* %x, float 1.0 seq_cst
+ ; CHECK: atomicrmw volatile fmin ptr %x, float 1.000000e+00 seq_cst
+ atomicrmw volatile fmin ptr %x, float 1.0 seq_cst
ret void
}
br label %def
use:
- %x = atomicrmw add i32* undef, i32 %y monotonic
+ %x = atomicrmw add ptr undef, i32 %y monotonic
ret void
def:
; RUN: llvm-dis | \
; RUN: FileCheck -check-prefix=CHECK-ASSEMBLES %s
-; CHECK-ASSEMBLES: declare i8* @foo(i8*) [[NOBUILTIN:#[0-9]+]]
-; CHECK-ASSEMBLES: call i8* @foo(i8* %x) [[BUILTIN:#[0-9]+]]
+; CHECK-ASSEMBLES: declare ptr @foo(ptr) [[NOBUILTIN:#[0-9]+]]
+; CHECK-ASSEMBLES: call ptr @foo(ptr %x) [[BUILTIN:#[0-9]+]]
; CHECK-ASSEMBLES: attributes [[NOBUILTIN]] = { nobuiltin }
; CHECK-ASSEMBLES: attributes [[BUILTIN]] = { builtin }
-declare i8* @foo(i8*) #1
-define i8* @bar(i8* %x) {
- %y = call i8* @foo(i8* %x) #0
- ret i8* %y
+declare ptr @foo(ptr) #1
+define ptr @bar(ptr %x) {
+ %y = call ptr @foo(ptr %x) #0
+ ret ptr %y
}
; Make sure that we do not accept the 'builtin' attribute on function
; RUN: not llvm-as <%s 2>&1 | FileCheck -check-prefix=CHECK-BAD %s
; CHECK-BAD: Attribute 'builtin' can only be applied to a callsite.
-; CHECK-BAD-NEXT: i8* (i8*)* @car
+; CHECK-BAD-NEXT: ptr @car
; CHECK-BAD: Attribute 'builtin' can only be applied to a callsite.
-; CHECK-BAD-NEXT: i8* (i8*)* @mar
+; CHECK-BAD-NEXT: ptr @mar
-declare i8* @lar(i8*)
+declare ptr @lar(ptr)
-define i8* @har(i8* %x) {
- %y = call i8* @lar(i8* %x) #0
- ret i8* %y
+define ptr @har(ptr %x) {
+ %y = call ptr @lar(ptr %x) #0
+ ret ptr %y
}
-define i8* @car(i8* %x) #0 {
- ret i8* %x
+define ptr @car(ptr %x) #0 {
+ ret ptr %x
}
-declare i8* @mar(i8*) #0
+declare ptr @mar(ptr) #0
attributes #0 = { builtin }
attributes #1 = { nobuiltin }
@a = private global [60 x i8] zeroinitializer, align 1
-declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly
+declare i32 @llvm.objectsize.i32(ptr, i1) nounwind readonly
define i32 @test.objectsize() {
; CHECK-LABEL: @test.objectsize(
-; CHECK: @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i1 false, i1 false, i1 false)
- %s = call i32 @llvm.objectsize.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i1 false)
+; CHECK: @llvm.objectsize.i32.p0(ptr @a, i1 false, i1 false, i1 false)
+ %s = call i32 @llvm.objectsize.i32(ptr @a, i1 false)
ret i32 %s
}
-declare i64 @llvm.objectsize.i64.p0i8(i8*, i1) nounwind readonly
+declare i64 @llvm.objectsize.i64.p0(ptr, i1) nounwind readonly
define i64 @test.objectsize.2() {
; CHECK-LABEL: @test.objectsize.2(
-; CHECK: @llvm.objectsize.i64.p0i8(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i1 false, i1 false, i1 false)
- %s = call i64 @llvm.objectsize.i64.p0i8(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i1 false)
+; CHECK: @llvm.objectsize.i64.p0(ptr @a, i1 false, i1 false, i1 false)
+ %s = call i64 @llvm.objectsize.i64.p0(ptr @a, i1 false)
ret i64 %s
}
-@u = private global [60 x %0*] zeroinitializer, align 1
+@u = private global [60 x ptr] zeroinitializer, align 1
-declare i32 @llvm.objectsize.i32.unnamed(%0**, i1) nounwind readonly
+declare i32 @llvm.objectsize.i32.unnamed(ptr, i1) nounwind readonly
define i32 @test.objectsize.unnamed() {
; CHECK-LABEL: @test.objectsize.unnamed(
-; CHECK: @llvm.objectsize.i32.p0p0s_s.0(%0** getelementptr inbounds ([60 x %0*], [60 x %0*]* @u, i32 0, i32 0), i1 false, i1 false, i1 false)
- %s = call i32 @llvm.objectsize.i32.unnamed(%0** getelementptr inbounds ([60 x %0*], [60 x %0*]* @u, i32 0, i32 0), i1 false)
+; CHECK: @llvm.objectsize.i32.p0(ptr @u, i1 false, i1 false, i1 false)
+ %s = call i32 @llvm.objectsize.i32.unnamed(ptr @u, i1 false)
ret i32 %s
}
-declare i64 @llvm.objectsize.i64.p0p0s_s.0(%0**, i1) nounwind readonly
define i64 @test.objectsize.unnamed.2() {
; CHECK-LABEL: @test.objectsize.unnamed.2(
-; CHECK: @llvm.objectsize.i64.p0p0s_s.0(%0** getelementptr inbounds ([60 x %0*], [60 x %0*]* @u, i32 0, i32 0), i1 false, i1 false, i1 false)
- %s = call i64 @llvm.objectsize.i64.p0p0s_s.0(%0** getelementptr inbounds ([60 x %0*], [60 x %0*]* @u, i32 0, i32 0), i1 false)
+; CHECK: @llvm.objectsize.i64.p0(ptr @u, i1 false, i1 false, i1 false)
+ %s = call i64 @llvm.objectsize.i64.p0(ptr @u, i1 false)
ret i64 %s
}
-declare <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptrs, i32, <2 x i1> %mask, <2 x double> %src0)
+declare <2 x double> @llvm.masked.load.v2f64(ptr %ptrs, i32, <2 x i1> %mask, <2 x double> %src0)
-define <2 x double> @tests.masked.load(<2 x double>* %ptr, <2 x i1> %mask, <2 x double> %passthru) {
+define <2 x double> @tests.masked.load(ptr %ptr, <2 x i1> %mask, <2 x double> %passthru) {
; CHECK-LABEL: @tests.masked.load(
-; CHECK: @llvm.masked.load.v2f64.p0v2f64
- %res = call <2 x double> @llvm.masked.load.v2f64(<2 x double>* %ptr, i32 1, <2 x i1> %mask, <2 x double> %passthru)
+; CHECK: @llvm.masked.load.v2f64.p0
+ %res = call <2 x double> @llvm.masked.load.v2f64(ptr %ptr, i32 1, <2 x i1> %mask, <2 x double> %passthru)
ret <2 x double> %res
}
-declare void @llvm.masked.store.v2f64(<2 x double> %val, <2 x double>* %ptrs, i32, <2 x i1> %mask)
+declare void @llvm.masked.store.v2f64(<2 x double> %val, ptr %ptrs, i32, <2 x i1> %mask)
-define void @tests.masked.store(<2 x double>* %ptr, <2 x i1> %mask, <2 x double> %val) {
+define void @tests.masked.store(ptr %ptr, <2 x i1> %mask, <2 x double> %val) {
; CHECK-LABEL: @tests.masked.store(
-; CHECK: @llvm.masked.store.v2f64.p0v2f64
- call void @llvm.masked.store.v2f64(<2 x double> %val, <2 x double>* %ptr, i32 4, <2 x i1> %mask)
+; CHECK: @llvm.masked.store.v2f64.p0
+ call void @llvm.masked.store.v2f64(<2 x double> %val, ptr %ptr, i32 4, <2 x i1> %mask)
ret void
}
-declare <2 x double> @llvm.masked.gather.v2f64(<2 x double*> %ptrs, i32, <2 x i1> %mask, <2 x double> %src0)
+declare <2 x double> @llvm.masked.gather.v2f64(<2 x ptr> %ptrs, i32, <2 x i1> %mask, <2 x double> %src0)
-define <2 x double> @tests.masked.gather(<2 x double*> %ptr, <2 x i1> %mask, <2 x double> %passthru) {
+define <2 x double> @tests.masked.gather(<2 x ptr> %ptr, <2 x i1> %mask, <2 x double> %passthru) {
; CHECK-LABEL: @tests.masked.gather(
-; CHECK: @llvm.masked.gather.v2f64.v2p0f64
- %res = call <2 x double> @llvm.masked.gather.v2f64(<2 x double*> %ptr, i32 1, <2 x i1> %mask, <2 x double> %passthru)
+; CHECK: @llvm.masked.gather.v2f64.v2p0
+ %res = call <2 x double> @llvm.masked.gather.v2f64(<2 x ptr> %ptr, i32 1, <2 x i1> %mask, <2 x double> %passthru)
ret <2 x double> %res
}
-declare void @llvm.masked.scatter.v2f64(<2 x double> %val, <2 x double*> %ptrs, i32, <2 x i1> %mask)
+declare void @llvm.masked.scatter.v2f64(<2 x double> %val, <2 x ptr> %ptrs, i32, <2 x i1> %mask)
-define void @tests.masked.scatter(<2 x double*> %ptr, <2 x i1> %mask, <2 x double> %val) {
+define void @tests.masked.scatter(<2 x ptr> %ptr, <2 x i1> %mask, <2 x double> %val) {
; CHECK-LABEL: @tests.masked.scatter(
-; CHECK: @llvm.masked.scatter.v2f64.v2p0f64
- call void @llvm.masked.scatter.v2f64(<2 x double> %val, <2 x double*> %ptr, i32 1, <2 x i1> %mask)
+; CHECK: @llvm.masked.scatter.v2f64.v2p0
+ call void @llvm.masked.scatter.v2f64(<2 x double> %val, <2 x ptr> %ptr, i32 1, <2 x i1> %mask)
ret void
}
-declare {}* @llvm.invariant.start(i64, i8* nocapture) nounwind readonly
-declare void @llvm.invariant.end({}*, i64, i8* nocapture) nounwind
+declare ptr @llvm.invariant.start(i64, ptr nocapture) nounwind readonly
+declare void @llvm.invariant.end(ptr, i64, ptr nocapture) nounwind
define void @tests.invariant.start.end() {
; CHECK-LABEL: @tests.invariant.start.end(
%a = alloca i8
- %i = call {}* @llvm.invariant.start(i64 1, i8* %a)
- ; CHECK: call {}* @llvm.invariant.start.p0i8
- store i8 0, i8* %a
- call void @llvm.invariant.end({}* %i, i64 1, i8* %a)
- ; CHECK: call void @llvm.invariant.end.p0i8
+ %i = call ptr @llvm.invariant.start(i64 1, ptr %a)
+ ; CHECK: call ptr @llvm.invariant.start.p0
+ store i8 0, ptr %a
+ call void @llvm.invariant.end(ptr %i, i64 1, ptr %a)
+ ; CHECK: call void @llvm.invariant.end.p0
ret void
}
-declare {}* @llvm.invariant.start.unnamed(i64, %0** nocapture) nounwind readonly
-declare void @llvm.invariant.end.unnamed({}*, i64, %0** nocapture) nounwind
+declare ptr @llvm.invariant.start.unnamed(i64, ptr nocapture) nounwind readonly
+declare void @llvm.invariant.end.unnamed(ptr, i64, ptr nocapture) nounwind
define void @tests.invariant.start.end.unnamed() {
; CHECK-LABEL: @tests.invariant.start.end.unnamed(
- %a = alloca %0*
- %i = call {}* @llvm.invariant.start.unnamed(i64 1, %0** %a)
- ; CHECK: call {}* @llvm.invariant.start.p0p0s_s.0
- store %0* null, %0** %a
- call void @llvm.invariant.end.unnamed({}* %i, i64 1, %0** %a)
- ; CHECK: call void @llvm.invariant.end.p0p0s_s.0
+ %a = alloca ptr
+ %i = call ptr @llvm.invariant.start.unnamed(i64 1, ptr %a)
+ ; CHECK: call ptr @llvm.invariant.start.p0
+ store ptr null, ptr %a
+ call void @llvm.invariant.end.unnamed(ptr %i, i64 1, ptr %a)
+ ; CHECK: call void @llvm.invariant.end.p0
ret void
}
-@__stack_chk_guard = external global i8*
-declare void @llvm.stackprotectorcheck(i8**)
+@__stack_chk_guard = external global ptr
+declare void @llvm.stackprotectorcheck(ptr)
define void @test.stackprotectorcheck() {
; CHECK-LABEL: @test.stackprotectorcheck(
; CHECK-NEXT: ret void
- call void @llvm.stackprotectorcheck(i8** @__stack_chk_guard)
+ call void @llvm.stackprotectorcheck(ptr @__stack_chk_guard)
ret void
}
-declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind readonly
-declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind
+declare void @llvm.lifetime.start(i64, ptr nocapture) nounwind readonly
+declare void @llvm.lifetime.end(i64, ptr nocapture) nounwind
define void @tests.lifetime.start.end() {
; CHECK-LABEL: @tests.lifetime.start.end(
%a = alloca i8
- call void @llvm.lifetime.start(i64 1, i8* %a)
- ; CHECK: call void @llvm.lifetime.start.p0i8(i64 1, i8* %a)
- store i8 0, i8* %a
- call void @llvm.lifetime.end(i64 1, i8* %a)
- ; CHECK: call void @llvm.lifetime.end.p0i8(i64 1, i8* %a)
+ call void @llvm.lifetime.start(i64 1, ptr %a)
+ ; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %a)
+ store i8 0, ptr %a
+ call void @llvm.lifetime.end(i64 1, ptr %a)
+ ; CHECK: call void @llvm.lifetime.end.p0(i64 1, ptr %a)
ret void
}
-declare void @llvm.lifetime.start.unnamed(i64, %0** nocapture) nounwind readonly
-declare void @llvm.lifetime.end.unnamed(i64, %0** nocapture) nounwind
+declare void @llvm.lifetime.start.unnamed(i64, ptr nocapture) nounwind readonly
+declare void @llvm.lifetime.end.unnamed(i64, ptr nocapture) nounwind
define void @tests.lifetime.start.end.unnamed() {
; CHECK-LABEL: @tests.lifetime.start.end.unnamed(
- %a = alloca %0*
- call void @llvm.lifetime.start.unnamed(i64 1, %0** %a)
- ; CHECK: call void @llvm.lifetime.start.p0p0s_s.0(i64 1, %0** %a)
- store %0* null, %0** %a
- call void @llvm.lifetime.end.unnamed(i64 1, %0** %a)
- ; CHECK: call void @llvm.lifetime.end.p0p0s_s.0(i64 1, %0** %a)
+ %a = alloca ptr
+ call void @llvm.lifetime.start.unnamed(i64 1, ptr %a)
+ ; CHECK: call void @llvm.lifetime.start.p0(i64 1, ptr %a)
+ store ptr null, ptr %a
+ call void @llvm.lifetime.end.unnamed(i64 1, ptr %a)
+ ; CHECK: call void @llvm.lifetime.end.p0(i64 1, ptr %a)
ret void
}
-declare void @llvm.prefetch(i8*, i32, i32, i32)
-define void @test.prefetch(i8* %ptr) {
+declare void @llvm.prefetch(ptr, i32, i32, i32)
+define void @test.prefetch(ptr %ptr) {
; CHECK-LABEL: @test.prefetch(
-; CHECK: @llvm.prefetch.p0i8(i8* %ptr, i32 0, i32 3, i32 1)
- call void @llvm.prefetch(i8* %ptr, i32 0, i32 3, i32 1)
+; CHECK: @llvm.prefetch.p0(ptr %ptr, i32 0, i32 3, i32 1)
+ call void @llvm.prefetch(ptr %ptr, i32 0, i32 3, i32 1)
ret void
}
-declare void @llvm.prefetch.p0i8(i8*, i32, i32, i32)
-define void @test.prefetch.2(i8* %ptr) {
+declare void @llvm.prefetch.p0(ptr, i32, i32, i32)
+define void @test.prefetch.2(ptr %ptr) {
; CHECK-LABEL: @test.prefetch.2(
-; CHECK: @llvm.prefetch.p0i8(i8* %ptr, i32 0, i32 3, i32 1)
- call void @llvm.prefetch(i8* %ptr, i32 0, i32 3, i32 1)
+; CHECK: @llvm.prefetch.p0(ptr %ptr, i32 0, i32 3, i32 1)
+ call void @llvm.prefetch(ptr %ptr, i32 0, i32 3, i32 1)
ret void
}
-declare void @llvm.prefetch.unnamed(%0**, i32, i32, i32)
-define void @test.prefetch.unnamed(%0** %ptr) {
+declare void @llvm.prefetch.unnamed(ptr, i32, i32, i32)
+define void @test.prefetch.unnamed(ptr %ptr) {
; CHECK-LABEL: @test.prefetch.unnamed(
-; CHECK: @llvm.prefetch.p0p0s_s.0(%0** %ptr, i32 0, i32 3, i32 1)
- call void @llvm.prefetch.unnamed(%0** %ptr, i32 0, i32 3, i32 1)
+; CHECK: @llvm.prefetch.p0(ptr %ptr, i32 0, i32 3, i32 1)
+ call void @llvm.prefetch.unnamed(ptr %ptr, i32 0, i32 3, i32 1)
ret void
}
; This is part of @test.objectsize(), since llvm.objectsize declaration gets
; emitted at the end.
-; CHECK: declare i32 @llvm.objectsize.i32.p0i8
-; CHECK: declare i32 @llvm.objectsize.i32.p0p0s_s.0
+; CHECK: declare i32 @llvm.objectsize.i32.p0
-; CHECK: declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
-; CHECK: declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
-; CHECK: declare void @llvm.lifetime.start.p0p0s_s.0(i64 immarg, %0** nocapture)
-; CHECK: declare void @llvm.lifetime.end.p0p0s_s.0(i64 immarg, %0** nocapture)
+; CHECK: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
+; CHECK: declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
; Check that remangling code doesn't fail on an intrinsic with wrong signature
; CHECK: Attribute after last parameter!
-; CHECK-NEXT: void (i8*, i8, i64)* @llvm.memset.i64
-declare void @llvm.memset.i64(i8* nocapture, i8, i64) nounwind
+; CHECK-NEXT: ptr @llvm.memset.i64
+declare void @llvm.memset.i64(ptr nocapture, i8, i64) nounwind
; CHECK: Attribute after last parameter!
-; CHECK-NEXT: void (i8*, i8, i64)* @llvm.memcpy.i64
-declare void @llvm.memcpy.i64(i8* nocapture, i8, i64) nounwind
+; CHECK-NEXT: ptr @llvm.memcpy.i64
+declare void @llvm.memcpy.i64(ptr nocapture, i8, i64) nounwind
; CHECK: Attribute after last parameter!
-; CHECK-NEXT: void (i8*, i8, i64)* @llvm.memmove.i64
-declare void @llvm.memmove.i64(i8* nocapture, i8, i64) nounwind
+; CHECK-NEXT: ptr @llvm.memmove.i64
+declare void @llvm.memmove.i64(ptr nocapture, i8, i64) nounwind
; Test autoupgrade of arch-specific thread pointer intrinsics
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
-declare i8* @llvm.aarch64.thread.pointer()
-declare i8* @llvm.arm.thread.pointer()
+declare ptr @llvm.aarch64.thread.pointer()
+declare ptr @llvm.arm.thread.pointer()
-define i8* @test1() {
+define ptr @test1() {
; CHECK: test1()
-; CHECK: call i8* @llvm.thread.pointer()
- %1 = call i8* @llvm.aarch64.thread.pointer()
- ret i8 *%1
+; CHECK: call ptr @llvm.thread.pointer()
+ %1 = call ptr @llvm.aarch64.thread.pointer()
+ ret ptr %1
}
-define i8* @test2() {
+define ptr @test2() {
; CHECK: test2()
-; CHECK: call i8* @llvm.thread.pointer()
- %1 = call i8* @llvm.arm.thread.pointer()
- ret i8 *%1
+; CHECK: call ptr @llvm.thread.pointer()
+ %1 = call ptr @llvm.arm.thread.pointer()
+ ret ptr %1
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:34: error: expected '('{{$}}
-define void @test_byref(i8* byref) {
+define void @test_byref(ptr byref) {
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:35: error: expected type{{$}}
-define void @test_byref(i8* byref() {
+define void @test_byref(ptr byref() {
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:35: error: expected type{{$}}
-define void @test_byref(i8* byref()) {
+define void @test_byref(ptr byref()) {
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:35: error: expected type{{$}}
-define void @test_byref(i8* byref(-1)) {
+define void @test_byref(ptr byref(-1)) {
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:35: error: expected type{{$}}
-define void @test_byref(i8* byref(0)) {
+define void @test_byref(ptr byref(0)) {
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:14: error: expected '('{{$}}
-define byref i8* @test_byref() {
+define byref ptr @test_byref() {
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:14: error: expected '('{{$}}
-define byref 8 i8* @test_byref() {
+define byref 8 ptr @test_byref() {
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:14: error: expected type{{$}}
-define byref(8) i8* @test_byref() {
+define byref(8) ptr @test_byref() {
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:34: error: expected '('{{$}}
-define void @test_byval(i8* byval) {
+define void @test_byval(ptr byval) {
ret void
}
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; CHECK: define void @foo(i32* byval(i32) align 4 %0)
-define void @foo(i32* byval(i32) align 4 %0) {
+; CHECK: define void @foo(ptr byval(i32) align 4 %0)
+define void @foo(ptr byval(i32) align 4 %0) {
ret void
}
-; CHECK: define void @bar({ i32*, i8 }* byval({ i32*, i8 }) align 4 %0)
-define void @bar({i32*, i8}* byval({i32*, i8}) align 4 %0) {
+; CHECK: define void @bar(ptr byval({ ptr, i8 }) align 4 %0)
+define void @bar(ptr byval({ptr, i8}) align 4 %0) {
ret void
}
-define void @caller({ i32*, i8 }* %ptr) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
-; CHECK: call void @bar({ i32*, i8 }* byval({ i32*, i8 }) %ptr)
-; CHECK: invoke void @bar({ i32*, i8 }* byval({ i32*, i8 }) %ptr)
- call void @bar({i32*, i8}* byval({i32*, i8}) %ptr)
- invoke void @bar({i32*, i8}* byval({i32*, i8}) %ptr) to label %success unwind label %fail
+define void @caller(ptr %ptr) personality ptr @__gxx_personality_v0 {
+; CHECK: call void @bar(ptr byval({ ptr, i8 }) %ptr)
+; CHECK: invoke void @bar(ptr byval({ ptr, i8 }) %ptr)
+ call void @bar(ptr byval({ptr, i8}) %ptr)
+ invoke void @bar(ptr byval({ptr, i8}) %ptr) to label %success unwind label %fail
success:
ret void
fail:
- landingpad { i8*, i32 } cleanup
+ landingpad { ptr, i32 } cleanup
ret void
}
-; CHECK: declare void @baz([8 x i8]* byval([8 x i8]))
+; CHECK: declare void @baz(ptr byval([8 x i8]))
%named_type = type [8 x i8]
-declare void @baz(%named_type* byval(%named_type))
+declare void @baz(ptr byval(%named_type))
declare i32 @__gxx_personality_v0(...)
%0 = type opaque
-; CHECK: define void @anon({ %0* }* byval({ %0* }) %arg)
-; CHECK: call void @anon_callee({ %0* }* byval({ %0* }) %arg)
-define void @anon({ %0* }* byval({ %0* }) %arg) {
- call void @anon_callee({ %0* }* byval({ %0* }) %arg)
+; CHECK: define void @anon(ptr byval({ ptr }) %arg)
+; CHECK: call void @anon_callee(ptr byval({ ptr }) %arg)
+define void @anon(ptr byval({ ptr }) %arg) {
+ call void @anon_callee(ptr byval({ ptr }) %arg)
ret void
}
-; CHECK: declare void @anon_callee({ %0* }* byval({ %0* }))
-declare void @anon_callee({ %0* }* byval({ %0* }))
+; CHECK: declare void @anon_callee(ptr byval({ ptr }))
+declare void @anon_callee(ptr byval({ ptr }))
; RUN: verify-uselistorder < %s
; Check ordering of callee operand versus the argument operand.
-define void @call(void (...)* %p) {
- call void (...) %p(void (...)* %p)
+define void @call(ptr %p) {
+ call void (...) %p(ptr %p)
ret void
}
; Check ordering of callee operand versus the argument operand.
-declare void @personality(i8*)
-define void @invoke(void (...)* %p) personality void(i8*)* @personality {
+declare void @personality(ptr)
+define void @invoke(ptr %p) personality ptr @personality {
entry:
- invoke void (...) %p(void (...)* %p)
+ invoke void (...) %p(ptr %p)
to label %normal unwind label %exception
normal:
ret void
exception:
- landingpad { i8*, i32 } cleanup
+ landingpad { ptr, i32 } cleanup
ret void
}
; Check that numbered variables in a nonzero program address space 200 can be used in a call instruction
-define i8 @test_unnamed(i8(i32)*, i8(i32) addrspace(42)* %0) {
+define i8 @test_unnamed(ptr, ptr addrspace(42) %0) {
; Calls with explicit address spaces are fine:
call addrspace(0) i8 %0(i32 0)
call addrspace(42) i8 %1(i32 0)
; this call is fine if the program address space is 42
call i8 %1(i32 0)
- ; CHECK: call-nonzero-program-addrspace-2.ll:[[@LINE-1]]:11: error: '%1' defined with type 'i8 (i32) addrspace(42)*' but expected 'i8 (i32)*'
+ ; CHECK: call-nonzero-program-addrspace-2.ll:[[@LINE-1]]:11: error: '%1' defined with type 'ptr addrspace(42)' but expected 'ptr'
ret i8 0
}
; PROGAS42: target datalayout = "P42"
-; PROGAS42: define i8 @test_unnamed(i8 (i32)* %0, i8 (i32) addrspace(42)* %1) addrspace(42) {
+; PROGAS42: define i8 @test_unnamed(ptr %0, ptr addrspace(42) %1) addrspace(42) {
; PROGAS42-NEXT: %3 = call addrspace(0) i8 %0(i32 0)
; PROGAS42-NEXT: %4 = call addrspace(42) i8 %1(i32 0)
; PROGAS42-NEXT: %5 = call addrspace(42) i8 %1(i32 0)
; Check that variables in a nonzero program address space 42 can be used in a call instruction
-define i8 @test(i8(i32)* %fnptr0, i8(i32) addrspace(42)* %fnptr42) {
+define i8 @test(ptr %fnptr0, ptr addrspace(42) %fnptr42) {
%explicit_as_0 = call addrspace(0) i8 %fnptr0(i32 0)
%explicit_as_42 = call addrspace(42) i8 %fnptr42(i32 0)
; Calling %fnptr42 without an explicit addrspace() in the call instruction is only okay if the program AS is 42
%call_no_as = call i8 %fnptr42(i32 0)
- ; CHECK: call-nonzero-program-addrspace.ll:[[@LINE-1]]:25: error: '%fnptr42' defined with type 'i8 (i32) addrspace(42)*' but expected 'i8 (i32)*'
+ ; CHECK: call-nonzero-program-addrspace.ll:[[@LINE-1]]:25: error: '%fnptr42' defined with type 'ptr addrspace(42)' but expected 'ptr'
ret i8 0
}
; PROGAS42: target datalayout = "P42"
-; PROGAS42: define i8 @test(i8 (i32)* %fnptr0, i8 (i32) addrspace(42)* %fnptr42) addrspace(42) {
+; PROGAS42: define i8 @test(ptr %fnptr0, ptr addrspace(42) %fnptr42) addrspace(42) {
; Print addrspace(0) since the program address space is non-zero:
; PROGAS42-NEXT: %explicit_as_0 = call addrspace(0) i8 %fnptr0(i32 0)
; Also print addrspace(42) since we always print non-zero addrspace:
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-define void @f(i32* %a, i32 %b, i32 %c) {
+define void @f(ptr %a, i32 %b, i32 %c) {
; CHECK: invalid cmpxchg failure ordering
- %x = cmpxchg i32* %a, i32 %b, i32 %c acq_rel unordered
+ %x = cmpxchg ptr %a, i32 %b, i32 %c acq_rel unordered
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-define void @f(i32* %a, i32 %b, i32 %c) {
+define void @f(ptr %a, i32 %b, i32 %c) {
; CHECK: invalid cmpxchg failure ordering
- %x = cmpxchg i32* %a, i32 %b, i32 %c acq_rel acq_rel
+ %x = cmpxchg ptr %a, i32 %b, i32 %c acq_rel acq_rel
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-define void @f(i32* %a, i32 %b, i32 %c) {
+define void @f(ptr %a, i32 %b, i32 %c) {
; CHECK: invalid cmpxchg failure ordering
- %x = cmpxchg i32* %a, i32 %b, i32 %c acq_rel release
+ %x = cmpxchg ptr %a, i32 %b, i32 %c acq_rel release
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-define void @f(i32* %a, i32 %b, i32 %c) {
+define void @f(ptr %a, i32 %b, i32 %c) {
; CHECK: invalid cmpxchg success ordering
- %x = cmpxchg i32* %a, i32 %b, i32 %c unordered monotonic
+ %x = cmpxchg ptr %a, i32 %b, i32 %c unordered monotonic
ret void
}
%a.addr = alloca i32, align 4
%b.addr = alloca i32, align 4
%sum = alloca i32, align 4
- store i32 %a, i32* %a.addr, align 4
- store i32 %b, i32* %b.addr, align 4
+ store i32 %a, ptr %a.addr, align 4
+ store i32 %b, ptr %b.addr, align 4
br label %top
top: ; preds = %entry
call void @llvm.dbg.label(metadata !9), !dbg !10
- %0 = load i32, i32* %a.addr, align 4
- %1 = load i32, i32* %b.addr, align 4
+ %0 = load i32, ptr %a.addr, align 4
+ %1 = load i32, ptr %b.addr, align 4
%add = add nsw i32 %0, %1
- store i32 %add, i32* %sum, align 4
+ store i32 %add, ptr %sum, align 4
br label %done
done: ; preds = %top
call void @llvm.dbg.label(metadata !11), !dbg !12
- %2 = load i32, i32* %sum, align 4
+ %2 = load i32, ptr %sum, align 4
ret i32 %2
}
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 internal void @sub1_.t0p(float* %arg0) #0 !dbg !23 {
+define internal void @sub1_.t0p(ptr %arg0) #0 !dbg !23 {
wrap_start11:
- call void (...) @sub1_(float* %arg0), !dbg !25
+ call void (...) @sub1_(ptr %arg0), !dbg !25
ret void, !dbg !25
}
;--- internal_alias_dllexport.ll
@global = global i32 0
-@alias = internal dllexport alias i32, i32* @global
+@alias = internal dllexport alias i32, ptr @global
;--- private_function_dllexport.ll
;--- private_alias_dllexport.ll
@global = global i32 0
-@alias = private dllexport alias i32, i32* @global
+@alias = private dllexport alias i32, ptr @global
;--- internal_function_dllimport.ll
;--- internal_alias_dllimport.ll
@global = global i32 0
-@alias = internal dllimport alias i32, i32* @global
+@alias = internal dllimport alias i32, ptr @global
;--- private_function_dllimport.ll
;--- private_alias_dllimport.ll
@global = global i32 0
-@alias = private dllimport alias i32, i32* @global
+@alias = private dllimport alias i32, ptr @global
; DIS: %tmp = alloca i32, align 4, addrspace(5)
%tmp = alloca i32, addrspace(5)
call void @llvm.dbg.value(
- metadata i8* undef,
+ metadata ptr undef,
metadata !DILocalVariable(scope: !1),
metadata !DIExpression())
; AS: llvm.dbg.value intrinsic requires a !dbg attachment
define i32 @main() !dbg !4 {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval
+ store i32 0, ptr %retval
ret i32 0, !dbg !12
}
define float @none(float %x, float %y) {
entry:
-; CHECK: %vec = load <3 x float>, <3 x float>* @vec
- %vec = load <3 x float>, <3 x float>* @vec
-; CHECK: %select = load i1, i1* @select
- %select = load i1, i1* @select
-; CHECK: %arr = load [3 x float], [3 x float]* @arr
- %arr = load [3 x float], [3 x float]* @arr
+; CHECK: %vec = load <3 x float>, ptr @vec
+ %vec = load <3 x float>, ptr @vec
+; CHECK: %select = load i1, ptr @select
+ %select = load i1, ptr @select
+; CHECK: %arr = load [3 x float], ptr @arr
+ %arr = load [3 x float], ptr @arr
; CHECK: %a = fadd float %x, %y
%a = fadd float %x, %y
; CHECK: no_nan
define float @no_nan(float %x, float %y) {
entry:
-; CHECK: %vec = load <3 x float>, <3 x float>* @vec
- %vec = load <3 x float>, <3 x float>* @vec
-; CHECK: %select = load i1, i1* @select
- %select = load i1, i1* @select
-; CHECK: %arr = load [3 x float], [3 x float]* @arr
- %arr = load [3 x float], [3 x float]* @arr
+; CHECK: %vec = load <3 x float>, ptr @vec
+ %vec = load <3 x float>, ptr @vec
+; CHECK: %select = load i1, ptr @select
+ %select = load i1, ptr @select
+; CHECK: %arr = load [3 x float], ptr @arr
+ %arr = load [3 x float], ptr @arr
; CHECK: %a = fadd nnan float %x, %y
%a = fadd nnan float %x, %y
; CHECK: no_nan_inf
define float @no_nan_inf(float %x, float %y) {
entry:
-; CHECK: %vec = load <3 x float>, <3 x float>* @vec
- %vec = load <3 x float>, <3 x float>* @vec
-; CHECK: %select = load i1, i1* @select
- %select = load i1, i1* @select
-; CHECK: %arr = load [3 x float], [3 x float]* @arr
- %arr = load [3 x float], [3 x float]* @arr
+; CHECK: %vec = load <3 x float>, ptr @vec
+ %vec = load <3 x float>, ptr @vec
+; CHECK: %select = load i1, ptr @select
+ %select = load i1, ptr @select
+; CHECK: %arr = load [3 x float], ptr @arr
+ %arr = load [3 x float], ptr @arr
; CHECK: %a = fadd nnan ninf float %x, %y
%a = fadd ninf nnan float %x, %y
; CHECK: mixed_flags
define float @mixed_flags(float %x, float %y) {
entry:
-; CHECK: %vec = load <3 x float>, <3 x float>* @vec
- %vec = load <3 x float>, <3 x float>* @vec
-; CHECK: %select = load i1, i1* @select
- %select = load i1, i1* @select
-; CHECK: %arr = load [3 x float], [3 x float]* @arr
- %arr = load [3 x float], [3 x float]* @arr
+; CHECK: %vec = load <3 x float>, ptr @vec
+ %vec = load <3 x float>, ptr @vec
+; CHECK: %select = load i1, ptr @select
+ %select = load i1, ptr @select
+; CHECK: %arr = load [3 x float], ptr @arr
+ %arr = load [3 x float], ptr @arr
; CHECK: %a = fadd nnan ninf afn float %x, %y
%a = fadd ninf nnan afn float %x, %y
; CHECK: @fmf_calls(
define float @fmf_calls(float %x, float %y) {
entry:
-; CHECK: %vec = load <3 x float>, <3 x float>* @vec
- %vec = load <3 x float>, <3 x float>* @vec
-; CHECK: %select = load i1, i1* @select
- %select = load i1, i1* @select
-; CHECK: %arr = load [3 x float], [3 x float]* @arr
- %arr = load [3 x float], [3 x float]* @arr
+; CHECK: %vec = load <3 x float>, ptr @vec
+ %vec = load <3 x float>, ptr @vec
+; CHECK: %select = load i1, ptr @select
+ %select = load i1, ptr @select
+; CHECK: %arr = load [3 x float], ptr @arr
+ %arr = load [3 x float], ptr @arr
; CHECK: %a = call nnan ninf afn float @extfunc(float %x, float %y)
%a = call ninf nnan afn float @extfunc(float %x, float %y)
ret i64 %z
}
-define i64* @gep_nw(i64* %p, i64 %x) {
-; CHECK: %z = getelementptr inbounds i64, i64* %p, i64 %x
- %z = getelementptr inbounds i64, i64* %p, i64 %x
- ret i64* %z
+define ptr @gep_nw(ptr %p, i64 %x) {
+; CHECK: %z = getelementptr inbounds i64, ptr %p, i64 %x
+ %z = getelementptr inbounds i64, ptr %p, i64 %x
+ ret ptr %z
}
-define i64* @gep_plain(i64* %p, i64 %x) {
-; CHECK: %z = getelementptr i64, i64* %p, i64 %x
- %z = getelementptr i64, i64* %p, i64 %x
- ret i64* %z
+define ptr @gep_plain(ptr %p, i64 %x) {
+; CHECK: %z = getelementptr i64, ptr %p, i64 %x
+ %z = getelementptr i64, ptr %p, i64 %x
+ ret ptr %z
}
define i64 @add_both_ce() {
-; CHECK: ret i64 add nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 add nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 add nuw nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 add nsw nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @sub_both_ce() {
-; CHECK: ret i64 sub nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 sub nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 sub nuw nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 sub nsw nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @mul_both_ce() {
-; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 mul nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 mul nuw nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @ashr_exact_ce() {
-; CHECK: ret i64 ashr exact (i64 ptrtoint (i64* @addr to i64), i64 9)
- ret i64 ashr exact (i64 ptrtoint (i64* @addr to i64), i64 9)
+; CHECK: ret i64 ashr exact (i64 ptrtoint (ptr @addr to i64), i64 9)
+ ret i64 ashr exact (i64 ptrtoint (ptr @addr to i64), i64 9)
}
define i64 @lshr_exact_ce() {
-; CHECK: ret i64 lshr exact (i64 ptrtoint (i64* @addr to i64), i64 9)
- ret i64 lshr exact (i64 ptrtoint (i64* @addr to i64), i64 9)
+; CHECK: ret i64 lshr exact (i64 ptrtoint (ptr @addr to i64), i64 9)
+ ret i64 lshr exact (i64 ptrtoint (ptr @addr to i64), i64 9)
}
-define i64* @gep_nw_ce() {
-; CHECK: ret i64* getelementptr inbounds (i64, i64* @addr, i64 171)
- ret i64* getelementptr inbounds (i64, i64* @addr, i64 171)
+define ptr @gep_nw_ce() {
+; CHECK: ret ptr getelementptr inbounds (i64, ptr @addr, i64 171)
+ ret ptr getelementptr inbounds (i64, ptr @addr, i64 171)
}
define i64 @add_plain_ce() {
-; CHECK: ret i64 add (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 add (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 add (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 add (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @sub_plain_ce() {
-; CHECK: ret i64 sub (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 sub (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 sub (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 sub (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @mul_plain_ce() {
-; CHECK: ret i64 mul (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 mul (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 mul (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 mul (i64 ptrtoint (ptr @addr to i64), i64 91)
}
-define i64* @gep_plain_ce() {
-; CHECK: ret i64* getelementptr (i64, i64* @addr, i64 171)
- ret i64* getelementptr (i64, i64* @addr, i64 171)
+define ptr @gep_plain_ce() {
+; CHECK: ret ptr getelementptr (i64, ptr @addr, i64 171)
+ ret ptr getelementptr (i64, ptr @addr, i64 171)
}
define i64 @add_both_reversed_ce() {
-; CHECK: ret i64 add nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 add nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 add nuw nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 add nsw nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @sub_both_reversed_ce() {
-; CHECK: ret i64 sub nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 sub nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 sub nuw nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 sub nsw nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @mul_both_reversed_ce() {
-; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 mul nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 mul nsw nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @add_signed_ce() {
-; CHECK: ret i64 add nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 add nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 add nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 add nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @sub_signed_ce() {
-; CHECK: ret i64 sub nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 sub nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 sub nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 sub nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @mul_signed_ce() {
-; CHECK: ret i64 mul nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 mul nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 mul nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 mul nsw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @shl_signed_ce() {
-; CHECK: ret i64 shl nsw (i64 ptrtoint (i64* @addr to i64), i64 17)
- ret i64 shl nsw (i64 ptrtoint (i64* @addr to i64), i64 17)
+; CHECK: ret i64 shl nsw (i64 ptrtoint (ptr @addr to i64), i64 17)
+ ret i64 shl nsw (i64 ptrtoint (ptr @addr to i64), i64 17)
}
define i64 @add_unsigned_ce() {
-; CHECK: ret i64 add nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 add nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 add nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 add nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @sub_unsigned_ce() {
-; CHECK: ret i64 sub nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 sub nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 sub nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 sub nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
define i64 @mul_unsigned_ce() {
-; CHECK: ret i64 mul nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
- ret i64 mul nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
+; CHECK: ret i64 mul nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
+ ret i64 mul nuw (i64 ptrtoint (ptr @addr to i64), i64 91)
}
@g = global i8 0
-define void @f1() prefix i8* @g prologue i8* @g personality i8* @g {
+define void @f1() prefix ptr @g prologue ptr @g personality ptr @g {
ret void
}
-define void @f2() prefix i8* @g prologue i8* @g personality i8* @g {
+define void @f2() prefix ptr @g prologue ptr @g personality ptr @g {
ret void
}
; Verify that over-indexed getelementptrs are folded.
@A = external global [2 x [3 x [5 x [7 x i32]]]]
-@B = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]], [2 x [3 x [5 x [7 x i32]]]]* @A, i64 0, i64 0, i64 2, i64 1, i64 7523)
-; CHECK: @B = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]], [2 x [3 x [5 x [7 x i32]]]]* @A, i64 36, i64 0, i64 1, i64 0, i64 5)
-@C = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]], [2 x [3 x [5 x [7 x i32]]]]* @A, i64 3, i64 2, i64 0, i64 0, i64 7523)
-; CHECK: @C = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]], [2 x [3 x [5 x [7 x i32]]]]* @A, i64 39, i64 1, i64 1, i64 4, i64 5)
+@B = global ptr getelementptr ([2 x [3 x [5 x [7 x i32]]]], ptr @A, i64 0, i64 0, i64 2, i64 1, i64 7523)
+; CHECK: @B = global ptr getelementptr ([2 x [3 x [5 x [7 x i32]]]], ptr @A, i64 36, i64 0, i64 1, i64 0, i64 5)
+@C = global ptr getelementptr ([2 x [3 x [5 x [7 x i32]]]], ptr @A, i64 3, i64 2, i64 0, i64 0, i64 7523)
+; CHECK: @C = global ptr getelementptr ([2 x [3 x [5 x [7 x i32]]]], ptr @A, i64 39, i64 1, i64 1, i64 4, i64 5)
; Verify that constant expression GEPs work with i84 indices.
@D = external global [1 x i32]
-@E = global i32* getelementptr inbounds ([1 x i32], [1 x i32]* @D, i84 0, i64 1)
-; CHECK: @E = global i32* getelementptr inbounds ([1 x i32], [1 x i32]* @D, i84 1, i64 0)
+@E = global ptr getelementptr inbounds ([1 x i32], ptr @D, i84 0, i64 1)
+; CHECK: @E = global ptr getelementptr inbounds ([1 x i32], ptr @D, i84 1, i64 0)
; Verify that i16 indices work.
@x = external global {i32, i32}
-@y = global i32* getelementptr ({ i32, i32 }, { i32, i32 }* @x, i16 42, i32 0)
-; CHECK: @y = global i32* getelementptr ({ i32, i32 }, { i32, i32 }* @x, i16 42, i32 0)
+@y = global ptr getelementptr ({ i32, i32 }, ptr @x, i16 42, i32 0)
+; CHECK: @y = global ptr getelementptr ({ i32, i32 }, ptr @x, i16 42, i32 0)
@PR23753_a = external global i8
-@PR23753_b = global i8* getelementptr (i8, i8* @PR23753_a, i64 ptrtoint (i8* @PR23753_a to i64))
-; CHECK: @PR23753_b = global i8* getelementptr (i8, i8* @PR23753_a, i64 ptrtoint (i8* @PR23753_a to i64))
+@PR23753_b = global ptr getelementptr (i8, ptr @PR23753_a, i64 ptrtoint (ptr @PR23753_a to i64))
+; CHECK: @PR23753_b = global ptr getelementptr (i8, ptr @PR23753_a, i64 ptrtoint (ptr @PR23753_a to i64))
; Verify that inrange on an index inhibits over-indexed getelementptr folding.
-@nestedarray = global [2 x [4 x i8*]] zeroinitializer
+@nestedarray = global [2 x [4 x ptr]] zeroinitializer
-; CHECK: @nestedarray.1 = alias i8*, getelementptr inbounds ([2 x [4 x i8*]], [2 x [4 x i8*]]* @nestedarray, inrange i32 0, i64 1, i32 0)
-@nestedarray.1 = alias i8*, getelementptr inbounds ([2 x [4 x i8*]], [2 x [4 x i8*]]* @nestedarray, inrange i32 0, i32 0, i32 4)
+; CHECK: @nestedarray.1 = alias ptr, getelementptr inbounds ([2 x [4 x ptr]], ptr @nestedarray, inrange i32 0, i64 1, i32 0)
+@nestedarray.1 = alias ptr, getelementptr inbounds ([2 x [4 x ptr]], ptr @nestedarray, inrange i32 0, i32 0, i32 4)
-; CHECK: @nestedarray.2 = alias i8*, getelementptr inbounds ([2 x [4 x i8*]], [2 x [4 x i8*]]* @nestedarray, i32 0, inrange i32 0, i32 4)
-@nestedarray.2 = alias i8*, getelementptr inbounds ([2 x [4 x i8*]], [2 x [4 x i8*]]* @nestedarray, i32 0, inrange i32 0, i32 4)
+; CHECK: @nestedarray.2 = alias ptr, getelementptr inbounds ([2 x [4 x ptr]], ptr @nestedarray, i32 0, inrange i32 0, i32 4)
+@nestedarray.2 = alias ptr, getelementptr inbounds ([2 x [4 x ptr]], ptr @nestedarray, i32 0, inrange i32 0, i32 4)
-; CHECK: @nestedarray.3 = alias i8*, getelementptr inbounds ([2 x [4 x i8*]], [2 x [4 x i8*]]* @nestedarray, i32 0, inrange i32 0, i32 0)
-@nestedarray.3 = alias i8*, getelementptr inbounds ([4 x i8*], [4 x i8*]* getelementptr inbounds ([2 x [4 x i8*]], [2 x [4 x i8*]]* @nestedarray, i32 0, inrange i32 0), i32 0, i32 0)
+; CHECK: @nestedarray.3 = alias ptr, ptr @nestedarray
+@nestedarray.3 = alias ptr, getelementptr inbounds ([4 x ptr], ptr getelementptr inbounds ([2 x [4 x ptr]], ptr @nestedarray, i32 0, inrange i32 0), i32 0, i32 0)
-; CHECK: @nestedarray.4 = alias i8*, getelementptr inbounds ([2 x [4 x i8*]], [2 x [4 x i8*]]* @nestedarray, i32 0, i32 1, i32 0)
-@nestedarray.4 = alias i8*, getelementptr inbounds ([4 x i8*], [4 x i8*]* getelementptr inbounds ([2 x [4 x i8*]], [2 x [4 x i8*]]* @nestedarray, i32 0, inrange i32 0), i32 1, i32 0)
+; CHECK: @nestedarray.4 = alias ptr, getelementptr inbounds ([4 x ptr], ptr @nestedarray, i32 1, i32 0)
+@nestedarray.4 = alias ptr, getelementptr inbounds ([4 x ptr], ptr getelementptr inbounds ([2 x [4 x ptr]], ptr @nestedarray, i32 0, inrange i32 0), i32 1, i32 0)
-; CHECK: @nestedarray.5 = alias i8*, getelementptr inbounds ([2 x [4 x i8*]], [2 x [4 x i8*]]* @nestedarray, inrange i32 0, i32 1, i32 0)
-@nestedarray.5 = alias i8*, getelementptr inbounds ([4 x i8*], [4 x i8*]* getelementptr inbounds ([2 x [4 x i8*]], [2 x [4 x i8*]]* @nestedarray, inrange i32 0, i32 0), i32 1, i32 0)
+; CHECK: @nestedarray.5 = alias ptr, getelementptr inbounds ([4 x ptr], ptr @nestedarray, i32 1, i32 0)
+@nestedarray.5 = alias ptr, getelementptr inbounds ([4 x ptr], ptr getelementptr inbounds ([2 x [4 x ptr]], ptr @nestedarray, inrange i32 0, i32 0), i32 1, i32 0)
; See if i92 indices work too.
-define i32 *@test({i32, i32}* %t, i92 %n) {
+define ptr @test(ptr %t, i92 %n) {
; CHECK: @test
-; CHECK: %B = getelementptr { i32, i32 }, { i32, i32 }* %t, i92 %n, i32 0
- %B = getelementptr {i32, i32}, {i32, i32}* %t, i92 %n, i32 0
- ret i32* %B
+; CHECK: %B = getelementptr { i32, i32 }, ptr %t, i92 %n, i32 0
+ %B = getelementptr {i32, i32}, ptr %t, i92 %n, i32 0
+ ret ptr %B
}
; Verify that constant expression vector GEPs work.
-@z = global <2 x i32*> getelementptr ([3 x {i32, i32}], <2 x [3 x {i32, i32}]*> zeroinitializer, <2 x i32> <i32 1, i32 2>, <2 x i32> <i32 2, i32 3>, <2 x i32> <i32 1, i32 1>)
+@z = global <2 x ptr> getelementptr ([3 x {i32, i32}], <2 x ptr> zeroinitializer, <2 x i32> <i32 1, i32 2>, <2 x i32> <i32 2, i32 3>, <2 x i32> <i32 1, i32 1>)
; Verify that struct GEP works with a vector of pointers.
-define <2 x i32*> @test7(<2 x {i32, i32}*> %a) {
- %w = getelementptr {i32, i32}, <2 x {i32, i32}*> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> zeroinitializer
- ret <2 x i32*> %w
+define <2 x ptr> @test7(<2 x ptr> %a) {
+ %w = getelementptr {i32, i32}, <2 x ptr> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> zeroinitializer
+ ret <2 x ptr> %w
}
; Verify that array GEP works with a vector of pointers.
-define <2 x i8*> @test8(<2 x [2 x i8]*> %a) {
- %w = getelementptr [2 x i8], <2 x [2 x i8]*> %a, <2 x i32> <i32 0, i32 0>, <2 x i8> <i8 0, i8 1>
- ret <2 x i8*> %w
+define <2 x ptr> @test8(<2 x ptr> %a) {
+ %w = getelementptr [2 x i8], <2 x ptr> %a, <2 x i32> <i32 0, i32 0>, <2 x i8> <i8 0, i8 1>
+ ret <2 x ptr> %w
}
@array = internal global [16 x i32] [i32 -200, i32 -199, i32 -198, i32 -197, i32 -196, i32 -195, i32 -194, i32 -193, i32 -192, i32 -191, i32 -190, i32 -189, i32 -188, i32 -187, i32 -186, i32 -185], align 16
; Verify that array GEP doesn't incorrectly infer inbounds.
-define i32* @test9() {
+define ptr @test9() {
entry:
- ret i32* getelementptr ([16 x i32], [16 x i32]* @array, i64 0, i64 -13)
-; CHECK-LABEL: define i32* @test9(
-; CHECK: ret i32* getelementptr ([16 x i32], [16 x i32]* @array, i64 0, i64 -13)
+ ret ptr getelementptr ([16 x i32], ptr @array, i64 0, i64 -13)
+; CHECK-LABEL: define ptr @test9(
+; CHECK: ret ptr getelementptr ([16 x i32], ptr @array, i64 0, i64 -13)
}
; CHECK: base of getelementptr must be a pointer
-define i32* @foo(i32 %a) {
+define ptr @foo(i32 %a) {
%gep = getelementptr i32, i32 %a, i32 1
- return i32* %gep
+ return ptr %gep
}
%RT = type { i8 , [10 x [20 x i32]], i8 }
%ST = type { i32, double, %RT }
-define i32* @foo(%ST* %s) {
+define ptr @foo(ptr %s) {
entry:
- %reg = getelementptr %ST, %ST* %s, i32 1, i64 2, i32 1, i32 5, i32 13
- ret i32* %reg
+ %reg = getelementptr %ST, ptr %s, i32 1, i64 2, i32 1, i32 5, i32 13
+ ret ptr %reg
}
@G = global [4 x i32] zeroinitializer
; CHECK-LABEL: @foo
-; CHECK: ret <4 x i32*> getelementptr inbounds ([4 x i32], [4 x i32]* @G, <4 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>)
-define <4 x i32*> @foo() {
- ret <4 x i32*> getelementptr ([4 x i32], [4 x i32]* @G, i32 0, <4 x i32> <i32 0, i32 1, i32 2, i32 3>)
+; CHECK: ret <4 x ptr> getelementptr inbounds ([4 x i32], ptr @G, <4 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>)
+define <4 x ptr> @foo() {
+ ret <4 x ptr> getelementptr ([4 x i32], ptr @G, i32 0, <4 x i32> <i32 0, i32 1, i32 2, i32 3>)
}
@G = global [4 x [4 x i32]] zeroinitializer
; CHECK: getelementptr vector index has a wrong number of elements
-define <4 x i32*> @foo() {
- ret <4 x i32*> getelementptr ([4 x [4 x i32]], [4 x [4 x i32]]* @G, i32 0, <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <8 x i32> zeroinitializer)
+define <4 x ptr> @foo() {
+ ret <4 x ptr> getelementptr ([4 x [4 x i32]], ptr @G, i32 0, <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <8 x i32> zeroinitializer)
}
; RUN: FileCheck %s < %t
; Test that a vector GEP may be used with a scalar base, the result is a vector of pointers
-; CHECK: '%w' defined with type '<2 x i32*>
+; CHECK: '%w' defined with type '<2 x ptr>
-define i32 @test(i32* %a) {
- %w = getelementptr i32, i32* %a, <2 x i32> <i32 5, i32 9>
+define i32 @test(ptr %a) {
+ %w = getelementptr i32, ptr %a, <2 x i32> <i32 5, i32 9>
ret i32 %w
}
; Test that a vector pointer and vector index should have the same vector width
; This code is correct
-define <2 x i32*> @test2(<2 x i32*> %a) {
- %w = getelementptr i32, <2 x i32*> %a, i32 2
- ret <2 x i32*> %w
+define <2 x ptr> @test2(<2 x ptr> %a) {
+ %w = getelementptr i32, <2 x ptr> %a, i32 2
+ ret <2 x ptr> %w
}
; This code is correct
-define <2 x i32*> @test3(i32* %a) {
- %w = getelementptr i32, i32* %a, <2 x i32> <i32 2, i32 2>
- ret <2 x i32*> %w
+define <2 x ptr> @test3(ptr %a) {
+ %w = getelementptr i32, ptr %a, <2 x i32> <i32 2, i32 2>
+ ret <2 x ptr> %w
}
; CHECK: getelementptr vector index has a wrong number of elements
-define <2 x i32> @test1(<2 x i32*> %a) {
- %w = getelementptr i32, <2 x i32*> %a, <4 x i32><i32 2, i32 2, i32 2, i32 2>
+define <2 x i32> @test1(<2 x ptr> %a) {
+ %w = getelementptr i32, <2 x ptr> %a, <4 x i32><i32 2, i32 2, i32 2, i32 2>
ret <2 x i32> %w
}
; RUN: FileCheck %s < %t
; Test that a vector GEP may be used with a scalar base, the result is a vector of pointers
-; CHECK: '%w' defined with type '<2 x <4 x i32>*>'
+; CHECK: '%w' defined with type '<2 x ptr>'
-define <4 x i32> @test(<4 x i32>* %a) {
- %w = getelementptr <4 x i32>, <4 x i32>* %a, <2 x i32> <i32 5, i32 9>
+define <4 x i32> @test(ptr %a) {
+ %w = getelementptr <4 x i32>, ptr %a, <2 x i32> <i32 5, i32 9>
ret i32 %w
}
; CHECK: getelementptr vector index has a wrong number of elements
-@0 = global <2 x i32*> getelementptr ([3 x {i32, i32}], <4 x [3 x {i32, i32}]*> zeroinitializer, <2 x i32> <i32 1, i32 2>, <2 x i32> <i32 2, i32 3>, <2 x i32> <i32 1, i32 1>)
+@0 = global <2 x ptr> getelementptr ([3 x {i32, i32}], <4 x ptr> zeroinitializer, <2 x i32> <i32 1, i32 2>, <2 x i32> <i32 2, i32 3>, <2 x i32> <i32 1, i32 1>)
; CHECK: invalid getelementptr indices
-define <2 x i32*> @test7(<2 x {i32, i32}*> %a) {
- %w = getelementptr {i32, i32}, <2 x {i32, i32}*> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> <i32 0, i32 1>
- ret <2 x i32*> %w
+define <2 x ptr> @test7(<2 x ptr> %a) {
+ %w = getelementptr {i32, i32}, <2 x ptr> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> <i32 0, i32 1>
+ ret <2 x ptr> %w
}
; CHECK: invalid getelementptr indices
-define <vscale x 2 x i32*> @test7(<vscale x 2 x {i32, i32}*> %a) {
- %w = getelementptr {i32, i32}, <vscale x 2 x {i32, i32}*> %a, <vscale x 2 x i32> zeroinitializer, <vscale x 2 x i32> zeroinitializer
- ret <vscale x 2 x i32*> %w
+define <vscale x 2 x ptr> @test7(<vscale x 2 x ptr> %a) {
+ %w = getelementptr {i32, i32}, <vscale x 2 x ptr> %a, <vscale x 2 x i32> zeroinitializer, <vscale x 2 x i32> zeroinitializer
+ ret <vscale x 2 x ptr> %w
}
; Make sure the address space of forward decls is preserved
-; CHECK: @a2 = global i8 addrspace(1)* @a
+; CHECK: @a2 = global ptr addrspace(1) @a
; CHECK: @a = addrspace(1) global i8 0
-@a2 = global i8 addrspace(1)* @a
+@a2 = global ptr addrspace(1) @a
@a = addrspace(1) global i8 0
; Now test with global IDs instead of global names.
-; CHECK: @a3 = global i8 addrspace(1)* @0
+; CHECK: @a3 = global ptr addrspace(1) @0
; CHECK: @0 = addrspace(1) global i8 0
-@a3 = global i8 addrspace(1)* @0
+@a3 = global ptr addrspace(1) @0
@0 = addrspace(1) global i8 0
%a = alloca half, align 2
%b = alloca half, align 2
%.compoundliteral = alloca float, align 4
- store half 0xH4200, half* %a, align 2
- store half 0xH4B9A, half* %b, align 2
- %tmp = load half, half* %a, align 2
- %tmp1 = load half, half* %b, align 2
+ store half 0xH4200, ptr %a, align 2
+ store half 0xH4B9A, ptr %b, align 2
+ %tmp = load half, ptr %a, align 2
+ %tmp1 = load half, ptr %b, align 2
%add = fadd half %tmp, %tmp1
; CHECK: 0xH4C8D
ret half %add
entry:
%a = alloca half, align 2
%.compoundliteral = alloca float, align 4
- store half 0xH4C8D, half* %a, align 2
- %tmp = load half, half* %a, align 2
+ store half 0xH4C8D, ptr %a, align 2
+ %tmp = load half, ptr %a, align 2
%conv = fpext half %tmp to float
; CHECK: 0x4032340000000000
ret float %conv
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
; RUN: verify-uselistorder %s
-; CHECK: define [18446744073709551615 x i8]* @foo() {
-; CHECK: ret [18446744073709551615 x i8]* null
-define [18446744073709551615 x i8]* @foo() {
- ret [18446744073709551615 x i8]* null
+; CHECK: define ptr @foo() {
+; CHECK: ret ptr null
+define ptr @foo() {
+ ret ptr null
}
target triple = "x86_64-unknown-linux-gnu"
-@foo = ifunc i32 (i32), i32 (i32)* ()* @foo_ifunc
-; CHECK: @foo = ifunc i32 (i32), i32 (i32)* ()* @foo_ifunc
+@foo = ifunc i32 (i32), ptr @foo_ifunc
+; CHECK: @foo = ifunc i32 (i32), ptr @foo_ifunc
-@strlen = ifunc i64 (i8*), bitcast (i64 (i32*)* ()* @mistyped_strlen_resolver to i64 (i8*)* ()*)
-; CHECK: strlen = ifunc i64 (i8*), bitcast (i64 (i32*)* ()* @mistyped_strlen_resolver to i64 (i8*)* ()*)
+@strlen = ifunc i64 (ptr), ptr @mistyped_strlen_resolver
+; CHECK: strlen = ifunc i64 (ptr), ptr @mistyped_strlen_resolver
-define internal i32 (i32)* @foo_ifunc() {
+define internal ptr @foo_ifunc() {
entry:
- ret i32 (i32)* null
+ ret ptr null
}
-; CHECK: define internal i32 (i32)* @foo_ifunc()
+; CHECK: define internal ptr @foo_ifunc()
-define internal i64 (i32*)* @mistyped_strlen_resolver() {
+define internal ptr @mistyped_strlen_resolver() {
entry:
- ret i64 (i32*)* null
+ ret ptr null
}
-; CHECK: define internal i64 (i32*)* @mistyped_strlen_resolver()
+; CHECK: define internal ptr @mistyped_strlen_resolver()
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
-@foo = dso_local ifunc i32 (i32), i32 (i32)* ()* @foo_ifunc
-; CHECK: @foo = dso_local ifunc i32 (i32), i32 (i32)* ()* @foo_ifunc
+@foo = dso_local ifunc i32 (i32), ptr @foo_ifunc
+; CHECK: @foo = dso_local ifunc i32 (i32), ptr @foo_ifunc
-define internal i32 (i32)* @foo_ifunc() {
+define internal ptr @foo_ifunc() {
entry:
- ret i32 (i32)* null
+ ret ptr null
}
; RUN: verify-uselistorder < %s
; Global referencing ifunc.
-@ptr_foo = global void ()* @foo_ifunc
+@ptr_foo = global ptr @foo_ifunc
; Alias for ifunc.
-@alias_foo = alias void (), void ()* @foo_ifunc
+@alias_foo = alias void (), ptr @foo_ifunc
-@foo_ifunc = ifunc void (), void ()* ()* @foo_resolver
+@foo_ifunc = ifunc void (), ptr @foo_resolver
-define void ()* @foo_resolver() {
+define ptr @foo_resolver() {
entry:
- ret void ()* null
+ ret ptr null
}
; Function referencing ifunc.
}
; Global referencing function.
-@ptr_bar = global void ()* @bar
+@ptr_bar = global ptr @bar
; Alias for function.
-@alias_bar = alias void (), void ()* @bar
+@alias_bar = alias void (), ptr @bar
-@bar_ifunc = ifunc void (), void ()* ()* @bar_resolver
+@bar_ifunc = ifunc void (), ptr @bar_resolver
-define void ()* @bar_resolver() {
+define ptr @bar_resolver() {
entry:
- ret void ()* null
+ ret ptr null
}
; Function referencing bar.
call void @llvm.test.immarg.intrinsic.i32(i32 add (i32 2, i32 3))
; CHECK: call void @llvm.test.immarg.intrinsic.i32(i32 0)
- call void @llvm.test.immarg.intrinsic.i32(i32 ptrtoint (i32* null to i32))
+ call void @llvm.test.immarg.intrinsic.i32(i32 ptrtoint (ptr null to i32))
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:40: error: expected '('{{$}}
-define void @test_inalloca(i8* inalloca) {
+define void @test_inalloca(ptr inalloca) {
ret void
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-; CHECK: insertvalue operand and field disagree in type: 'i8*' instead of 'i32'
+; CHECK: insertvalue operand and field disagree in type: 'ptr' instead of 'i32'
define void @test() {
entry:
- insertvalue { i32, i32 } undef, i8* null, 0
+ insertvalue { i32, i32 } undef, ptr null, 0
ret void
}
@global = global i32 0
-@alias = internal hidden alias i32, i32* @global
+@alias = internal hidden alias i32, ptr @global
; CHECK: symbol with local linkage must have default visibility
@global = global i32 0
-@alias = internal protected alias i32, i32* @global
+@alias = internal protected alias i32, ptr @global
; CHECK: symbol with local linkage must have default visibility
+++ /dev/null
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-; CHECK: <stdin>:4:12: error: explicit pointee type doesn't match operand's pointee type (i1 vs i2)
-@y = global i2 0
-@x = alias i1, i2* @y
; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
; CHECK: error: atomicrmw add operand must be an integer
-define void @f(float* %ptr) {
- atomicrmw add float* %ptr, float 1.0 seq_cst
+define void @f(ptr %ptr) {
+ atomicrmw add ptr %ptr, float 1.0 seq_cst
ret void
}
; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
; CHECK: error: atomicrmw fadd operand must be a floating point type
-define void @f(i32* %ptr) {
- atomicrmw fadd i32* %ptr, i32 2 seq_cst
+define void @f(ptr %ptr) {
+ atomicrmw fadd ptr %ptr, i32 2 seq_cst
ret void
}
; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
; CHECK: error: atomicrmw fsub operand must be a floating point type
-define void @f(i32* %ptr) {
- atomicrmw fsub i32* %ptr, i32 2 seq_cst
+define void @f(ptr %ptr) {
+ atomicrmw fsub ptr %ptr, i32 2 seq_cst
ret void
}
+++ /dev/null
-; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
-
-; CHECK: Attribute 'byval' type does not match parameter!
-declare void @foo(i32* byval(i8))
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
; CHECK: error: void type only allowed for function results
-declare void @foo(i32* byval(void))
+declare void @foo(ptr byval(void))
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
; CHECK: Attribute 'byval' does not support unsized types!
-declare void @foo(void()* byval(void()))
+declare void @foo(ptr byval(void()))
+++ /dev/null
-; RUN: not llvm-as %s -disable-output 2>&1 | grep "invalid forward reference to function as global value!"
-
-define i8* @test1() { ret i8* @test1a }
-define void @test1a() { }
+++ /dev/null
-; RUN: not llvm-as %s -disable-output 2>&1 | grep "forward reference and definition of global have different types"
-
-@a2 = alias void (), void ()* @g2
-@g2 = internal global i8 42
+++ /dev/null
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-; CHECK: <stdin>:4:22: error: explicit pointee type doesn't match operand's pointee type (i16 vs i32)
-define void @test(i32* %t) {
- %x = getelementptr i16, i32* %t, i32 0
- ret void
-}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-; CHECK: <stdin>:4:27: error: expected comma after getelementptr's type
-define void @test(i32* %t) {
- %x = getelementptr i32* %t, i32 0
+; CHECK: <stdin>:4:26: error: expected comma after getelementptr's type
+define void @test(ptr %t) {
+ %x = getelementptr ptr %t, i32 0
ret void
}
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
; CHECK: Attribute 'immarg' is incompatible with other attributes
-declare void @llvm.immarg.byval(i32* byval(i32) immarg)
+declare void @llvm.immarg.byval(ptr byval(i32) immarg)
; CHECK: Attribute 'immarg' is incompatible with other attributes
-declare void @llvm.immarg.inalloca(i32* inalloca(i32) immarg)
+declare void @llvm.immarg.inalloca(ptr inalloca(i32) immarg)
; CHECK: Attribute 'immarg' is incompatible with other attributes
declare void @llvm.immarg.inreg(i32 inreg immarg)
; CHECK: Attribute 'immarg' is incompatible with other attributes
-declare void @llvm.immarg.nest(i32* nest immarg)
+declare void @llvm.immarg.nest(ptr nest immarg)
; CHECK: Attribute 'immarg' is incompatible with other attributes
-declare void @llvm.immarg.sret(i32* sret(i32) immarg)
+declare void @llvm.immarg.sret(ptr sret(i32) immarg)
; CHECK: Attribute 'immarg' is incompatible with other attributes
declare void @llvm.immarg.zeroext(i32 zeroext immarg)
declare void @llvm.immarg.returned(i32 returned immarg)
; CHECK: Attribute 'immarg' is incompatible with other attributes
-declare void @llvm.immarg.noalias(i32* noalias immarg)
+declare void @llvm.immarg.noalias(ptr noalias immarg)
; CHECK: Attribute 'immarg' is incompatible with other attributes
-declare void @llvm.immarg.readnone(i32* readnone immarg)
+declare void @llvm.immarg.readnone(ptr readnone immarg)
; CHECK: Attribute 'immarg' is incompatible with other attributes
-declare void @llvm.immarg.readonly(i32* readonly immarg)
+declare void @llvm.immarg.readonly(ptr readonly immarg)
; CHECK: clause argument must be a constant
-define void @test(i32 %in) personality void()* null {
+define void @test(i32 %in) personality ptr null {
landingpad {} filter i32 %in
}
+++ /dev/null
-; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-; CHECK: <stdin>:4:13: error: explicit pointee type doesn't match operand's pointee type (i16 vs i32)
-define void @test(i32* %t) {
- %x = load i16, i32* %t
- ret void
-}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-; CHECK: <stdin>:4:18: error: expected comma after load's type
-define void @test(i32* %t) {
- %x = load i32* %t
+; CHECK: <stdin>:4:17: error: expected comma after load's type
+define void @test(ptr %t) {
+ %x = load ptr %t
ret void
}
; Tests bug: https://llvm.org/bugs/show_bug.cgi?id=24645
; CHECK: error: invalid type for inline asm constraint string
- !3=! {%..d04 *asm" !6!={!H)4" ,""
+ !3=! {ptr asm" !6!={!H)4" ,""
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: value has no uses
-uselistorder i32* @global, { 1, 0 }
+uselistorder ptr @global, { 1, 0 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: expected distinct uselistorder indexes in range [0, size)
@global = global i32 0
-@alias1 = alias i32, i32* @global
-@alias2 = alias i32, i32* @global
-@alias3 = alias i32, i32* @global
-uselistorder i32* @global, { 0, 0, 2 }
+@alias1 = alias i32, ptr @global
+@alias2 = alias i32, ptr @global
+@alias3 = alias i32, ptr @global
+uselistorder ptr @global, { 0, 0, 2 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: value has no uses
@global = global i32 0
-uselistorder i32* @global, { 1, 0 }
+uselistorder ptr @global, { 1, 0 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: value only has one use
@global = global i32 0
-@alias = alias i32, i32* @global
-uselistorder i32* @global, { 1, 0 }
+@alias = alias i32, ptr @global
+uselistorder ptr @global, { 1, 0 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: expected uselistorder indexes to change the order
@global = global i32 0
-@alias1 = alias i32, i32* @global
-@alias2 = alias i32, i32* @global
-@alias3 = alias i32, i32* @global
-uselistorder i32* @global, { 0, 1, 2 }
+@alias1 = alias i32, ptr @global
+@alias2 = alias i32, ptr @global
+@alias3 = alias i32, ptr @global
+uselistorder ptr @global, { 0, 1, 2 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: expected distinct uselistorder indexes in range [0, size)
@global = global i32 0
-@alias1 = alias i32, i32* @global
-@alias2 = alias i32, i32* @global
-@alias3 = alias i32, i32* @global
-uselistorder i32* @global, { 0, 3, 1 }
+@alias1 = alias i32, ptr @global
+@alias2 = alias i32, ptr @global
+@alias3 = alias i32, ptr @global
+uselistorder ptr @global, { 0, 3, 1 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: wrong number of indexes, expected 3
@global = global i32 0
-@alias1 = alias i32, i32* @global
-@alias2 = alias i32, i32* @global
-@alias3 = alias i32, i32* @global
-uselistorder i32* @global, { 1, 0 }
+@alias1 = alias i32, ptr @global
+@alias2 = alias i32, ptr @global
+@alias3 = alias i32, ptr @global
+uselistorder ptr @global, { 1, 0 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: wrong number of indexes, expected 2
@global = global i32 0
-@alias1 = alias i32, i32* @global
-@alias2 = alias i32, i32* @global
-uselistorder i32* @global, { 1, 0, 2 }
+@alias1 = alias i32, ptr @global
+@alias2 = alias i32, ptr @global
+uselistorder ptr @global, { 1, 0, 2 }
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-; CHECK: error: '@global' defined with type 'i32*'
-@global = global i32 0
-uselistorder i31* @global, { 1, 0 }
+; CHECK: error: '%x' defined with type 'i32' but expected 'float'
+define void @test(i32 %x) {
+ ret void
+
+ uselistorder float %x, { 1, 0 }
+}
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
; CHECK: error: invalid numeric label in uselistorder_bb
-@ba1 = constant i8* blockaddress (@foo, %1)
+@ba1 = constant ptr blockaddress (@foo, %1)
define void @foo() {
br label %1
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-; CHECK: invalid cast opcode for cast from '<4 x i32*>' to '<2 x i32*>'
-define <2 x i32*> @illegal_vector_pointer_bitcast_num_elements(<4 x i32*> %c) {
- %bc = bitcast <4 x i32*> %c to <2 x i32*>
- ret <2 x i32*> %bc
+; CHECK: invalid cast opcode for cast from '<4 x ptr>' to '<2 x ptr>'
+define <2 x ptr> @illegal_vector_pointer_bitcast_num_elements(<4 x ptr> %c) {
+ %bc = bitcast <4 x ptr> %c to <2 x ptr>
+ ret <2 x ptr> %bc
}
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: invalid cast opcode for cast from 'i64' to 'i64'
-@0 = global i64* inttoptr (i64 0 to i64)
+@0 = global ptr inttoptr (i64 0 to i64)
; Check that variables in a nonzero program address space 200 can be used in a invoke instruction
-define i8 @test_invoke(i8(i32)* %fnptr0, i8(i32) addrspace(200)* %fnptr200) personality i32 (...) addrspace(200)* @__gxx_personality_v0 {
+define i8 @test_invoke(ptr %fnptr0, ptr addrspace(200) %fnptr200) personality ptr addrspace(200) @__gxx_personality_v0 {
%explicit_as_0 = invoke addrspace(0) i8 %fnptr0(i32 0) to label %ok unwind label %lpad
%explicit_as_42 = invoke addrspace(200) i8 %fnptr200(i32 0) to label %ok unwind label %lpad
; The following is only okay if the program address space is 200:
%no_as = invoke i8 %fnptr200(i32 0) to label %ok unwind label %lpad
- ; CHECK: invoke-nonzero-program-addrspace.ll:[[@LINE-1]]:22: error: '%fnptr200' defined with type 'i8 (i32) addrspace(200)*' but expected 'i8 (i32)*'
+ ; CHECK: invoke-nonzero-program-addrspace.ll:[[@LINE-1]]:22: error: '%fnptr200' defined with type 'ptr addrspace(200)' but expected 'ptr'
ok:
ret i8 0
lpad:
- %exn = landingpad {i8*, i32}
+ %exn = landingpad {ptr, i32}
cleanup
unreachable
}
; PROGAS200: target datalayout = "P200"
-; PROGAS200: define i8 @test_invoke(i8 (i32)* %fnptr0, i8 (i32) addrspace(200)* %fnptr200) addrspace(200) personality i32 (...) addrspace(200)* @__gxx_personality_v0 {
+; PROGAS200: define i8 @test_invoke(ptr %fnptr0, ptr addrspace(200) %fnptr200) addrspace(200) personality ptr addrspace(200) @__gxx_personality_v0 {
; PROGAS200: %explicit_as_0 = invoke addrspace(0) i8 %fnptr0(i32 0)
; PROGAS200: %explicit_as_42 = invoke addrspace(200) i8 %fnptr200(i32 0)
; PROGAS200: %no_as = invoke addrspace(200) i8 %fnptr200(i32 0)
; CHECK: @c = local_unnamed_addr constant i32 0
@c = local_unnamed_addr constant i32 0
-; CHECK: @a = local_unnamed_addr alias i32, i32* @c
-@a = local_unnamed_addr alias i32, i32* @c
+; CHECK: @a = local_unnamed_addr alias i32, ptr @c
+@a = local_unnamed_addr alias i32, ptr @c
; CHECK: define void @f() local_unnamed_addr {
define void @f() local_unnamed_addr {
entry:
%before = alloca i32
call void @llvm.metadata(metadata i32 %arg)
- call void @llvm.metadata(metadata i32* %after)
- call void @llvm.metadata(metadata i32* %before)
+ call void @llvm.metadata(metadata ptr %after)
+ call void @llvm.metadata(metadata ptr %before)
%after = alloca i32
ret void
; CHECK: %before = alloca i32
; CHECK: call void @llvm.metadata(metadata i32 %arg)
-; CHECK: call void @llvm.metadata(metadata i32* %after)
-; CHECK: call void @llvm.metadata(metadata i32* %before)
+; CHECK: call void @llvm.metadata(metadata ptr %after)
+; CHECK: call void @llvm.metadata(metadata ptr %before)
; CHECK: %after = alloca i32
}
define void @foo() local_unnamed_addr !dbg !6 {
entry:
- %0 = load i64, i64* getelementptr inbounds ([10 x i64], [10 x i64]* @global_arr, i64 0, i64 4), align 16
- call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([10 x i64], [10 x i64]* @global_arr, i64 0, i64 5), metadata !10, metadata !DIExpression()), !dbg !13
- %1 = load i64, i64* getelementptr inbounds ([10 x i64], [10 x i64]* @global_arr, i64 0, i64 6), align 16
- call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([10 x i64], [10 x i64]* @global_arr, i64 0, i64 6), metadata !10, metadata !DIExpression()), !dbg !14
+ %0 = load i64, ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 4), align 16
+ call void @llvm.dbg.value(metadata ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 5), metadata !10, metadata !DIExpression()), !dbg !13
+ %1 = load i64, ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 6), align 16
+ call void @llvm.dbg.value(metadata ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 6), metadata !10, metadata !DIExpression()), !dbg !14
ret void
}
define void @bar() local_unnamed_addr !dbg !15 {
entry:
- call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([10 x i64], [10 x i64]* @global_arr, i64 0, i64 7), metadata !17, metadata !DIExpression()), !dbg !18
+ call void @llvm.dbg.value(metadata ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 7), metadata !17, metadata !DIExpression()), !dbg !18
ret void
}
define void @foo() {
entry:
- store i8 undef, i8* undef,
+ store i8 undef, ptr undef,
; CHECK: :[[@LINE+1]]:10: error: use of undefined metadata '!1'
!tbaa !1
unreachable
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
-; CHECK: [[@LINE+1]]:52: error: expected '{' in function body
-define i32* @test_mustprogress(i8 %a) mustprogress 8 {
+; CHECK: [[@LINE+1]]:51: error: expected '{' in function body
+define ptr @test_mustprogress(i8 %a) mustprogress 8 {
ret void
}
%struct.A = type { i32 }
-declare i8* @f(i8*, ...)
+declare ptr @f(ptr, ...)
-define i8* @f_thunk(i8* %this) {
- %rv = musttail call i8* (i8*, ...) @f(i8* %this, ...)
+define ptr @f_thunk(ptr %this) {
+ %rv = musttail call ptr (ptr, ...) @f(ptr %this, ...)
; CHECK: error: unexpected ellipsis in argument list for musttail call in non-varargs function
- ret i8* %rv
+ ret ptr %rv
}
%struct.A = type { i32 }
-declare i8* @f(i8*, ...)
+declare ptr @f(ptr, ...)
-define i8* @f_thunk(i8* %this, ...) {
- %rv = musttail call i8* (i8*, ...) @f(i8* %this)
+define ptr @f_thunk(ptr %this, ...) {
+ %rv = musttail call ptr (ptr, ...) @f(ptr %this)
; CHECK: error: expected '...' at end of argument list for musttail call in varargs function
- ret i8* %rv
+ ret ptr %rv
}
%struct.A = type { i32 }
-declare i8* @f(i8*, ...)
+declare ptr @f(ptr, ...)
-define i8* @f_thunk(i8* %this, ...) {
- %rv = musttail call i8* (i8*, ...) @f(i8* %this, ...)
- ret i8* %rv
+define ptr @f_thunk(ptr %this, ...) {
+ %rv = musttail call ptr (ptr, ...) @f(ptr %this, ...)
+ ret ptr %rv
}
-; CHECK-LABEL: define i8* @f_thunk(i8* %this, ...)
-; CHECK: %rv = musttail call i8* (i8*, ...) @f(i8* %this, ...)
+; CHECK-LABEL: define ptr @f_thunk(ptr %this, ...)
+; CHECK: %rv = musttail call ptr (ptr, ...) @f(ptr %this, ...)
define i32 @test(i32 %X) nounwind {
entry:
- %X_addr = alloca i32 ; <i32*> [#uses=2]
- %retval = alloca i32 ; <i32*> [#uses=2]
- %0 = alloca i32 ; <i32*>:0 [#uses=2]
+ %X_addr = alloca i32 ; <ptr> [#uses=2]
+ %retval = alloca i32 ; <ptr> [#uses=2]
+ %0 = alloca i32 ; <ptr>:0 [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %X, i32* %X_addr
- %1 = load i32, i32* %X_addr, align 4 ; <i32>:1 [#uses=1]
+ store i32 %X, ptr %X_addr
+ %1 = load i32, ptr %X_addr, align 4 ; <i32>:1 [#uses=1]
mul i32 %1, 4 ; <i32>:2 [#uses=1]
%3 = add i32 %2, 123 ; <i32>:3 [#uses=1]
- store i32 %3, i32* %0, align 4
+ store i32 %3, ptr %0, align 4
ret i32 %3
}
%int8x16x2_t = type { <16 x i8>, <16 x i8> }
-declare i32* @fake_personality_function()
+declare ptr @fake_personality_function()
declare void @func()
; Upgrading of invoked intrinsic.
-define void @test_invoke(i32 addrspace(1)* %b) gc "statepoint-example" personality i32* ()* @fake_personality_function {
+define void @test_invoke(ptr addrspace(1) %b) gc "statepoint-example" personality ptr @fake_personality_function {
; CHECK-LABEL: @test_invoke(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[D:%.*]] = getelementptr i32, ptr addrspace(1) [[B:%.*]], i64 16
; CHECK-NEXT: ret void
;
entry:
- %d = getelementptr i32, i32 addrspace(1)* %b, i64 16
- %safepoint_token = invoke token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) ["gc-live" (i32 addrspace(1)* %b, i32 addrspace(1)* %b, i32 addrspace(1)* %d, i32 addrspace(1)* %d)]
+ %d = getelementptr i32, ptr addrspace(1) %b, i64 16
+ %safepoint_token = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) ["gc-live" (ptr addrspace(1) %b, ptr addrspace(1) %b, ptr addrspace(1) %d, ptr addrspace(1) %d)]
to label %normal_dest unwind label %unwind_dest
normal_dest:
ret void
}
-define i8* @test_ptr_annotation(i8* %p) {
+define ptr @test_ptr_annotation(ptr %p) {
; CHECK-LABEL: @test_ptr_annotation(
; CHECK-NEXT: [[P2:%.*]] = call ptr @llvm.ptr.annotation.p0.p0(ptr [[P:%.*]], ptr undef, ptr undef, i32 undef, ptr undef)
; CHECK-NEXT: ret ptr [[P2]]
;
- %p2 = call i8* @llvm.ptr.annotation.p0i8(i8* %p, i8* undef, i8* undef, i32 undef, i8* undef)
- ret i8* %p2
+ %p2 = call ptr @llvm.ptr.annotation.p0(ptr %p, ptr undef, ptr undef, i32 undef, ptr undef)
+ ret ptr %p2
}
-define void @test_struct_return(%int8x16x2_t* %res.p, i8* %a) {
+define void @test_struct_return(ptr %res.p, ptr %a) {
; CHECK-LABEL: @test_struct_return(
; CHECK-NEXT: [[TMP1:%.*]] = call { <16 x i8>, <16 x i8> } @llvm.aarch64.neon.ld1x2.v16i8.p0(ptr [[A:%.*]])
; CHECK-NEXT: [[TMP2:%.*]] = extractvalue { <16 x i8>, <16 x i8> } [[TMP1]], 0
; CHECK-NEXT: store [[INT8X16X2_T]] [[TMP5]], ptr [[RES_P:%.*]], align 16
; CHECK-NEXT: ret void
;
- %res = call %int8x16x2_t @llvm.aarch64.neon.ld1x2.v16i8.p0i8(i8* %a)
- store %int8x16x2_t %res, %int8x16x2_t* %res.p
+ %res = call %int8x16x2_t @llvm.aarch64.neon.ld1x2.v16i8.p0(ptr %a)
+ store %int8x16x2_t %res, ptr %res.p
ret void
}
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
-declare i8* @llvm.ptr.annotation.p0i8(i8*, i8*, i8*, i32, i8*)
-declare %int8x16x2_t @llvm.aarch64.neon.ld1x2.v16i8.p0i8(i8*)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
+declare ptr @llvm.ptr.annotation.p0(ptr, ptr, ptr, i32, ptr)
+declare %int8x16x2_t @llvm.aarch64.neon.ld1x2.v16i8.p0(ptr)
unreachable
}
-define %T2* @f.resolver(ptr %p) {
+define ptr @f.resolver(ptr %p) {
alloca %T3
getelementptr %T4, ptr %p, i64 1
call void @f(ptr sret(%T5) %p)
; CHECK: @fptr1 = external global ptr
; CHECK: @fptr2 = external global ptr addrspace(1)
; CHECK: @fptr3 = external global ptr addrspace(2)
-@fptr1 = external global ptr ()*
-@fptr2 = external global ptr () addrspace(1)*
-@fptr3 = external global ptr () addrspace(1)* addrspace(2)*
+@fptr1 = external global ptr
+@fptr2 = external global ptr addrspace(1)
+@fptr3 = external global ptr addrspace(2)
; CHECK: @ifunc = ifunc void (), ptr @f
@ifunc = ifunc void (), ptr @f
; CHECK: define ptr @f(ptr %a) {
-; CHECK: %b = bitcast ptr %a to ptr
-; CHECK: ret ptr %b
+; CHECK: ret ptr %a
define ptr @f(ptr %a) {
- %b = bitcast ptr %a to ptr
- ret ptr %b
+ ret ptr %a
}
; CHECK: define ptr @g(ptr addrspace(2) %a) {
; CHECK: invoke void %p()
; CHECK: to label %continue unwind label %cleanup
declare void @personality()
-define void @invoke(ptr %p) personality void ()* @personality {
+define void @invoke(ptr %p) personality ptr @personality {
invoke void %p()
to label %continue unwind label %cleanup
@global = global i32 0
-@alias = private hidden alias i32, i32* @global
+@alias = private hidden alias i32, ptr @global
; CHECK: symbol with local linkage must have default visibility
@global = global i32 0
-@alias = private protected alias i32, i32* @global
+@alias = private protected alias i32, ptr @global
; CHECK: symbol with local linkage must have default visibility
declare void @foo(%fum*)
-; Will be remagled to @"llvm.ssa.copy.p0p0s_fum.1s"
-declare %fum.1** @"llvm.ssa.copy.p0p0s_fums"(%fum.1**)
+; Will be remagled to @"llvm.ssa.copy.s_fum.1s"
+declare %fum.1 @"llvm.ssa.copy.s_fums"(%fum.1)
-; Will be remagled to @"llvm.ssa.copy.p0p0s_fums"
-declare %fum** @"llvm.ssa.copy.p0p0s_fum.1s"(%fum**)
+; Will be remagled to @"llvm.ssa.copy.s_fums"
+declare %fum @"llvm.ssa.copy.s_fum.1s"(%fum)
-define void @foo1(%fum** %a, %fum.1 ** %b) {
- %b.copy = call %fum.1** @"llvm.ssa.copy.p0p0s_fums"(%fum.1** %b)
- %a.copy = call %fum** @"llvm.ssa.copy.p0p0s_fum.1s"(%fum** %a)
+define void @foo1(%fum %a, %fum.1 %b) {
+ %b.copy = call %fum.1 @"llvm.ssa.copy.s_fums"(%fum.1 %b)
+ %a.copy = call %fum @"llvm.ssa.copy.s_fum.1s"(%fum %a)
ret void
}
-define void @foo2(%fum.1 ** %b, %fum** %a) {
- %a.copy = call %fum** @"llvm.ssa.copy.p0p0s_fum.1s"(%fum** %a)
- %b.copy = call %fum.1** @"llvm.ssa.copy.p0p0s_fums"(%fum.1** %b)
+define void @foo2(%fum.1 %b, %fum %a) {
+ %a.copy = call %fum @"llvm.ssa.copy.s_fum.1s"(%fum %a)
+ %b.copy = call %fum.1 @"llvm.ssa.copy.s_fums"(%fum.1 %b)
ret void
}
; CHECK-DAG: %abb = type { %abc }
; CHECK-DAG: %abc = type { [4 x i8] }
-; CHECK-LABEL: define void @foo1(%fum** %a, %fum.1** %b) {
-; CHECK-NEXT: %b.copy = call %fum.1** @llvm.ssa.copy.p0p0s_fum.1s(%fum.1** %b)
-; CHECK-NEXT: %a.copy = call %fum** @llvm.ssa.copy.p0p0s_fums(%fum** %a)
+; CHECK-LABEL: define void @foo1(%fum %a, %fum.1 %b) {
+; CHECK-NEXT: %b.copy = call %fum.1 @llvm.ssa.copy.s_fum.1s(%fum.1 %b)
+; CHECK-NEXT: %a.copy = call %fum @llvm.ssa.copy.s_fums(%fum %a)
; CHECK-NEXT: ret void
-; CHECK-LABEL: define void @foo2(%fum.1** %b, %fum** %a) {
-; CHECK-NEXT: %a.copy = call %fum** @llvm.ssa.copy.p0p0s_fums(%fum** %a)
-; CHECK-NEXT: %b.copy = call %fum.1** @llvm.ssa.copy.p0p0s_fum.1s(%fum.1** %b)
+; CHECK-LABEL: define void @foo2(%fum.1 %b, %fum %a) {
+; CHECK-NEXT: %a.copy = call %fum @llvm.ssa.copy.s_fums(%fum %a)
+; CHECK-NEXT: %b.copy = call %fum.1 @llvm.ssa.copy.s_fum.1s(%fum.1 %b)
; CHECK-NEXT: ret void
-; CHECK: declare %fum.1** @llvm.ssa.copy.p0p0s_fum.1s(%fum.1** returned)
+; CHECK: declare %fum.1 @llvm.ssa.copy.s_fum.1s(%fum.1 returned)
-; CHECK: declare %fum** @llvm.ssa.copy.p0p0s_fums(%fum** returned)
+; CHECK: declare %fum @llvm.ssa.copy.s_fums(%fum returned)
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: <stdin>:[[@LINE+1]]:32: error: expected '('{{$}}
-define void @test_sret(i8* sret) {
+define void @test_sret(ptr sret) {
ret void
}
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
-; CHECK: define void @foo(i32* sret(i32) align 4 %0)
-define void @foo(i32* sret(i32) align 4 %0) {
+; CHECK: define void @foo(ptr sret(i32) align 4 %0)
+define void @foo(ptr sret(i32) align 4 %0) {
ret void
}
-; CHECK: define void @bar({ i32*, i8 }* sret({ i32*, i8 }) align 4 %0)
-define void @bar({i32*, i8}* sret({i32*, i8}) align 4 %0) {
+; CHECK: define void @bar(ptr sret({ ptr, i8 }) align 4 %0)
+define void @bar(ptr sret({ptr, i8}) align 4 %0) {
ret void
}
-define void @caller({ i32*, i8 }* %ptr) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
-; CHECK: call void @bar({ i32*, i8 }* sret({ i32*, i8 }) %ptr)
-; CHECK: invoke void @bar({ i32*, i8 }* sret({ i32*, i8 }) %ptr)
- call void @bar({i32*, i8}* sret({i32*, i8}) %ptr)
- invoke void @bar({i32*, i8}* sret({i32*, i8}) %ptr) to label %success unwind label %fail
+define void @caller(ptr %ptr) personality ptr @__gxx_personality_v0 {
+; CHECK: call void @bar(ptr sret({ ptr, i8 }) %ptr)
+; CHECK: invoke void @bar(ptr sret({ ptr, i8 }) %ptr)
+ call void @bar(ptr sret({ptr, i8}) %ptr)
+ invoke void @bar(ptr sret({ptr, i8}) %ptr) to label %success unwind label %fail
success:
ret void
fail:
- landingpad { i8*, i32 } cleanup
+ landingpad { ptr, i32 } cleanup
ret void
}
-; CHECK: declare void @baz([8 x i8]* sret([8 x i8]))
+; CHECK: declare void @baz(ptr sret([8 x i8]))
%named_type = type [8 x i8]
-declare void @baz(%named_type* sret(%named_type))
+declare void @baz(ptr sret(%named_type))
declare i32 @__gxx_personality_v0(...)
%0 = type opaque
-; CHECK: define void @anon({ %0* }* sret({ %0* }) %arg)
-; CHECK: call void @anon_callee({ %0* }* sret({ %0* }) %arg)
-define void @anon({ %0* }* sret({ %0* }) %arg) {
- call void @anon_callee({ %0* }* sret({ %0* }) %arg)
+; CHECK: define void @anon(ptr sret({ ptr }) %arg)
+; CHECK: call void @anon_callee(ptr sret({ ptr }) %arg)
+define void @anon(ptr sret({ ptr }) %arg) {
+ call void @anon_callee(ptr sret({ ptr }) %arg)
ret void
}
-; CHECK: declare void @anon_callee({ %0* }* sret({ %0* }))
-declare void @anon_callee({ %0* }* sret({ %0* }))
+; CHECK: declare void @anon_callee(ptr sret({ ptr }))
+declare void @anon_callee(ptr sret({ ptr }))
target datalayout = "e-m:e-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 }
-@_ZTV1B = 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
-@_ZTV1C = 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
+@_ZTV1B = constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1B1fEi, ptr @_ZN1A1nEi] }, !type !0, !type !1
+@_ZTV1C = constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr undef, ptr @_ZN1C1fEi, ptr @_ZN1A1nEi] }, !type !0, !type !2
-declare i32 @_ZN1B1fEi(%struct.B*, i32)
+declare i32 @_ZN1B1fEi(ptr, i32)
-declare i32 @_ZN1A1nEi(%struct.A*, i32)
+declare i32 @_ZN1A1nEi(ptr, i32)
-declare i32 @_ZN1C1fEi(%struct.C*, i32)
+declare i32 @_ZN1C1fEi(ptr, i32)
!0 = !{i64 16, !"_ZTS1A"}
!1 = !{i64 16, !"_ZTS1B"}
define i32 @main() unnamed_addr nounwind ssp {
entry:
- %call2 = tail call i32 @zed(%struct.foobar* @foo.d, %struct.foobar* @bar.d) nounwind
+ %call2 = tail call i32 @zed(ptr @foo.d, ptr @bar.d) nounwind
ret i32 0
}
-declare i32 @zed(%struct.foobar*, %struct.foobar*)
+declare i32 @zed(ptr, ptr)
; CHECK: @bar.d = internal unnamed_addr constant %struct.foobar zeroinitializer, align 4
; CHECK: @foo.d = internal constant %struct.foobar zeroinitializer, align 4
@1 = private constant i32 1
; CHECK: @1 = private constant i32 1
-@2 = private alias i32, i32* @3
-; CHECK: @2 = private alias i32, i32* @3
-@3 = private alias i32, i32* @1
-; CHECK: @3 = private alias i32, i32* @1
+@2 = private alias i32, ptr @3
+; CHECK: @2 = private alias i32, ptr @3
+@3 = private alias i32, ptr @1
+; CHECK: @3 = private alias i32, ptr @1
@0 = global i32 0
@1 = global float 3.0
-@2 = global i8* null
+@2 = global ptr null
@3 = global x86_fp80 0xK4001E000000000000000
-define float @foo(%0* %p) nounwind {
- %t = load %0, %0* %p ; <%0> [#uses=2]
+define float @foo(ptr %p) nounwind {
+ %t = load %0, ptr %p ; <%0> [#uses=2]
%s = extractvalue %0 %t, 1, 0 ; <float> [#uses=1]
%r = insertvalue %0 %t, double 2.000000e+00, 1, 1; <%0> [#uses=1]
- store %0 %r, %0* %p
+ store %0 %r, ptr %p
ret float %s
}
-define float @bar(%0* %p) nounwind {
- store %0 { %1 { i32 4 }, %2 { float 4.000000e+00, double 2.000000e+01 } }, %0* %p
+define float @bar(ptr %p) nounwind {
+ store %0 { %1 { i32 4 }, %2 { float 4.000000e+00, double 2.000000e+01 } }, ptr %p
ret float 7.000000e+00
}
-define float @car(%0* %p) nounwind {
- store %0 { %1 undef, %2 { float undef, double 2.000000e+01 } }, %0* %p
+define float @car(ptr %p) nounwind {
+ store %0 { %1 undef, %2 { float undef, double 2.000000e+01 } }, ptr %p
ret float undef
}
-define float @dar(%0* %p) nounwind {
- store %0 { %1 zeroinitializer, %2 { float 0.000000e+00, double 2.000000e+01 } }, %0* %p
+define float @dar(ptr %p) nounwind {
+ store %0 { %1 zeroinitializer, %2 { float 0.000000e+00, double 2.000000e+01 } }, ptr %p
ret float 0.000000e+00
}
-define i32* @qqq() {
- ret i32* @0
+define ptr @qqq() {
+ ret ptr @0
}
-define float* @rrr() {
- ret float* @1
+define ptr @rrr() {
+ ret ptr @1
}
-define i8** @sss() {
- ret i8** @2
+define ptr @sss() {
+ ret ptr @2
}
-define x86_fp80* @nnn() {
- ret x86_fp80* @3
+define ptr @nnn() {
+ ret ptr @3
}
; CHECK: base element of getelementptr must be sized
%myTy = type { %myTy }
-define void @foo(%myTy* %p){
- %0 = getelementptr %myTy, %myTy* %p, i32 0
+define void @foo(ptr %p){
+ getelementptr %myTy, ptr %p, i64 1
ret void
}
; RUN: verify-uselistorder < %s
@a = global [4 x i1] [i1 0, i1 1, i1 0, i1 1]
-@b = alias i1, getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2)
+@b = alias i1, getelementptr ([4 x i1], ptr @a, i64 0, i64 2)
; Check use-list order of constants used by globals.
@glob1 = global i5 7
define i1 @loada() {
entry:
- %a = load i1, i1* getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2)
+ %a = load i1, ptr getelementptr ([4 x i1], ptr @a, i64 0, i64 2)
ret i1 %a
}
uselistorder i5 7, { 1, 0, 2 }
-uselistorder i1* getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2), { 1, 0 }
+uselistorder ptr getelementptr ([4 x i1], ptr @a, i64 0, i64 2), { 1, 0 }
; CHECK-NOT: warning
; RUN: verify-uselistorder < %s
-@ba1 = constant i8* blockaddress (@bafunc1, %bb)
-@ba2 = constant i8* getelementptr (i8, i8* blockaddress (@bafunc2, %bb), i61 0)
-@ba3 = constant i8* getelementptr (i8, i8* blockaddress (@bafunc2, %bb), i61 0)
+@ba1 = constant ptr blockaddress (@bafunc1, %bb)
+@ba2 = constant ptr getelementptr (i8, ptr blockaddress (@bafunc2, %bb), i61 0)
+@ba3 = constant ptr getelementptr (i8, ptr blockaddress (@bafunc2, %bb), i61 0)
-define i8* @babefore() {
- ret i8* getelementptr (i8, i8* blockaddress (@bafunc2, %bb), i61 0)
+define ptr @babefore() {
+ ret ptr getelementptr (i8, ptr blockaddress (@bafunc2, %bb), i61 0)
bb1:
- ret i8* blockaddress (@bafunc1, %bb)
+ ret ptr blockaddress (@bafunc1, %bb)
bb2:
- ret i8* blockaddress (@bafunc3, %bb)
+ ret ptr blockaddress (@bafunc3, %bb)
}
define void @bafunc1() {
br label %bb
bb:
unreachable
}
-define i8* @baafter() {
- ret i8* blockaddress (@bafunc2, %bb)
+define ptr @baafter() {
+ ret ptr blockaddress (@bafunc2, %bb)
bb1:
- ret i8* blockaddress (@bafunc1, %bb)
+ ret ptr blockaddress (@bafunc1, %bb)
bb2:
- ret i8* blockaddress (@bafunc3, %bb)
+ ret ptr blockaddress (@bafunc3, %bb)
}
uselistorder_bb @bafunc1, %bb, { 1, 0 }
; CHECK: define void @func2() {
; CHECK-NOT: uselistorder
; CHECK: }
-; CHECK: uselistorder i32* @g, { 3, 2, 1, 0 }
+; CHECK: uselistorder ptr @g, { 3, 2, 1, 0 }
@g = external global i32
define void @func1() {
- load i32, i32* @g
- load i32, i32* @g
+ load i32, ptr @g
+ load i32, ptr @g
ret void
}
define void @func2() {
- load i32, i32* @g
- load i32, i32* @g
+ load i32, ptr @g
+ load i32, ptr @g
ret void
}
-uselistorder i32* @g, { 3, 2, 1, 0 }
+uselistorder ptr @g, { 3, 2, 1, 0 }
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i686-apple-darwin9.2.2"
-; CHECK: @1 = global <4 x i1> <i1 icmp slt (i32 ptrtoint (i32* @B to i32), i32 1), i1 true, i1 false, i1 true>
+; CHECK: @1 = global <4 x i1> <i1 icmp slt (i32 ptrtoint (ptr @B to i32), i32 1), i1 true, i1 false, i1 true>
define <4 x i1> @foo(<4 x float> %a, <4 x float> %b) nounwind {
entry:
@0 = global <4 x i1> icmp slt ( <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 1, i32 2, i32 1, i32 2> )
@B = external global i32
-@1 = global <4 x i1> icmp slt ( <4 x i32> <i32 ptrtoint (i32 * @B to i32), i32 1, i32 1, i32 1>, <4 x i32> <i32 1, i32 2, i32 1, i32 2> )
+@1 = global <4 x i1> icmp slt ( <4 x i32> <i32 ptrtoint (ptr @B to i32), i32 1, i32 1, i32 1>, <4 x i32> <i32 1, i32 2, i32 1, i32 2> )
ret void
}
-; CHECK: define x86_intrcc void @byval_arg(i32* byval(i32) %0) {
-define x86_intrcc void @byval_arg(i32* byval(i32)) {
+; CHECK: define x86_intrcc void @byval_arg(ptr byval(i32) %0) {
+define x86_intrcc void @byval_arg(ptr byval(i32)) {
ret void
}