[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Sema / typedef-retain.c
blob2d94a8f665fe3dbc30802b9946fc1248194e40e9
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -flax-vector-conversions=none
3 typedef float float4 __attribute__((vector_size(16)));
4 typedef int int4 __attribute__((vector_size(16)));
5 typedef int4* int4p;
7 void test1(float4 a, int4 *result, int i) {
8 result[i] = a; // expected-error {{assigning to 'int4' (vector of 4 'int' values) from incompatible type 'float4' (vector of 4 'float' values)}}
11 void test2(float4 a, int4p result, int i) {
12 result[i] = a; // expected-error {{assigning to 'int4' (vector of 4 'int' values) from incompatible type 'float4' (vector of 4 'float' values)}}
15 // PR2039
16 typedef int a[5];
17 void test3(void) {
18 typedef const a b;
19 b r; // expected-note {{variable 'r' declared const here}}
20 r[0] = 10; // expected-error {{cannot assign to variable 'r' with const-qualified type 'b' (aka 'const int[5]')}}
23 int test4(const a y) {
24 y[0] = 10; // expected-error {{read-only variable is not assignable}}