1int is_debug() {
2#ifndef NDEBUG
3 return 1; // in debug mode
4#else
5 return 0;
6#endif
7}
8
9/* This comment gets lexed along with the input above! We just don't CHECK it.
10
11RUN: clang-pseudo -source %s -print-source | FileCheck %s -check-prefix=SOURCE --strict-whitespace
12 SOURCE: int is_debug() {
13SOURCE-NEXT: #ifndef NDEBUG
14SOURCE-NEXT: return 1; // in debug mode
15SOURCE-NEXT: #else
16SOURCE-NEXT: return 0;
17SOURCE-NEXT: #end
18SOURCE-NEXT: }
19
20RUN: clang-pseudo -source %s -print-tokens | FileCheck %s -check-prefix=TOKEN
21 TOKEN: 0: raw_identifier 0:0 "int" flags=1
22TOKEN-NEXT: raw_identifier 0:0 "is_debug"
23TOKEN-NEXT: l_paren 0:0 "("
24TOKEN-NEXT: r_paren 0:0 ")"
25TOKEN-NEXT: l_brace 0:0 "{"
26TOKEN-NEXT: hash 1:0 "#" flags=1
27TOKEN-NEXT: raw_identifier 1:0 "ifndef"
28TOKEN-NEXT: raw_identifier 1:0 "NDEBUG"
29TOKEN-NEXT: raw_identifier 2:2 "return" flags=1
30TOKEN-NEXT: numeric_constant 2:2 "1"
31TOKEN-NEXT: semi 2:2 ";"
32TOKEN-NEXT: comment 2:2 "// in debug mode"
33TOKEN-NEXT: hash 3:0 "#" flags=1
34TOKEN-NEXT: raw_identifier 3:0 "else"
35TOKEN-NEXT: raw_identifier 4:2 "return" flags=1
36TOKEN-NEXT: numeric_constant 4:2 "0"
37TOKEN-NEXT: semi 4:2 ";"
38TOKEN-NEXT: hash 5:0 "#" flags=1
39TOKEN-NEXT: raw_identifier 5:0 "endif"
40TOKEN-NEXT: r_brace 6:0 "}" flags=1
41
42*******************************************************************************/
43

source code of clang-tools-extra/pseudo/test/lex.c