brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · c8a58fe Raw
29 lines · plain
1//RUN: %clang_cc1 %s -triple spir -emit-llvm -O0 -o - | FileCheck %s2 3typedef int int2 __attribute__((ext_vector_type(2)));4typedef int int4 __attribute__((ext_vector_type(4)));5typedef long long2 __attribute__((ext_vector_type(2)));6 7//CHECK-LABEL: define{{.*}} spir_func void @_Z3barPU3AS1Dv2_i8void bar(global int2 *in) {9  //CHECK: bitcast <2 x i32> %{{[0-9]+}} to i6410  auto l = reinterpret_cast<long>(in[0]);11  //CHECK: bitcast i64 %{{[0-9]+}} to <2 x i32>12  auto i2 = reinterpret_cast<int2>(l);13 14  __private short s1;15  // CHECK: %{{[0-9]+}} = load i16, ptr %s1, align 216  // CHECK-NEXT: store i16 %{{[0-9]+}}, ptr %s2, align 217  auto s2 = reinterpret_cast<__private short>(s1);18  // CHECK: %{{[0-9]+}} = load i16, ptr %s1, align 219  // CHECK-NEXT: store i16 %{{[0-9]+}}, ptr %s3, align 220  auto s3 = reinterpret_cast<decltype(s1)>(s1);21  // CHECK: %{{[0-9]+}} = load i16, ptr %s1, align 222  // CHECK-NEXT: store i16 %{{[0-9]+}}, ptr %s4, align 223  auto s4 = reinterpret_cast<__global short>(s1);24 25  int4 i4;26  //CHECK: bitcast <4 x i32> %{{[0-9]+}} to <2 x i64>27  auto l2 = reinterpret_cast<long2>(i4);28}29