1 // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-unknown-linux-gnu %s
2 
3 // Correct cases.
4 typedef int __attribute__((mode(byte))) __attribute__((vector_size(256))) vec_t1;
5 typedef int __attribute__((mode(QI))) __attribute__((vector_size(256))) vec_t2;
6 typedef int __attribute__((mode(SI))) __attribute__((vector_size(256))) vec_t3;
7 typedef int __attribute__((mode(DI))) __attribute__((vector_size(256)))vec_t4;
8 typedef float __attribute__((mode(SF))) __attribute__((vector_size(256))) vec_t5;
9 typedef float __attribute__((mode(DF))) __attribute__((vector_size(256))) vec_t6;
10 typedef float __attribute__((mode(XF))) __attribute__((vector_size(256))) vec_t7;
11 
12 typedef int v8qi __attribute__ ((mode(QI))) __attribute__ ((vector_size(8)));
13 typedef int v8qi __attribute__ ((mode(V8QI)));
14 // expected-warning@-1{{specifying vector types with the 'mode' attribute is deprecated; use the 'vector_size' attribute instead}}
15 
16 typedef float v4sf __attribute__((mode(V4SF)));
17 // expected-warning@-1{{specifying vector types with the 'mode' attribute is deprecated; use the 'vector_size' attribute instead}}
18 typedef float v4sf __attribute__((mode(SF)))  __attribute__ ((vector_size(16)));
19 
20 // Incorrect cases.
21 typedef float __attribute__((mode(QC))) __attribute__((vector_size(256))) vec_t8;
22 // expected-error@-1{{unsupported machine mode 'QC'}}
23 // expected-error@-2{{type of machine mode does not match type of base type}}
24 typedef _Complex float __attribute__((mode(HC))) __attribute__((vector_size(256))) vec_t9;
25 // expected-error@-1{{unsupported machine mode 'HC'}}
26 // expected-error@-2{{invalid vector element type '_Complex float'}}
27 typedef int __attribute__((mode(SC))) __attribute__((vector_size(256))) vec_t10;
28 // expected-error@-1{{type of machine mode does not match type of base type}}
29 // expected-error@-2{{type of machine mode does not support base vector types}}
30 typedef float __attribute__((mode(DC))) __attribute__((vector_size(256))) vec_t11;
31 // expected-error@-1{{type of machine mode does not match type of base type}}
32 // expected-error@-2{{type of machine mode does not support base vector types}}
33 typedef _Complex float __attribute__((mode(XC))) __attribute__((vector_size(256))) vec_t12;
34 // expected-error@-1{{invalid vector element type '_Complex float'}}
35 typedef int __attribute__((mode(V3QI))) v3qi;
36 // expected-error@-1{{unknown machine mode 'V3QI'}}
37