brintos

brintos / llvm-project-archived public Read only

0
0
Text · 491 B · e6a3421 Raw
13 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3// Ensure that __builtin___clear_cache has the expected signature. Clang used4// to have a signature accepting char * while GCC had a signature accepting5// void * that was documented incorrectly.6void test(void) {7 int n = 0;8  __builtin___clear_cache(&n, &n + 1); // Ok9  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 13