Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaOpenCL / vector_inc_dec_ops.cl
blob1e3c599453d00dc16be7c5af4e6f2003e3375d55
1 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
3 typedef __attribute__((ext_vector_type(2))) char char2;
4 typedef __attribute__((ext_vector_type(4))) unsigned int uint4;
5 typedef __attribute__((ext_vector_type(8))) long long8;
6 typedef __attribute__((ext_vector_type(4))) float float4;
8 void vectorIncrementDecrementOps(void)
10 char2 A = (char2)(1);
11 uint4 B = (uint4)(1);
12 long8 C = (long8)(1);
14 A++;
15 --A;
16 B--;
17 ++B;
18 C++;
21 void invalidIncrementDecrementOps(void) {
22 ((float4)(1.0f))++; // expected-error{{cannot increment value of type 'float4'}}
23 float4 i;
24 ++i; // expected-error{{cannot increment value of type '__private float4'}}
25 i--; // expected-error{{cannot decrement value of type '__private float4'}}