1f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple armv7 -fsyntax-only -verify %s
2f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple armv7 -target-abi apcs-gnu \
3f4a2713aSLionel Sambuc // RUN:   -fsyntax-only -verify %s
4f4a2713aSLionel Sambuc 
f(void * a,void * b)5f4a2713aSLionel Sambuc void f(void *a, void *b) {
6f4a2713aSLionel Sambuc   __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 *)}}
7f4a2713aSLionel Sambuc   __clear_cache(a); // expected-error {{too few arguments to function call, expected 2, have 1}}
8f4a2713aSLionel Sambuc   __clear_cache(a, b);
9f4a2713aSLionel Sambuc }
10f4a2713aSLionel Sambuc 
11f4a2713aSLionel Sambuc void __clear_cache(char*, char*); // expected-error {{conflicting types for '__clear_cache'}}
12f4a2713aSLionel Sambuc void __clear_cache(void*, void*);
13f4a2713aSLionel Sambuc 
14f4a2713aSLionel Sambuc #if defined(__ARM_PCS) || defined(__ARM_EABI__)
15f4a2713aSLionel Sambuc // va_list on ARM AAPCS is struct { void* __ap }.
test1()16f4a2713aSLionel Sambuc void test1() {
17f4a2713aSLionel Sambuc   __builtin_va_list ptr;
18f4a2713aSLionel Sambuc   ptr.__ap = "x";
19f4a2713aSLionel Sambuc   *(ptr.__ap) = '0'; // expected-error {{incomplete type 'void' is not assignable}}
20f4a2713aSLionel Sambuc }
21f4a2713aSLionel Sambuc #else
22f4a2713aSLionel Sambuc // va_list on ARM apcs-gnu is void*.
test1()23f4a2713aSLionel Sambuc void test1() {
24f4a2713aSLionel Sambuc   __builtin_va_list ptr;
25f4a2713aSLionel Sambuc   ptr.__ap = "x";  // expected-error {{member reference base type '__builtin_va_list' is not a structure or union}}
26f4a2713aSLionel Sambuc   *(ptr.__ap) = '0';// expected-error {{member reference base type '__builtin_va_list' is not a structure or union}}
27f4a2713aSLionel Sambuc }
28f4a2713aSLionel Sambuc 
test2()29f4a2713aSLionel Sambuc void test2() {
30f4a2713aSLionel Sambuc   __builtin_va_list ptr = "x";
31f4a2713aSLionel Sambuc   *ptr = '0'; // expected-error {{incomplete type 'void' is not assignable}}
32f4a2713aSLionel Sambuc }
33f4a2713aSLionel Sambuc #endif
34*0a6a1f1dSLionel Sambuc 
test3()35*0a6a1f1dSLionel Sambuc void test3() {
36*0a6a1f1dSLionel Sambuc   __builtin_arm_dsb(16); // expected-error {{argument should be a value from 0 to 15}}
37*0a6a1f1dSLionel Sambuc   __builtin_arm_dmb(17); // expected-error {{argument should be a value from 0 to 15}}
38*0a6a1f1dSLionel Sambuc   __builtin_arm_isb(18); // expected-error {{argument should be a value from 0 to 15}}
39*0a6a1f1dSLionel Sambuc }
40*0a6a1f1dSLionel Sambuc 
test4()41*0a6a1f1dSLionel Sambuc void test4() {
42*0a6a1f1dSLionel Sambuc   __builtin_arm_prefetch(0, 2, 0); // expected-error {{argument should be a value from 0 to 1}}
43*0a6a1f1dSLionel Sambuc   __builtin_arm_prefetch(0, 0, 2); // expected-error {{argument should be a value from 0 to 1}}
44*0a6a1f1dSLionel Sambuc }
45*0a6a1f1dSLionel Sambuc 
test5()46*0a6a1f1dSLionel Sambuc void test5() {
47*0a6a1f1dSLionel Sambuc   __builtin_arm_dbg(16); // expected-error {{argument should be a value from 0 to 15}}
48*0a6a1f1dSLionel Sambuc }
49