| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
// Ensure that __builtin___clear_cache has the expected signature. Clang used |
| 4 |
// to have a signature accepting char * while GCC had a signature accepting |
| 5 |
// void * that was documented incorrectly. |
| 6 |
void test(void) { |
| 7 |
int n = 0; |
| 8 |
__builtin___clear_cache(&n, &n + 1); // Ok |
| 9 |
|
| 10 |
__builtin___clear_cache((const void *)&n, (const void *)(&n + 1)); // expected-warning 2 {{passing 'const void *' to parameter of type 'void *' discards qualifiers}} |
| 11 |
} |
| 12 |
|