annotate clang/test/Sema/predef.c @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 void abcdefghi12(void) {
anatofuz
parents:
diff changeset
4 const char (*ss)[12] = &__func__;
anatofuz
parents:
diff changeset
5 static int arr[sizeof(__func__)==12 ? 1 : -1];
anatofuz
parents:
diff changeset
6 }
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 char *X = __func__; // expected-warning {{predefined identifier is only valid}} \
anatofuz
parents:
diff changeset
9 expected-warning {{initializing 'char *' with an expression of type 'const char [1]' discards qualifiers}}
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 void a() {
anatofuz
parents:
diff changeset
12 __func__[0] = 'a'; // expected-error {{variable is not assignable}}
anatofuz
parents:
diff changeset
13 }
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 // rdar://6097892 - GCC permits this insanity.
anatofuz
parents:
diff changeset
16 const char *b = __func__; // expected-warning {{predefined identifier is only valid}}
anatofuz
parents:
diff changeset
17 const char *c = __FUNCTION__; // expected-warning {{predefined identifier is only valid}}
anatofuz
parents:
diff changeset
18 const char *d = __PRETTY_FUNCTION__; // expected-warning {{predefined identifier is only valid}}
anatofuz
parents:
diff changeset
19