xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/builtins-mips-args.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // REQUIRES: mips-registered-target
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple mips-unknown-linux-gnu -fsyntax-only -verify %s
3*f4a2713aSLionel Sambuc 
foo()4*f4a2713aSLionel Sambuc void foo() {
5*f4a2713aSLionel Sambuc   // MIPS DSP Rev 1
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc   int a = 3;
8*f4a2713aSLionel Sambuc   __builtin_mips_wrdsp(2052, a);  // expected-error{{argument to '__builtin_mips_wrdsp' must be a constant integer}}
9*f4a2713aSLionel Sambuc   __builtin_mips_rddsp(a);        // expected-error{{argument to '__builtin_mips_rddsp' must be a constant integer}}
10*f4a2713aSLionel Sambuc   __builtin_mips_wrdsp(2052, -1); // expected-error{{argument should be a value from 0 to 63}}
11*f4a2713aSLionel Sambuc   __builtin_mips_rddsp(-1);       // expected-error{{argument should be a value from 0 to 63}}
12*f4a2713aSLionel Sambuc   __builtin_mips_wrdsp(2052, 64); // expected-error{{argument should be a value from 0 to 63}}
13*f4a2713aSLionel Sambuc   __builtin_mips_rddsp(64);       // expected-error{{argument should be a value from 0 to 63}}
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc   // MIPS DSP Rev 2
16*f4a2713aSLionel Sambuc 
17*f4a2713aSLionel Sambuc   __builtin_mips_append(1, 2, a); // expected-error{{argument to '__builtin_mips_append' must be a constant integer}}
18*f4a2713aSLionel Sambuc   __builtin_mips_balign(1, 2, a); // expected-error{{argument to '__builtin_mips_balign' must be a constant integer}}
19*f4a2713aSLionel Sambuc   __builtin_mips_precr_sra_ph_w(1, 2, a);   // expected-error{{argument to '__builtin_mips_precr_sra_ph_w' must be a constant integer}}
20*f4a2713aSLionel Sambuc   __builtin_mips_precr_sra_r_ph_w(1, 2, a); // expected-error{{argument to '__builtin_mips_precr_sra_r_ph_w' must be a constant integer}}
21*f4a2713aSLionel Sambuc   __builtin_mips_prepend(1, 2, a);          // expected-error{{argument to '__builtin_mips_prepend' must be a constant integer}}
22*f4a2713aSLionel Sambuc 
23*f4a2713aSLionel Sambuc   __builtin_mips_append(1, 2, -1);  // expected-error{{argument should be a value from 0 to 31}}
24*f4a2713aSLionel Sambuc   __builtin_mips_append(1, 2, 32);  // expected-error{{argument should be a value from 0 to 31}}
25*f4a2713aSLionel Sambuc 
26*f4a2713aSLionel Sambuc   __builtin_mips_balign(1, 2, -1);  // expected-error{{argument should be a value from 0 to 3}}
27*f4a2713aSLionel Sambuc   __builtin_mips_balign(1, 2, 4);   // expected-error{{argument should be a value from 0 to 3}}
28*f4a2713aSLionel Sambuc 
29*f4a2713aSLionel Sambuc   __builtin_mips_precr_sra_ph_w(1, 2, -1);  // expected-error{{argument should be a value from 0 to 31}}
30*f4a2713aSLionel Sambuc   __builtin_mips_precr_sra_ph_w(1, 2, 32);  // expected-error{{argument should be a value from 0 to 31}}
31*f4a2713aSLionel Sambuc 
32*f4a2713aSLionel Sambuc   __builtin_mips_precr_sra_r_ph_w(1, 2, -1);  // expected-error{{argument should be a value from 0 to 31}}
33*f4a2713aSLionel Sambuc   __builtin_mips_precr_sra_r_ph_w(1, 2, 32);  // expected-error{{argument should be a value from 0 to 31}}
34*f4a2713aSLionel Sambuc 
35*f4a2713aSLionel Sambuc   __builtin_mips_prepend(1, 2, -1); // expected-error{{argument should be a value from 0 to 31}}
36*f4a2713aSLionel Sambuc   __builtin_mips_prepend(1, 2, -1); // expected-error{{argument should be a value from 0 to 31}}
37*f4a2713aSLionel Sambuc }
38