blob: 7b48af155ee8b46b3dcba63a5f6174f146e7c436 [file] [log] [blame]
Daniel Dunbar10582532010-07-16 00:31:23 +00001// RUN: %clang_cc1 -triple armv7 -fsyntax-only -verify -DTEST0 %s
2// RUN: %clang_cc1 -triple armv7 -fsyntax-only -verify -DTEST1 %s
Logan Chieneae5a8202012-10-10 06:56:20 +00003// RUN: %clang_cc1 -triple armv7 -target-abi apcs-gnu \
4// RUN: -fsyntax-only -verify -DTEST1 %s
Daniel Dunbar10582532010-07-16 00:31:23 +00005
6#ifdef TEST0
7void __clear_cache(char*, char*);
8#endif
9
10#ifdef TEST1
11void __clear_cache(void*, void*);
12#endif
13
Logan Chieneae5a8202012-10-10 06:56:20 +000014#if defined(__ARM_PCS) || defined(__ARM_EABI__)
15// va_list on ARM AAPCS is struct { void* __ap }.
16void test1() {
17 __builtin_va_list ptr;
18 ptr.__ap = "x";
19 *(ptr.__ap) = '0'; // expected-error {{incomplete type 'void' is not assignable}}
20}
21#else
22// va_list on ARM apcs-gnu is void*.
23void test1() {
24 __builtin_va_list ptr;
25 ptr.__ap = "x"; // expected-error {{member reference base type '__builtin_va_list' is not a structure or union}}
26 *(ptr.__ap) = '0';// expected-error {{member reference base type '__builtin_va_list' is not a structure or union}}
27}
28
John McCall0e9972c2011-05-09 02:19:37 +000029void test2() {
30 __builtin_va_list ptr = "x";
31 *ptr = '0'; // expected-error {{incomplete type 'void' is not assignable}}
32}
Logan Chieneae5a8202012-10-10 06:56:20 +000033
34#endif