blob: fd3e31443ecf56cc6d7c685b40b2296a96c481f8 [file] [log] [blame]
Jim Grosbachf7947052012-07-09 18:34:21 +00001// REQUIRES: mips-registered-target
Simon Atanasyane471d872012-07-08 09:10:14 +00002// RUN: %clang_cc1 -triple mips-unknown-linux-gnu -fsyntax-only -verify %s
3
4void foo() {
5 // MIPS DSP Rev 1
6
7 int a = 3;
8 __builtin_mips_wrdsp(2052, a); // expected-error{{argument to '__builtin_mips_wrdsp' must be a constant integer}}
9 __builtin_mips_rddsp(a); // expected-error{{argument to '__builtin_mips_rddsp' must be a constant integer}}
Simon Atanasyanfad0a322012-07-08 09:30:00 +000010 __builtin_mips_wrdsp(2052, -1); // expected-error{{argument should be a value from 0 to 63}}
11 __builtin_mips_rddsp(-1); // expected-error{{argument should be a value from 0 to 63}}
12 __builtin_mips_wrdsp(2052, 64); // expected-error{{argument should be a value from 0 to 63}}
13 __builtin_mips_rddsp(64); // expected-error{{argument should be a value from 0 to 63}}
Simon Atanasyanbe22cb82012-08-27 12:29:20 +000014
15 // MIPS DSP Rev 2
16
17 __builtin_mips_append(1, 2, a); // expected-error{{argument to '__builtin_mips_append' must be a constant integer}}
18 __builtin_mips_balign(1, 2, a); // expected-error{{argument to '__builtin_mips_balign' must be a constant integer}}
19 __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 __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 __builtin_mips_prepend(1, 2, a); // expected-error{{argument to '__builtin_mips_prepend' must be a constant integer}}
22
23 __builtin_mips_append(1, 2, -1); // expected-error{{argument should be a value from 0 to 31}}
24 __builtin_mips_append(1, 2, 32); // expected-error{{argument should be a value from 0 to 31}}
25
26 __builtin_mips_balign(1, 2, -1); // expected-error{{argument should be a value from 0 to 3}}
27 __builtin_mips_balign(1, 2, 4); // expected-error{{argument should be a value from 0 to 3}}
28
29 __builtin_mips_precr_sra_ph_w(1, 2, -1); // expected-error{{argument should be a value from 0 to 31}}
30 __builtin_mips_precr_sra_ph_w(1, 2, 32); // expected-error{{argument should be a value from 0 to 31}}
31
32 __builtin_mips_precr_sra_r_ph_w(1, 2, -1); // expected-error{{argument should be a value from 0 to 31}}
33 __builtin_mips_precr_sra_r_ph_w(1, 2, 32); // expected-error{{argument should be a value from 0 to 31}}
34
35 __builtin_mips_prepend(1, 2, -1); // expected-error{{argument should be a value from 0 to 31}}
36 __builtin_mips_prepend(1, 2, -1); // expected-error{{argument should be a value from 0 to 31}}
Simon Atanasyane471d872012-07-08 09:10:14 +000037}