hanchenye-llvm-project/clang/test/Preprocessor
Serge Pavlov 07c0f04e08 Fixed warnings on redefine keywords and reserved ids.
Repared support for warnings -Wkeyword-macro and -Wreserved-id-macro.
The warning -Wkeyword-macro now is not issued in patterns that are used
in configuration scripts:

    #define inline

also for 'const', 'extern' and 'static'. If macro repalcement is identical
to macro name, the warning also is not issued:

    #define volatile volatile

And finally if macro replacement is also a keyword identical to the replaced
one but decorated with leading/trailing underscores:

    #define inline __inline
    #define inline __inline__
    #define inline _inline // in MSVC compatibility mode

Warning -Wreserved-id-macro is off by default, it could help catching
things like:

    #undef __cplusplus

llvm-svn: 224512
2014-12-18 11:14:21 +00:00
..
Inputs Force a header file input to the headermap test to have different 2014-03-30 14:04:32 +00:00
_Pragma-dependency.c
_Pragma-dependency2.c
_Pragma-in-macro-arg.c
_Pragma-location.c
_Pragma-physloc.c
_Pragma.c Don't Lex past EOF when lexing _Pragma 2014-08-14 19:47:06 +00:00
aarch64-target-features.c AArch64: set all processor features from -arch if nothing else present 2014-11-10 21:17:23 +00:00
arm-acle-6.4.c [ARM] Add ACLE predefines: maxmin, rounding and h/w integer division 2014-09-15 11:25:38 +00:00
arm-acle-6.5.c Basic: use hex string for __ARM_FP macro 2014-09-18 02:13:33 +00:00
arm-target-features.c [ARM] Define __ARM_FEATURE_DSP macro for CPUs that have DSP instructions 2014-11-25 08:57:36 +00:00
assembler-with-cpp.c Lex: Don't restrict legal UCNs when preprocessing assembly 2013-10-21 05:02:28 +00:00
builtin_line.c
c90.c
c99-6_10_3_3_p4.c
c99-6_10_3_4_p5.c
c99-6_10_3_4_p6.c
c99-6_10_3_4_p7.c
c99-6_10_3_4_p9.c
clang_headers.c
comment_save.c
comment_save_if.c
comment_save_macro.c
cxx_and.cpp
cxx_bitand.cpp
cxx_bitor.cpp
cxx_compl.cpp
cxx_not.cpp
cxx_not_eq.cpp
cxx_oper_keyword.cpp Preprocessor: recover gracefully when C++ operator names are used as macro identifiers 2014-05-31 03:38:17 +00:00
cxx_oper_keyword_ms_compat.cpp Emit warning if define or undef reserved identifier or keyword. 2014-12-11 12:18:08 +00:00
cxx_oper_spelling.cpp
cxx_or.cpp
cxx_true.cpp
cxx_xor.cpp
dependencies-and-pp.c
directive-invalid.c
disabled-cond-diags.c
disabled-cond-diags2.c
dump-macros-spacing.c
dump-macros-undef.c
dump-options.c
dump_macros.c
dumptokens_phyloc.c
expr_comma.c
expr_define_expansion.c
expr_invalid_tok.c
expr_liveness.c
expr_multichar.c
expr_usual_conversions.c
extension-warning.c
feature_tests.c Preprocessor: Recover instead of mutating a token in ExpandBuiltinMacro 2014-12-15 09:03:58 +00:00
file_to_include.h
first-line-indent.c
function_macro_file.c
function_macro_file.h
has_attribute.c Modify __has_attribute so that it only looks for GNU-style attributes. Removes the ability to look for generic attributes and keywords via this macro, which has the potential to be a breaking change. However, since there is __has_cpp_attribute and __has_declspec_attribute, and given the limited usefulness of querying a generic attribute name regardless of syntax, this seems like the correct path forward. 2014-12-05 15:24:55 +00:00
has_attribute.cpp Added a new preprocessor macro: __has_declspec_attribute. This can be used as a way to determine whether Clang supports a __declspec spelling for a given attribute, similar to __has_attribute and __has_cpp_attribute. 2014-12-05 15:05:29 +00:00
has_include.c
hash_line.c Make Preprocessor::Lex non-recursive. 2013-09-19 00:41:32 +00:00
hash_space.c
header_lookup1.c Move a bunch of tests to directly use the CC1 layer. This at least saves 2014-01-15 09:08:07 +00:00
headermap-rel.c [HeaderSearch] Fix issue where if a headermap entry maps the filename to a framework import (non-absolute path) 2014-03-11 06:21:28 +00:00
headermap-rel2.c test: Disable standard system includes in %clang_cc1 2014-10-03 22:18:49 +00:00
if_warning.c
ifdef-recover.c Preprocessor: support defined() with operator names for MS compatibility 2014-05-21 06:13:51 +00:00
ignore-pragmas.c Revert "clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]" 2014-07-16 15:12:48 +00:00
import_self.c
include-directive1.c
include-directive2.c
include-directive3.c
include-macros.c
include-pth.c
indent_macro.c
init.c [mips] Removing __SIZEOF_INT128__ macro for MIPS64 2014-12-10 15:44:07 +00:00
invalid-__has_warning1.c
invalid-__has_warning2.c
iwithprefix.c Make test run reliably 2013-11-05 12:45:43 +00:00
line-directive-output.c Properly escape filenames in line directives. 2013-08-29 01:42:42 +00:00
line-directive.c Switch C compilations to C11 by default. 2014-10-20 23:26:58 +00:00
macho-embedded-predefines.c ARM: Correctly identify cortex-m4 as v7em. 2014-06-26 17:24:16 +00:00
macro-multiline.c Fix and restore the macro-multiline.c test 2014-04-19 21:40:58 +00:00
macro-reserved-cxx11.cpp Fixed warnings on redefine keywords and reserved ids. 2014-12-18 11:14:21 +00:00
macro-reserved-ms.c Fixed warnings on redefine keywords and reserved ids. 2014-12-18 11:14:21 +00:00
macro-reserved.c Fixed warnings on redefine keywords and reserved ids. 2014-12-18 11:14:21 +00:00
macro-reserved.cpp Fixed warnings on redefine keywords and reserved ids. 2014-12-18 11:14:21 +00:00
macro_arg_directive.c
macro_arg_directive.h
macro_arg_empty.c Fix whitespace handling in empty macro arguments 2014-02-04 19:18:32 +00:00
macro_arg_keyword.c
macro_arg_slocentry_merge.c
macro_arg_slocentry_merge.h
macro_backslash.c Handle -D arguments ending in a backslash. 2013-08-28 20:35:38 +00:00
macro_disable.c
macro_expand.c
macro_expand_empty.c If preprocessing results in a token with leading whitespace that was expanded 2014-02-24 20:50:36 +00:00
macro_expandloc.c
macro_fn.c Add new diagnostic messages when too many arguments are presented to a 2013-07-23 18:01:49 +00:00
macro_fn_comma_swallow.c
macro_fn_comma_swallow2.c
macro_fn_disable_expand.c
macro_fn_lparen_scan.c
macro_fn_lparen_scan2.c
macro_fn_placemarker.c
macro_fn_preexpand.c
macro_fn_varargs_iso.c
macro_fn_varargs_named.c
macro_misc.c
macro_not_define.c
macro_paste_bad.c Lex: Fix an invalid access into a SmallString 2014-10-25 11:40:40 +00:00
macro_paste_bcpl_comment.c Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
macro_paste_c_block_comment.c
macro_paste_commaext.c Fix whitespace handling in ## operator 2014-02-04 19:18:28 +00:00
macro_paste_empty.c
macro_paste_hard.c
macro_paste_hashhash.c
macro_paste_identifier_error.c
macro_paste_msextensions.c Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
macro_paste_none.c
macro_paste_simple.c
macro_paste_spacing.c Fix whitespace handling in ## operator 2014-02-04 19:18:28 +00:00
macro_paste_spacing2.c
macro_redefined.c Put macro redefinition warnings under -Wmacro-redefined 2014-04-04 00:17:16 +00:00
macro_rescan.c
macro_rescan2.c
macro_rescan_varargs.c
macro_rparen_scan.c
macro_rparen_scan2.c
macro_space.c Fix whitespace handling in empty macro expansions 2014-02-04 19:18:35 +00:00
macro_undef.c
macro_variadic.cl
macro_with_initializer_list.cpp Add not to a command that is expected to fail. 2013-07-24 18:45:44 +00:00
mi_opt.c
mi_opt.h
mi_opt2.c
mi_opt2.h
microsoft-ext.c Revert "Move -fms-extensions predefined macros into InitPreprocessor" 2014-04-16 20:10:16 +00:00
microsoft-header-search.c Fix false positives in -Wmsvc-include by continuing header search 2014-02-18 23:49:24 +00:00
microsoft-import.c
missing-system-header.c
missing-system-header.h
mmx.c
non_fragile_feature.m
non_fragile_feature1.m
objc-pp.m
optimize.c Don't pass -O0 to clang_cc1, it is the default. 2013-09-04 04:12:25 +00:00
output_paste_avoid.cpp
overflow.c
pic.c
pp-modules.c
pp-modules.h
pp-record.c
pp-record.h
pr2086.c
pr2086.h
pr13851.c
pragma-captured.c
pragma-pushpop-macro.c
pragma_diagnostic.c
pragma_diagnostic_output.c
pragma_diagnostic_sections.cpp
pragma_microsoft.c Accept #pragma warning(push, 0) without warning 2013-10-02 15:19:23 +00:00
pragma_microsoft.cpp Accept #pragma warning(push, 0) without warning 2013-10-02 15:19:23 +00:00
pragma_poison.c
pragma_sysheader.c
pragma_sysheader.h
pragma_unknown.c
predefined-arch-macros.c [X86] Slightly refactor default features for AMD bdver cpus (NFC). Also add missing checks to test for target features. 2014-11-06 12:08:57 +00:00
predefined-exceptions.m Frontend: Define __EXCEPTIONS if -fexceptions is passed 2014-10-27 20:02:19 +00:00
predefined-macros.c Follow-up commit to r211657 which introduced these macros, but not for MSVC. This turns out to break our freestanding tests on Windows when compiling in MSVC-compatible mode. It was decided (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141020/116942.html is the start of the thread) to support this as part of Clang's interface on all platforms. 2014-10-21 19:24:06 +00:00
print-pragma-microsoft.c Expand macros in pragmas with -fms-extensions and -E 2014-02-20 22:59:51 +00:00
print_line_count.c
print_line_empty_file.c
print_line_include.c
print_line_include.h
print_line_track.c
pushable-diagnostics.c
skipping_unclean.c
stdint.c As requested by Matt Thomas, use long long for intmax_t and int64_t on 2014-10-15 19:52:03 +00:00
stringize_misc.c
stringize_space.c
traditional-cpp.c Fix "//" comments with -traditional-cpp in C++. 2013-08-28 20:53:32 +00:00
ucn-allowed-chars.c Fix the range for Malayam UCNs in C99. 2014-02-05 15:32:23 +00:00
ucn-pp-identifier.c Preprocessor: support defined() with operator names for MS compatibility 2014-05-21 06:13:51 +00:00
undef-error.c
unterminated.c
user_defined_system_framework.c
utf8-allowed-chars.c
warn-disabled-macro-expansion.c
warn-macro-unused.c Split isFromMainFile into two functions. 2013-08-22 00:27:10 +00:00
warn-macro-unused.h
warning_tests.c
woa-defaults.c Driver: add target definition for Windows on ARM 2014-04-04 20:31:19 +00:00
woa-wchar_t.c Target: fix wchar_t definition for Windows on ARM 2014-05-04 01:56:04 +00:00
x86_target_features.c [x86] Enable broadwell target in clang. 2014-09-19 09:53:48 +00:00