xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/builtins-arm64.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify %s
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple arm64-apple-ios -DTEST1 -fsyntax-only -verify %s
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc #ifdef TEST1
5*0a6a1f1dSLionel Sambuc void __clear_cache(void *start, void *end);
6*0a6a1f1dSLionel Sambuc #endif
7*0a6a1f1dSLionel Sambuc 
test_clear_cache_chars(char * start,char * end)8*0a6a1f1dSLionel Sambuc void test_clear_cache_chars(char *start, char *end) {
9*0a6a1f1dSLionel Sambuc   __clear_cache(start, end);
10*0a6a1f1dSLionel Sambuc }
11*0a6a1f1dSLionel Sambuc 
test_clear_cache_voids(void * start,void * end)12*0a6a1f1dSLionel Sambuc void test_clear_cache_voids(void *start, void *end) {
13*0a6a1f1dSLionel Sambuc   __clear_cache(start, end);
14*0a6a1f1dSLionel Sambuc }
15*0a6a1f1dSLionel Sambuc 
test_clear_cache_no_args()16*0a6a1f1dSLionel Sambuc void test_clear_cache_no_args() {
17*0a6a1f1dSLionel Sambuc   __clear_cache(); // expected-error {{too few arguments to function call}}
18*0a6a1f1dSLionel Sambuc }
19*0a6a1f1dSLionel Sambuc 
test_memory_barriers()20*0a6a1f1dSLionel Sambuc void test_memory_barriers() {
21*0a6a1f1dSLionel Sambuc   __builtin_arm_dmb(16); // expected-error {{argument should be a value from 0 to 15}}
22*0a6a1f1dSLionel Sambuc   __builtin_arm_dsb(17); // expected-error {{argument should be a value from 0 to 15}}
23*0a6a1f1dSLionel Sambuc   __builtin_arm_isb(18); // expected-error {{argument should be a value from 0 to 15}}
24*0a6a1f1dSLionel Sambuc }
25*0a6a1f1dSLionel Sambuc 
test_prefetch()26*0a6a1f1dSLionel Sambuc void test_prefetch() {
27*0a6a1f1dSLionel Sambuc   __builtin_arm_prefetch(0, 2, 0, 0, 0); // expected-error {{argument should be a value from 0 to 1}}
28*0a6a1f1dSLionel Sambuc   __builtin_arm_prefetch(0, 0, 3, 0, 0); // expected-error {{argument should be a value from 0 to 2}}
29*0a6a1f1dSLionel Sambuc   __builtin_arm_prefetch(0, 0, 0, 2, 0); // expected-error {{argument should be a value from 0 to 1}}
30*0a6a1f1dSLionel Sambuc   __builtin_arm_prefetch(0, 0, 0, 0, 2); // expected-error {{argument should be a value from 0 to 1}}
31*0a6a1f1dSLionel Sambuc }
32