Jim Grosbach | f794705 | 2012-07-09 18:34:21 +0000 | [diff] [blame] | 1 | // REQUIRES: mips-registered-target |
Simon Atanasyan | e471d87 | 2012-07-08 09:10:14 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -triple mips-unknown-linux-gnu -fsyntax-only -verify %s |
| 3 | |
| 4 | void 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 Atanasyan | fad0a32 | 2012-07-08 09:30:00 +0000 | [diff] [blame] | 10 | __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 Atanasyan | e471d87 | 2012-07-08 09:10:14 +0000 | [diff] [blame] | 14 | } |