llvm-capstone/clang/test/Preprocessor/macro_redefined.c
Reid Kleckner 98a1266218 Put macro redefinition warnings under -Wmacro-redefined
This is consistent with -Wbuiltin-macro-redefined, and puts this common
extension warning under a flag.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D3283

llvm-svn: 205591
2014-04-04 00:17:16 +00:00

20 lines
555 B
C

// RUN: %clang_cc1 %s -Eonly -verify -Wno-all -Wmacro-redefined -DCLI_MACRO=1 -DWMACRO_REDEFINED
// RUN: %clang_cc1 %s -Eonly -verify -Wno-all -Wno-macro-redefined -DCLI_MACRO=1
#ifndef WMACRO_REDEFINED
// expected-no-diagnostics
#endif
#ifdef WMACRO_REDEFINED
// expected-note@1 {{previous definition is here}}
// expected-warning@+2 {{macro redefined}}
#endif
#define CLI_MACRO
#ifdef WMACRO_REDEFINED
// expected-note@+3 {{previous definition is here}}
// expected-warning@+3 {{macro redefined}}
#endif
#define REGULAR_MACRO
#define REGULAR_MACRO 1