1 ; RUN: not opt -verify < %s 2>&1 | FileCheck %s
3 target datalayout = "e-ni:4:6"
5 define i64 @f_0(i8 addrspace(4)* %ptr) {
6 ; CHECK: ptrtoint not supported for non-integral pointers
7 %val = ptrtoint i8 addrspace(4)* %ptr to i64
11 define <4 x i64> @f_1(<4 x i8 addrspace(4)*> %ptr) {
12 ; CHECK: ptrtoint not supported for non-integral pointers
13 %val = ptrtoint <4 x i8 addrspace(4)*> %ptr to <4 x i64>
17 define i64 @f_2(i8 addrspace(3)* %ptr) {
19 %val = ptrtoint i8 addrspace(3)* %ptr to i64
23 define i8 addrspace(4)* @f_3(i64 %integer) {
24 ; CHECK: inttoptr not supported for non-integral pointers
25 %val = inttoptr i64 %integer to i8 addrspace(4)*
26 ret i8 addrspace(4)* %val
29 define <4 x i8 addrspace(4)*> @f_4(<4 x i64> %integer) {
30 ; CHECK: inttoptr not supported for non-integral pointers
31 %val = inttoptr <4 x i64> %integer to <4 x i8 addrspace(4)*>
32 ret <4 x i8 addrspace(4)*> %val
35 define i8 addrspace(3)* @f_5(i64 %integer) {
37 %val = inttoptr i64 %integer to i8 addrspace(3)*
38 ret i8 addrspace(3)* %val
41 define i64 @f_6(i8 addrspace(6)* %ptr) {
42 ; CHECK: ptrtoint not supported for non-integral pointers
43 %val = ptrtoint i8 addrspace(6)* %ptr to i64
47 define i8 addrspace(4)* @f_7() {
48 ; CHECK: inttoptr not supported for non-integral pointers
49 ret i8 addrspace(4)* inttoptr (i64 50 to i8 addrspace(4)*)
52 @global0 = addrspace(4) constant i8 42
55 ; CHECK: ptrtoint not supported for non-integral pointers
56 ret i64 ptrtoint (i8 addrspace(4)* @global0 to i64)
59 define i8 addrspace(4)* @f_9() {
60 ; CHECK: inttoptr not supported for non-integral pointers
61 ret i8 addrspace(4)* getelementptr (i8, i8 addrspace(4)* inttoptr (i64 55 to i8 addrspace(4)*), i32 100)
64 @global1 = addrspace(4) constant i8 42
66 define i8 addrspace(4)* @f_10() {
67 ; CHECK: ptrtoint not supported for non-integral pointers
68 ret i8 addrspace(4)* getelementptr (i8, i8 addrspace(4)* @global0, i64 ptrtoint (i8 addrspace(4)* @global1 to i64))
71 @cycle_0 = addrspace(4) constant i64 ptrtoint (i64 addrspace(4)* addrspace(4)* @cycle_1 to i64)
72 @cycle_1 = addrspace(4) constant i64 addrspace(4) * @cycle_0
74 define i64 addrspace(4)* addrspace(4)* @f_11() {
75 ; CHECK: ptrtoint not supported for non-integral pointers
76 ret i64 addrspace(4)* addrspace(4)* @cycle_1
79 @cycle_self = addrspace(4) constant i64 ptrtoint (i64 addrspace(4)* @cycle_self to i64)
81 define i64 addrspace(4)* @f_12() {
82 ; CHECK: ptrtoint not supported for non-integral pointers
83 ret i64 addrspace(4)* @cycle_self