1 // REQUIRES: mips-registered-target
2 // RUN: %clang_cc1 -triple mips64 -fsyntax-only -verify %s
3 
4 typedef signed char v4i8 __attribute__ ((vector_size(4)));
5 typedef signed char v4q7 __attribute__ ((vector_size(4)));
6 typedef signed char v16i8 __attribute__((vector_size(16), aligned(16)));
7 typedef unsigned char v16u8 __attribute__((vector_size(16), aligned(16)));
8 
dsp()9 void dsp() {
10   v4i8 a;
11   void* p;
12 
13   // expected-error@+1 {{this builtin requires 'dsp' ASE, please use -mdsp}}
14   __builtin_mips_addu_qb(a, a);
15   // expected-error@+1 {{this builtin requires 'dsp' ASE, please use -mdsp}}
16   __builtin_mips_lwx(p, 32);
17 }
18 
dspr2()19 void dspr2() {
20   v4i8 a;
21   v4q7 b;
22 
23   // expected-error@+1 {{this builtin requires 'dsp r2' ASE, please use -mdspr2}}
24   __builtin_mips_absq_s_qb(b);
25   // expected-error@+1 {{this builtin requires 'dsp r2' ASE, please use -mdspr2}}
26   __builtin_mips_subuh_r_qb(a, a);
27 }
28 
msa()29 void msa() {
30   v16i8 a;
31   v16u8 b;
32 
33   // expected-error@+1 {{this builtin requires 'msa' ASE, please use -mmsa}}
34   __builtin_msa_add_a_b(a, a);
35   // expected-error@+1 {{this builtin requires 'msa' ASE, please use -mmsa}}
36   __builtin_msa_xori_b(b, 5);
37 }
38