brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 71375ad Raw
28 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify %s -flax-vector-conversions=none2 3typedef float float4 __attribute__((vector_size(16)));4typedef int int4 __attribute__((vector_size(16)));5typedef int4* int4p;6 7void 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)}}9}10 11void 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)}}13}14 15// PR203916typedef int a[5];17void test3(void) {18  typedef const a b;19  b r;       // expected-note {{variable 'r' declared const here}} \20                expected-warning {{default initialization of an object of type 'b' (aka 'const int[5]') leaves the object uninitialized}}21  r[0] = 10; // expected-error {{cannot assign to variable 'r' with const-qualified type 'b' (aka 'const int[5]')}}22}23 24int test4(const a y) {25  y[0] = 10; // expected-error {{read-only variable is not assignable}}26}27 28