Alp Toker | f76e6d8 | 2014-06-28 06:51:27 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple armv8 -target-cpu cortex-a57 -fsyntax-only -ffreestanding -verify %s |
Yi Kong | a44c4d7 | 2014-06-27 21:25:42 +0000 | [diff] [blame] | 2 | |
| 3 | #include <arm_acle.h> |
Yi Kong | 5f7279e | 2014-07-18 10:36:37 +0000 | [diff] [blame] | 4 | /* |
| 5 | * Memory barrier intrinsics |
| 6 | * Argument for dmb, dsb, isb must be compile-time constant, |
| 7 | * otherwise an error should be raised. |
| 8 | */ |
| 9 | void test_dmb_const_diag(const unsigned int t) { |
| 10 | return __dmb(t); // expected-error-re {{argument to {{.*}} must be a constant integer}} |
| 11 | } |
| 12 | |
| 13 | void test_dsb_const_diag(const unsigned int t) { |
| 14 | return __dsb(t); // expected-error-re {{argument to {{.*}} must be a constant integer}} |
| 15 | } |
| 16 | |
| 17 | void test_isb_const_diag(const unsigned int t) { |
| 18 | return __isb(t); // expected-error-re {{argument to {{.*}} must be a constant integer}} |
| 19 | } |
Yi Kong | a44c4d7 | 2014-06-27 21:25:42 +0000 | [diff] [blame] | 20 | |
| 21 | /* |
| 22 | * Saturating intrinsics |
| 23 | * Second argument for SSAT and USAT intrinsics must be compile-time constant, |
| 24 | * otherwise an error should be raised. |
| 25 | */ |
| 26 | int32_t test_ssat_const_diag(int32_t t, const int32_t v) { |
| 27 | return __ssat(t, v); // expected-error-re {{argument to {{.*}} must be a constant integer}} |
| 28 | } |
| 29 | |
| 30 | int32_t test_usat_const_diag(int32_t t, const int32_t v) { |
| 31 | return __usat(t, v); // expected-error-re {{argument to {{.*}} must be a constant integer}} |
| 32 | } |
Yi Kong | 45a0931 | 2014-08-13 23:20:15 +0000 | [diff] [blame] | 33 | |
| 34 | /* |
| 35 | * Prefetch intrinsics |
| 36 | */ |
| 37 | void test_pldx_const_diag(int32_t i) { |
| 38 | __pldx(i, 0, 0, 0); // expected-error-re {{argument to {{.*}} must be a constant integer}} |
| 39 | } |
Yi Kong | 6891746 | 2014-08-26 12:48:11 +0000 | [diff] [blame] | 40 | |
| 41 | /* |
| 42 | * DBG intrinsic |
| 43 | * First argument for DBG intrinsic must be compile-time constant, |
| 44 | * otherwise an error should be raised. |
| 45 | */ |
| 46 | void test_dbg_const_diag(unsigned int t) { |
| 47 | __dbg(t); // expected-error-re {{argument to {{.*}} must be a constant integer}} |
| 48 | } |