diff options
Diffstat (limited to 'test/Sema/builtins-arm.c')
-rw-r--r-- | test/Sema/builtins-arm.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/Sema/builtins-arm.c b/test/Sema/builtins-arm.c index 4077240ce490..7b48af155ee8 100644 --- a/test/Sema/builtins-arm.c +++ b/test/Sema/builtins-arm.c @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -triple armv7 -fsyntax-only -verify -DTEST0 %s // RUN: %clang_cc1 -triple armv7 -fsyntax-only -verify -DTEST1 %s +// RUN: %clang_cc1 -triple armv7 -target-abi apcs-gnu \ +// RUN: -fsyntax-only -verify -DTEST1 %s #ifdef TEST0 void __clear_cache(char*, char*); @@ -9,8 +11,24 @@ void __clear_cache(char*, char*); void __clear_cache(void*, void*); #endif -// va_list on ARM is void*. +#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}} +} + void test2() { __builtin_va_list ptr = "x"; *ptr = '0'; // expected-error {{incomplete type 'void' is not assignable}} } + +#endif |