summaryrefslogtreecommitdiffstats
path: root/test/Verifier
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-08-02 02:55:57 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-08-02 02:55:57 +0000
commit308cf93891504826485e704abc30d7eef31aa36c (patch)
tree6f99b93fa5cd373a9ac37cb09ea9ebb2176b3735 /test/Verifier
parentb1fa8fe7279a1a651b05768649c50c07c4d9c39c (diff)
[Verifier] Disallow illegal ptr<->int casts in ConstantExprs
This should have been a part of rL277085, but I hadn't considered this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277413 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Verifier')
-rw-r--r--test/Verifier/non-integral-pointers.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Verifier/non-integral-pointers.ll b/test/Verifier/non-integral-pointers.ll
index 221dd3505224..02eda34bf615 100644
--- a/test/Verifier/non-integral-pointers.ll
+++ b/test/Verifier/non-integral-pointers.ll
@@ -43,3 +43,15 @@ define i64 @f_6(i8 addrspace(6)* %ptr) {
%val = ptrtoint i8 addrspace(6)* %ptr to i64
ret i64 %val
}
+
+define i8 addrspace(4)* @f_7() {
+; CHECK: inttoptr not supported for non-integral pointers
+ ret i8 addrspace(4)* inttoptr (i64 50 to i8 addrspace(4)*)
+}
+
+@global0 = addrspace(4) constant i8 42
+
+define i64 @f_8() {
+; CHECK: ptrtoint not supported for non-integral pointers
+ ret i64 ptrtoint (i8 addrspace(4)* @global0 to i64)
+}