[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / predef.c
blob97a6f82242b87ab6b8f5b23fd12c00e29463a4ea
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 void abcdefghi12(void) {
4 const char (*ss)[12] = &__func__;
5 static int arr[sizeof(__func__)==12 ? 1 : -1];
8 char *X = __func__; // expected-warning {{predefined identifier is only valid}} \
9 expected-warning {{initializing 'char *' with an expression of type 'const char[1]' discards qualifiers}}
11 void a(void) {
12 __func__[0] = 'a'; // expected-error {{variable is not assignable}}
15 // rdar://6097892 - GCC permits this.
16 const char *b = __func__; // expected-warning {{predefined identifier is only valid}}
17 const char *c = __FUNCTION__; // expected-warning {{predefined identifier is only valid}}
18 const char *d = __PRETTY_FUNCTION__; // expected-warning {{predefined identifier is only valid}}