From 9f3d1ac419a0e9887387c8330dffc2e4e8a17d20 Mon Sep 17 00:00:00 2001 From: Abramo Bagnara Date: Tue, 3 Jan 2012 20:13:03 +0000 Subject: [PATCH] Added testcases for -Wdisabled-macro-expansion. llvm-svn: 147473 --- .../warn-disabled-macro-expansion.c | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 clang/test/Preprocessor/warn-disabled-macro-expansion.c diff --git a/clang/test/Preprocessor/warn-disabled-macro-expansion.c b/clang/test/Preprocessor/warn-disabled-macro-expansion.c new file mode 100644 index 000000000000..fe8e90c721d9 --- /dev/null +++ b/clang/test/Preprocessor/warn-disabled-macro-expansion.c @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 %s -E -Wdisabled-macro-expansion -verify + +#define p p + +#define a b +#define b a + +#define f(a) a + +#define g(b) a + +#define h(x) i(x) +#define i(y) i(y) + +#define c(x) x(0) + +p // expected-warning {{recursive macro}} + +a // expected-warning {{recursive macro}} + +f(2) + +g(3) // expected-warning {{recursive macro}} + +h(0) // expected-warning {{recursive macro}} + +c(c) // expected-warning {{recursive macro}}