opnsense-src/test/Preprocessor/dump_macros.c

39 lines
812 B
C
Raw Normal View History

2010-01-01 05:34:51 -05:00
// RUN: %clang_cc1 -E -dM %s -o - | FileCheck %s -strict-whitespace
2009-06-02 13:58:47 -04:00
2009-12-15 13:49:47 -05:00
// Space at end even without expansion tokens
// CHECK: #define A(x)
2009-06-02 13:58:47 -04:00
#define A(x)
// Space before expansion list.
2009-12-15 13:49:47 -05:00
// CHECK: #define B(x,y) x y
2009-06-02 13:58:47 -04:00
#define B(x,y)x y
2009-12-15 13:49:47 -05:00
// No space in argument list.
// CHECK: #define C(x,y) x y
2009-06-02 13:58:47 -04:00
#define C(x, y) x y
// No paste avoidance.
2009-12-15 13:49:47 -05:00
// CHECK: #define D() ..
#define D() ..
2009-06-02 13:58:47 -04:00
// Simple test.
2009-12-15 13:49:47 -05:00
// CHECK: #define E .
// CHECK: #define F X()Y
#define E .
#define F X()Y
2009-06-02 13:58:47 -04:00
// gcc prints macros at end of translation unit, so last one wins.
2009-12-15 13:49:47 -05:00
// CHECK: #define G 2
#define G 1
#undef G
#define G 2
2009-06-02 13:58:47 -04:00
2009-12-15 13:49:47 -05:00
// Variadic macros of various sorts. PR5699
// CHECK: H(x,...) __VA_ARGS__
#define H(x, ...) __VA_ARGS__
// CHECK: I(...) __VA_ARGS__
#define I(...) __VA_ARGS__
// CHECK: J(x...) __VA_ARGS__
#define J(x ...) __VA_ARGS__