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

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 20:31:41 PDT 2016


Addressed this in https://reviews.llvm.org/rL277414  Let me know if I
should add more tests.

On Mon, Aug 1, 2016 at 8:05 PM, Matt Arsenault <arsenm2 at gmail.com> wrote:
>
> 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



-- 
Sanjoy Das
http://playingwithpointers.com


More information about the llvm-commits mailing list