[llvm] r277413 - [Verifier] Disallow illegal ptr<->int casts in ConstantExprs

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 20:05:19 PDT 2016


> On Aug 1, 2016, at 19:55, Sanjoy Das via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> }
> +
> +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)*)
> +}
> +
> + at 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)
> +}
> 
> 
> _________________________________

I think you need some more complex tests with nested constantexpers, e.g. the ptrtoint result is feeding into another constantexpr, e.g. a GEP index

-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160801/091dfb23/attachment.html>


More information about the llvm-commits mailing list