2013-05-14 20:45:47 +08:00
// RUN: %clang_cc1 -triple armv7 -fsyntax-only -verify %s
2012-10-10 14:56:20 +08:00
/ / RUN : % clang_cc1 - triple armv7 - target - abi apcs - gnu \
2013-05-14 20:45:47 +08:00
// RUN: -fsyntax-only -verify %s
2010-07-16 08:31:23 +08:00
2013-05-15 02:06:10 +08:00
void f ( void * a , void * b ) {
__clear_cache ( ) ; // expected-error {{too few arguments to function call, expected 2, have 0}} // expected-note {{'__clear_cache' is a builtin with type 'void (void *, void *)}}
2013-05-14 20:45:47 +08:00
__clear_cache ( a ) ; // expected-error {{too few arguments to function call, expected 2, have 1}}
__clear_cache ( a , b ) ;
}
2010-07-16 08:31:23 +08:00
2013-05-15 02:06:10 +08:00
void __clear_cache ( char * , char * ) ; // expected-error {{conflicting types for '__clear_cache'}}
void __clear_cache ( void * , void * ) ;
2010-07-16 08:31:23 +08:00
2012-10-10 14:56:20 +08:00
# if defined(__ARM_PCS) || defined(__ARM_EABI__)
// va_list on ARM AAPCS is struct { void* __ap }.
void test1 ( ) {
__builtin_va_list ptr ;
ptr . __ap = " x " ;
* ( ptr . __ap ) = ' 0 ' ; // expected-error {{incomplete type 'void' is not assignable}}
}
# else
// va_list on ARM apcs-gnu is void*.
void test1 ( ) {
__builtin_va_list ptr ;
ptr . __ap = " x " ; // expected-error {{member reference base type '__builtin_va_list' is not a structure or union}}
* ( ptr . __ap ) = ' 0 ' ; // expected-error {{member reference base type '__builtin_va_list' is not a structure or union}}
}
2011-05-09 10:19:37 +08:00
void test2 ( ) {
__builtin_va_list ptr = " x " ;
* ptr = ' 0 ' ; // expected-error {{incomplete type 'void' is not assignable}}
}
2012-10-10 14:56:20 +08:00
2014-07-04 00:01:25 +08:00
void test3 ( ) {
__builtin_arm_dsb ( 16 ) ; // expected-error {{argument should be a value from 0 to 15}}
__builtin_arm_dmb ( 17 ) ; // expected-error {{argument should be a value from 0 to 15}}
__builtin_arm_isb ( 18 ) ; // expected-error {{argument should be a value from 0 to 15}}
}
2014-08-14 03:18:14 +08:00
void test4 ( ) {
__builtin_arm_prefetch ( 0 , 2 , 0 ) ; // expected-error {{argument should be a value from 0 to 1}}
__builtin_arm_prefetch ( 0 , 0 , 2 ) ; // expected-error {{argument should be a value from 0 to 1}}
}
2012-10-10 14:56:20 +08:00
# endif