brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · a318be0 Raw
24 lines · plain
1// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.12// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.03// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.04// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++1.05// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++20216 7typedef float float4 __attribute__((ext_vector_type(4)));8typedef __attribute__((ext_vector_type(8))) bool BoolVector; // expected-error {{invalid vector element type 'bool'}}9 10void test_ext_vector_accessors(float4 V) {11  V = V.wzyx;12 13  V = V.abgr;14#if ((defined(__OPENCL_C_VERSION__) && __OPENCL_C_VERSION__ < 300) || (defined(__OPENCL_CPP_VERSION__) && __OPENCL_CPP_VERSION__ < 202100))15  // expected-warning@-2 {{vector component name 'a' is a feature from OpenCL version 3.0 onwards}}16#endif17 18  V = V.xyzr;19  // expected-error@-1 {{illegal vector component name 'r'}}20#if ((defined(__OPENCL_C_VERSION__) && __OPENCL_C_VERSION__ < 300) || (defined(__OPENCL_CPP_VERSION__) && __OPENCL_CPP_VERSION__ < 202100))21  // expected-warning@-3 {{vector component name 'r' is a feature from OpenCL version 3.0 onwards}}22#endif23}24