address-spaces.ll 652 B

12345678910111213141516171819202122232425
  1. ; RUN: opt -lint < %s
  2. target datalayout = "p32:32:32-p1:16:16:16-n16:32"
  3. declare void @foo(i64) nounwind
  4. define i64 @test1(i32 addrspace(1)* %x) nounwind {
  5. %y = ptrtoint i32 addrspace(1)* %x to i64
  6. ret i64 %y
  7. }
  8. define <4 x i64> @test1_vector(<4 x i32 addrspace(1)*> %x) nounwind {
  9. %y = ptrtoint <4 x i32 addrspace(1)*> %x to <4 x i64>
  10. ret <4 x i64> %y
  11. }
  12. define i32 addrspace(1)* @test2(i64 %x) nounwind {
  13. %y = inttoptr i64 %x to i32 addrspace(1)*
  14. ret i32 addrspace(1)* %y
  15. }
  16. define <4 x i32 addrspace(1)*> @test2_vector(<4 x i64> %x) nounwind {
  17. %y = inttoptr <4 x i64> %x to <4 x i32 addrspace(1)*>
  18. ret <4 x i32 addrspace(1)*> %y
  19. }