1// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-unknown-linux-gnu %s
2
3// Correct cases.
4typedef int __attribute__((mode(byte))) __attribute__((vector_size(256))) vec_t1;
5typedef int __attribute__((mode(QI))) __attribute__((vector_size(256))) vec_t2;
6typedef int __attribute__((mode(SI))) __attribute__((vector_size(256))) vec_t3;
7typedef int __attribute__((mode(DI))) __attribute__((vector_size(256)))vec_t4;
8typedef float __attribute__((mode(SF))) __attribute__((vector_size(256))) vec_t5;
9typedef float __attribute__((mode(DF))) __attribute__((vector_size(256))) vec_t6;
10typedef float __attribute__((mode(XF))) __attribute__((vector_size(256))) vec_t7;
11
12typedef int v8qi __attribute__ ((mode(QI))) __attribute__ ((vector_size(8)));
13typedef 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
16typedef float v4sf __attribute__((mode(V4SF)));
17// expected-warning@-1{{specifying vector types with the 'mode' attribute is deprecated; use the 'vector_size' attribute instead}}
18typedef float v4sf __attribute__((mode(SF)))  __attribute__ ((vector_size(16)));
19
20// Incorrect cases.
21typedef 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}}
24typedef _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'}}
27typedef 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}}
30typedef 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}}
33typedef _Complex float __attribute__((mode(XC))) __attribute__((vector_size(256))) vec_t12;
34// expected-error@-1{{invalid vector element type '_Complex float'}}
35typedef int __attribute__((mode(V3QI))) v3qi;
36// expected-error@-1{{unknown machine mode 'V3QI'}}
37