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

28 lines
483 B
C
Raw Normal View History

// RUN: %clang_cc1 -E %s | grep 'noexp: foo y'
// RUN: %clang_cc1 -E %s | grep 'expand: abc'
// RUN: %clang_cc1 -E %s | grep 'noexp2: foo nonexp'
// RUN: %clang_cc1 -E %s | grep 'expand2: abc'
2006-07-11 12:00:23 +08:00
#define A foo
#define foo() abc
#define X A y
// This should not expand to abc, because the foo macro isn't followed by (.
noexp: X
// This should expand to abc.
2006-07-11 13:03:43 +08:00
#undef X
2006-07-11 12:00:23 +08:00
#define X A ()
expand: X
2006-07-11 13:03:43 +08:00
// This should be 'foo nonexp'
noexp2: A nonexp
// This should expand
expand2: A (
)