llvm-project/clang/test/Preprocessor/dump_macros.c

31 lines
615 B
C
Raw Normal View History

2009-12-07 09:49:36 +08:00
// RUN: clang-cc -E -dM %s -o - | FileCheck %s -strict-whitespace
2009-12-07 09:49:36 +08:00
// Space at end even without expansion tokens
// CHECK: {{#define A[(]x[)] $}}
#define A(x)
// Space before expansion list.
2009-12-07 09:49:36 +08:00
// CHECK: {{#define B[(]x,y[)] x y$}}
#define B(x,y)x y
2009-12-07 09:49:36 +08:00
// No space in argument list.
// CHECK: #define C(x,y) x y
#define C(x, y) x y
// No paste avoidance.
2009-12-07 09:49:36 +08:00
// CHECK: #define X() ..
#define X() ..
// Simple test.
2009-12-07 09:49:36 +08:00
// CHECK: #define Y .
// CHECK: #define Z X()Y
#define Y .
#define Z X()Y
// gcc prints macros at end of translation unit, so last one wins.
2009-12-07 09:49:36 +08:00
// CHECK: #define foo 2
#define foo 1
#undef foo
#define foo 2