|
1 |
| -; RUN: not opt -verify < %s 2>&1 | FileCheck %s |
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
| 2 | +; RUN: opt -verify -S < %s 2>&1 | FileCheck %s |
2 | 3 |
|
3 | 4 | target datalayout = "e-ni:4:6"
|
4 | 5 |
|
5 | 6 | define i64 @f_0(i8 addrspace(4)* %ptr) {
|
6 |
| -; CHECK: ptrtoint not supported for non-integral pointers |
| 7 | +; CHECK-LABEL: @f_0( |
| 8 | +; CHECK-NEXT: [[VAL:%.*]] = ptrtoint i8 addrspace(4)* [[PTR:%.*]] to i64 |
| 9 | +; CHECK-NEXT: ret i64 [[VAL]] |
| 10 | +; |
7 | 11 | %val = ptrtoint i8 addrspace(4)* %ptr to i64
|
8 | 12 | ret i64 %val
|
9 | 13 | }
|
10 | 14 |
|
11 | 15 | define <4 x i64> @f_1(<4 x i8 addrspace(4)*> %ptr) {
|
12 |
| -; CHECK: ptrtoint not supported for non-integral pointers |
| 16 | +; CHECK-LABEL: @f_1( |
| 17 | +; CHECK-NEXT: [[VAL:%.*]] = ptrtoint <4 x i8 addrspace(4)*> [[PTR:%.*]] to <4 x i64> |
| 18 | +; CHECK-NEXT: ret <4 x i64> [[VAL]] |
| 19 | +; |
13 | 20 | %val = ptrtoint <4 x i8 addrspace(4)*> %ptr to <4 x i64>
|
14 | 21 | ret <4 x i64> %val
|
15 | 22 | }
|
16 | 23 |
|
17 | 24 | define i64 @f_2(i8 addrspace(3)* %ptr) {
|
18 |
| -; Negative test |
| 25 | +; CHECK-LABEL: @f_2( |
| 26 | +; CHECK-NEXT: [[VAL:%.*]] = ptrtoint i8 addrspace(3)* [[PTR:%.*]] to i64 |
| 27 | +; CHECK-NEXT: ret i64 [[VAL]] |
| 28 | +; |
19 | 29 | %val = ptrtoint i8 addrspace(3)* %ptr to i64
|
20 | 30 | ret i64 %val
|
21 | 31 | }
|
22 | 32 |
|
23 | 33 | define i8 addrspace(4)* @f_3(i64 %integer) {
|
24 |
| -; CHECK: inttoptr not supported for non-integral pointers |
| 34 | +; CHECK-LABEL: @f_3( |
| 35 | +; CHECK-NEXT: [[VAL:%.*]] = inttoptr i64 [[INTEGER:%.*]] to i8 addrspace(4)* |
| 36 | +; CHECK-NEXT: ret i8 addrspace(4)* [[VAL]] |
| 37 | +; |
25 | 38 | %val = inttoptr i64 %integer to i8 addrspace(4)*
|
26 | 39 | ret i8 addrspace(4)* %val
|
27 | 40 | }
|
28 | 41 |
|
29 | 42 | define <4 x i8 addrspace(4)*> @f_4(<4 x i64> %integer) {
|
30 |
| -; CHECK: inttoptr not supported for non-integral pointers |
| 43 | +; CHECK-LABEL: @f_4( |
| 44 | +; CHECK-NEXT: [[VAL:%.*]] = inttoptr <4 x i64> [[INTEGER:%.*]] to <4 x i8 addrspace(4)*> |
| 45 | +; CHECK-NEXT: ret <4 x i8 addrspace(4)*> [[VAL]] |
| 46 | +; |
31 | 47 | %val = inttoptr <4 x i64> %integer to <4 x i8 addrspace(4)*>
|
32 | 48 | ret <4 x i8 addrspace(4)*> %val
|
33 | 49 | }
|
34 | 50 |
|
35 | 51 | define i8 addrspace(3)* @f_5(i64 %integer) {
|
36 |
| -; Negative test |
| 52 | +; CHECK-LABEL: @f_5( |
| 53 | +; CHECK-NEXT: [[VAL:%.*]] = inttoptr i64 [[INTEGER:%.*]] to i8 addrspace(3)* |
| 54 | +; CHECK-NEXT: ret i8 addrspace(3)* [[VAL]] |
| 55 | +; |
37 | 56 | %val = inttoptr i64 %integer to i8 addrspace(3)*
|
38 | 57 | ret i8 addrspace(3)* %val
|
39 | 58 | }
|
40 | 59 |
|
41 | 60 | define i64 @f_6(i8 addrspace(6)* %ptr) {
|
42 |
| -; CHECK: ptrtoint not supported for non-integral pointers |
| 61 | +; CHECK-LABEL: @f_6( |
| 62 | +; CHECK-NEXT: [[VAL:%.*]] = ptrtoint i8 addrspace(6)* [[PTR:%.*]] to i64 |
| 63 | +; CHECK-NEXT: ret i64 [[VAL]] |
| 64 | +; |
43 | 65 | %val = ptrtoint i8 addrspace(6)* %ptr to i64
|
44 | 66 | ret i64 %val
|
45 | 67 | }
|
46 | 68 |
|
47 | 69 | define i8 addrspace(4)* @f_7() {
|
48 |
| -; CHECK: inttoptr not supported for non-integral pointers |
| 70 | +; CHECK-LABEL: @f_7( |
| 71 | +; CHECK-NEXT: ret i8 addrspace(4)* inttoptr (i64 50 to i8 addrspace(4)*) |
| 72 | +; |
49 | 73 | ret i8 addrspace(4)* inttoptr (i64 50 to i8 addrspace(4)*)
|
50 | 74 | }
|
51 | 75 |
|
52 | 76 | @global0 = addrspace(4) constant i8 42
|
53 | 77 |
|
54 | 78 | define i64 @f_8() {
|
55 |
| -; CHECK: ptrtoint not supported for non-integral pointers |
| 79 | +; CHECK-LABEL: @f_8( |
| 80 | +; CHECK-NEXT: ret i64 ptrtoint (i8 addrspace(4)* @global0 to i64) |
| 81 | +; |
56 | 82 | ret i64 ptrtoint (i8 addrspace(4)* @global0 to i64)
|
57 | 83 | }
|
58 | 84 |
|
59 | 85 | define i8 addrspace(4)* @f_9() {
|
60 |
| -; CHECK: inttoptr not supported for non-integral pointers |
| 86 | +; CHECK-LABEL: @f_9( |
| 87 | +; CHECK-NEXT: ret i8 addrspace(4)* getelementptr (i8, i8 addrspace(4)* inttoptr (i64 55 to i8 addrspace(4)*), i32 100) |
| 88 | +; |
61 | 89 | ret i8 addrspace(4)* getelementptr (i8, i8 addrspace(4)* inttoptr (i64 55 to i8 addrspace(4)*), i32 100)
|
62 | 90 | }
|
63 | 91 |
|
64 | 92 | @global1 = addrspace(4) constant i8 42
|
65 | 93 |
|
66 | 94 | define i8 addrspace(4)* @f_10() {
|
67 |
| -; CHECK: ptrtoint not supported for non-integral pointers |
| 95 | +; CHECK-LABEL: @f_10( |
| 96 | +; CHECK-NEXT: ret i8 addrspace(4)* getelementptr (i8, i8 addrspace(4)* @global0, i64 ptrtoint (i8 addrspace(4)* @global1 to i64)) |
| 97 | +; |
68 | 98 | ret i8 addrspace(4)* getelementptr (i8, i8 addrspace(4)* @global0, i64 ptrtoint (i8 addrspace(4)* @global1 to i64))
|
69 | 99 | }
|
70 | 100 |
|
71 | 101 | @cycle_0 = addrspace(4) constant i64 ptrtoint (i64 addrspace(4)* addrspace(4)* @cycle_1 to i64)
|
72 | 102 | @cycle_1 = addrspace(4) constant i64 addrspace(4) * @cycle_0
|
73 | 103 |
|
74 | 104 | define i64 addrspace(4)* addrspace(4)* @f_11() {
|
75 |
| -; CHECK: ptrtoint not supported for non-integral pointers |
| 105 | +; CHECK-LABEL: @f_11( |
| 106 | +; CHECK-NEXT: ret i64 addrspace(4)* addrspace(4)* @cycle_1 |
| 107 | +; |
76 | 108 | ret i64 addrspace(4)* addrspace(4)* @cycle_1
|
77 | 109 | }
|
78 | 110 |
|
79 | 111 | @cycle_self = addrspace(4) constant i64 ptrtoint (i64 addrspace(4)* @cycle_self to i64)
|
80 | 112 |
|
81 | 113 | define i64 addrspace(4)* @f_12() {
|
82 |
| -; CHECK: ptrtoint not supported for non-integral pointers |
| 114 | +; CHECK-LABEL: @f_12( |
| 115 | +; CHECK-NEXT: ret i64 addrspace(4)* @cycle_self |
| 116 | +; |
83 | 117 | ret i64 addrspace(4)* @cycle_self
|
84 | 118 | }
|
0 commit comments