| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 | |
| ; RUN: opt -passes=verify -S < %s | FileCheck %s | |
| ; | |
| ; Pointer/byte bitcasts must have matching sizes, using the per-address-space | |
| ; pointer size from the DataLayout, including scalable vector types. | |
| target datalayout = "e-p:64:64:64-p1:32:32:32" | |
| define void @f(ptr %p, ptr addrspace(1) %p1, <2 x ptr addrspace(1)> %p1v, <vscale x 4 x ptr> %sp, <vscale x 4 x b8> %sb) { | |
| ; CHECK-LABEL: define void @f( | |
| ; CHECK-SAME: ptr [[P:%.*]], ptr addrspace(1) [[P1:%.*]], <2 x ptr addrspace(1)> [[P1V:%.*]], <vscale x 4 x ptr> [[SP:%.*]], <vscale x 4 x b8> [[SB:%.*]]) { | |
| ; CHECK-NEXT: [[A:%.*]] = bitcast ptr [[P]] to b64 | |
| ; CHECK-NEXT: [[B:%.*]] = bitcast ptr addrspace(1) [[P1]] to b32 | |
| ; CHECK-NEXT: [[C:%.*]] = bitcast <2 x ptr addrspace(1)> [[P1V]] to b64 | |
| ; CHECK-NEXT: [[D:%.*]] = bitcast <vscale x 4 x ptr> [[SP]] to <vscale x 8 x b32> | |
| ; CHECK-NEXT: [[E:%.*]] = bitcast <vscale x 4 x b8> [[SB]] to <vscale x 4 x i8> | |
| ; CHECK-NEXT: ret void | |
| ; | |
| %a = bitcast ptr %p to b64 | |
| %b = bitcast ptr addrspace(1) %p1 to b32 | |
| %c = bitcast <2 x ptr addrspace(1)> %p1v to b64 | |
| %d = bitcast <vscale x 4 x ptr> %sp to <vscale x 8 x b32> | |
| %e = bitcast <vscale x 4 x b8> %sb to <vscale x 4 x i8> | |
| ret void | |
| } |