xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/arm_acle.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple armv8 -target-cpu cortex-a57 -fsyntax-only -ffreestanding -verify %s
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc #include <arm_acle.h>
4*0a6a1f1dSLionel Sambuc /*
5*0a6a1f1dSLionel Sambuc  * Memory barrier intrinsics
6*0a6a1f1dSLionel Sambuc  * Argument for dmb, dsb, isb must be compile-time constant,
7*0a6a1f1dSLionel Sambuc  * otherwise an error should be raised.
8*0a6a1f1dSLionel Sambuc  */
test_dmb_const_diag(const unsigned int t)9*0a6a1f1dSLionel Sambuc void test_dmb_const_diag(const unsigned int t) {
10*0a6a1f1dSLionel Sambuc   return __dmb(t);  // expected-error-re {{argument to {{.*}} must be a constant integer}}
11*0a6a1f1dSLionel Sambuc }
12*0a6a1f1dSLionel Sambuc 
test_dsb_const_diag(const unsigned int t)13*0a6a1f1dSLionel Sambuc void test_dsb_const_diag(const unsigned int t) {
14*0a6a1f1dSLionel Sambuc   return __dsb(t);  // expected-error-re {{argument to {{.*}} must be a constant integer}}
15*0a6a1f1dSLionel Sambuc }
16*0a6a1f1dSLionel Sambuc 
test_isb_const_diag(const unsigned int t)17*0a6a1f1dSLionel Sambuc void test_isb_const_diag(const unsigned int t) {
18*0a6a1f1dSLionel Sambuc   return __isb(t);  // expected-error-re {{argument to {{.*}} must be a constant integer}}
19*0a6a1f1dSLionel Sambuc }
20*0a6a1f1dSLionel Sambuc 
21*0a6a1f1dSLionel Sambuc /*
22*0a6a1f1dSLionel Sambuc  * Saturating intrinsics
23*0a6a1f1dSLionel Sambuc  * Second argument for SSAT and USAT intrinsics must be compile-time constant,
24*0a6a1f1dSLionel Sambuc  * otherwise an error should be raised.
25*0a6a1f1dSLionel Sambuc  */
test_ssat_const_diag(int32_t t,const int32_t v)26*0a6a1f1dSLionel Sambuc int32_t test_ssat_const_diag(int32_t t, const int32_t v) {
27*0a6a1f1dSLionel Sambuc   return __ssat(t, v);  // expected-error-re {{argument to {{.*}} must be a constant integer}}
28*0a6a1f1dSLionel Sambuc }
29*0a6a1f1dSLionel Sambuc 
test_usat_const_diag(int32_t t,const int32_t v)30*0a6a1f1dSLionel Sambuc int32_t test_usat_const_diag(int32_t t, const int32_t v) {
31*0a6a1f1dSLionel Sambuc   return __usat(t, v);  // expected-error-re {{argument to {{.*}} must be a constant integer}}
32*0a6a1f1dSLionel Sambuc }
33*0a6a1f1dSLionel Sambuc 
34*0a6a1f1dSLionel Sambuc /*
35*0a6a1f1dSLionel Sambuc  * Prefetch intrinsics
36*0a6a1f1dSLionel Sambuc  */
test_pldx_const_diag(int32_t i)37*0a6a1f1dSLionel Sambuc void test_pldx_const_diag(int32_t i) {
38*0a6a1f1dSLionel Sambuc   __pldx(i, 0, 0, 0);  // expected-error-re {{argument to {{.*}} must be a constant integer}}
39*0a6a1f1dSLionel Sambuc }
40*0a6a1f1dSLionel Sambuc 
41*0a6a1f1dSLionel Sambuc /*
42*0a6a1f1dSLionel Sambuc  * DBG intrinsic
43*0a6a1f1dSLionel Sambuc  * First argument for DBG intrinsic must be compile-time constant,
44*0a6a1f1dSLionel Sambuc  * otherwise an error should be raised.
45*0a6a1f1dSLionel Sambuc  */
test_dbg_const_diag(unsigned int t)46*0a6a1f1dSLionel Sambuc void test_dbg_const_diag(unsigned int t) {
47*0a6a1f1dSLionel Sambuc   __dbg(t);  // expected-error-re {{argument to {{.*}} must be a constant integer}}
48*0a6a1f1dSLionel Sambuc }
49