hanchenye-llvm-project/clang/test/Preprocessor
Justin Bogner 79c93845f6 Fix whitespace handling in empty macro expansions
When a macro expansion does not result in any tokens, and the macro name
is preceded by whitespace, the whitespace should be passed to the first
token that follows the macro expansion. Similarly when a macro expansion
ends with a placemarker token, and that placemarker token is preceded by
whitespace. This worked already for top-level macro expansions, but is
now extended to also work for nested macro expansions.

Patch by Harald van Dijk!

llvm-svn: 200787
2014-02-04 19:18:35 +00:00
..
Inputs Revert "Fix assertion failures on annot_* tokens in clang -E" 2014-01-30 21:50:18 +00:00
_Pragma-dependency.c FileCheck'ize tests 2013-01-28 21:43:46 +00:00
_Pragma-dependency2.c
_Pragma-in-macro-arg.c [preprocessor] In Preprocessor::CachingLex() check whether there were more tokens 2012-04-04 02:57:01 +00:00
_Pragma-location.c [-E] Emit a rewritten _Pragma on its own line. 2012-06-15 23:33:51 +00:00
_Pragma-physloc.c FileCheck'ize tests 2013-01-28 21:43:46 +00:00
_Pragma.c PR17359: Fix off-by-one OOB on _Pragma("") and an unescaping bug 2013-09-25 16:42:48 +00:00
aarch64-target-features.c Clean up predefined macros for AArch64 to follow ACLE 2.0. 2013-11-19 01:33:17 +00:00
arm-target-features.c [ARM] Add ACLE enum/wchar size predefines 2014-01-20 10:52:00 +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 FileCheck'ize a test 2013-01-28 21:04:29 +00:00
c90.c Preprocessor: don't consider // to be a line comment in -E -std=c89 mode. 2013-03-05 22:51:04 +00:00
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 [-E] Emit a rewritten _Pragma on its own line. 2012-06-15 23:33:51 +00:00
comment_save_if.c Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
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
cxx_oper_keyword_ms_compat.cpp Move suport for redefining operator keywords from -fms-extensions to -fms-compatibility. 2012-03-01 00:13:46 +00:00
cxx_oper_spelling.cpp FileCheck-ify some clang grep tests that use double quotes 2013-04-10 21:10:39 +00:00
cxx_or.cpp
cxx_true.cpp Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
cxx_xor.cpp
dependencies-and-pp.c Fix failing dependencies-and-pp.c test 2013-04-11 13:43:19 +00:00
directive-invalid.c
disabled-cond-diags.c Migrate tests to -verify 2013-01-26 17:11:39 +00:00
disabled-cond-diags2.c Do not complain about junk on the end of a #endif in a skipped block. Such junk 2012-06-21 00:35:03 +00:00
dump-macros-spacing.c
dump-macros-undef.c
dump-options.c
dump_macros.c
dumptokens_phyloc.c
expr_comma.c
expr_define_expansion.c Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
expr_invalid_tok.c
expr_liveness.c
expr_multichar.c Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
expr_usual_conversions.c
extension-warning.c
feature_tests.c Add the intrinsic __builtin_convertvector 2013-09-18 03:29:45 +00:00
file_to_include.h
first-line-indent.c Fix the indentation of the first line of preprocessor output 2013-01-28 04:37:37 +00:00
function_macro_file.c
function_macro_file.h
has_attribute.c __has_attribute now understands target-specific attributes. So when you ask whether an ARM target has the "interrupt" attribute, it will return true for ARM and MSP430 targets, and false for others. 2014-01-09 22:57:44 +00:00
has_include.c PR15539: Record "evaluating if/elif condition" flag in the right place 2013-03-18 23:22:28 +00:00
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
if_warning.c
ifdef-recover.c Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
import_self.c [clang-tests] Changed relative paths to absolute paths in run command for annotate-macro-args.m, get-cursor-macro-args.m, import_self.c. 2012-10-01 23:39:44 +00:00
include-directive1.c
include-directive2.c
include-directive3.c
include-macros.c
include-pth.c
indent_macro.c
init.c Test pre-defined macros of aarch64-netbsd. 2014-02-02 21:55:32 +00:00
invalid-__has_warning1.c Refactored duplicate string literal lexing code within Preprocessor, into a 2012-11-17 19:15:38 +00:00
invalid-__has_warning2.c Refactored duplicate string literal lexing code within Preprocessor, into a 2012-11-17 19:15:38 +00:00
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 Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
macho-embedded-predefines.c MachO: use *-*-*-macho for MachO embedded targets. 2014-01-16 08:48:16 +00:00
macro-multiline.c.ignoreme Disable clang/test/Preprocessor/macro-multiline.c for now, while investigating lit.ShUtil.parser. 2012-12-06 01:09:31 +00:00
macro_arg_directive.c Make preprocessor act in a GCC-compatible fashion when a macro is redefined 2012-08-30 13:38:46 +00:00
macro_arg_directive.h Don't allow #include (and its friends #import, #include_next and 2011-12-16 22:50:01 +00:00
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 [preprocessor] When "merging" macro argument tokens into one SLocEntry chunk, 2012-12-19 23:55:44 +00:00
macro_arg_slocentry_merge.h [preprocessor] When "merging" macro argument tokens into one SLocEntry chunk, 2012-12-19 23:55:44 +00:00
macro_backslash.c Handle -D arguments ending in a backslash. 2013-08-28 20:35:38 +00:00
macro_disable.c
macro_expand.c FileCheck'ize tests 2013-01-25 20:34:08 +00:00
macro_expand_empty.c Make Preprocessor::Lex non-recursive. 2013-09-19 00:41:32 +00:00
macro_expandloc.c Migrate tests to -verify and merge them 2013-01-25 20:33:53 +00:00
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 Improved support for removing the comma preceding __VA_ARGS__ where __VA_ARGS__ 2012-11-09 13:24:30 +00:00
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 [preprocessor] Allow comparing two macro definitions syntactically instead of only lexically. 2013-04-03 17:39:30 +00:00
macro_not_define.c
macro_paste_bad.c Simplify test case added in r194059 2013-11-05 10:05:58 +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 Allow -verify directives to be filtered by preprocessing. 2012-07-11 19:58:23 +00:00
macro_paste_commaext.c Fix whitespace handling in ## operator 2014-02-04 19:18:28 +00:00
macro_paste_empty.c [Preprocessor] Prevent expansion of y in x ## y when x is empty 2013-05-25 01:35:18 +00:00
macro_paste_hard.c
macro_paste_hashhash.c
macro_paste_identifier_error.c Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
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_rescan.c FileCheck'ize tests 2013-02-09 16:41:47 +00:00
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 Add some semantic checks for OpenCL. Variadic macros, VLAs and bitfields are not supported. 2013-01-17 17:35:00 +00:00
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 Match MSVC's handling of commas during macro argument expansion 2013-06-26 17:16:08 +00:00
microsoft-header-search.c Move MS header search test inputs to Inputs/ 2013-12-27 20:41:49 +00:00
microsoft-import.c Migrate a test to -verify 2013-01-28 20:55:54 +00:00
missing-system-header.c
missing-system-header.h
mmx.c Pass a target triple explicitly to check platform specific macros definitions. 2012-05-09 18:49:52 +00:00
non_fragile_feature.m
non_fragile_feature1.m Rename the GCC Objective-C runtime to gcc from gnu-fragile and the GNUstep 2012-07-03 20:49:52 +00:00
objc-pp.m Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
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 Simplify logic for avoiding concatenation after numeric constants. 2013-02-08 22:30:31 +00:00
overflow.c
pic.c Teach Clang about PIE compilations. This is the first step of PR12380. 2012-04-08 16:40:35 +00:00
pp-modules.c When emitting a preprocessed file with implicit module imports, make sure line directives are emitted in the next line. 2013-04-29 17:26:22 +00:00
pp-modules.h [test] add missing header for the test. 2013-04-29 17:31:48 +00:00
pp-record.c [preprocessing record] Have the MacroDefinitions map point to the MacroDefinition object instead 2013-02-22 18:35:59 +00:00
pp-record.h [preprocessor] Handle correctly inclusion directives that have macro expansions, e.g 2012-03-27 18:47:48 +00:00
pr2086.c
pr2086.h
pr13851.c Allow -MF to be used in combination with -E -M or -E -MM. 2012-09-26 19:01:49 +00:00
pragma-captured.c Parser support for #pragma clang __debug captured 2013-04-16 18:41:26 +00:00
pragma-pushpop-macro.c Fixed a problem with #pragma push_macro/pop_macro implementation. 2012-08-29 16:56:24 +00:00
pragma_diagnostic.c Made the "expected string literal" diagnostic more expressive 2012-11-17 19:16:52 +00:00
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 Fix off-by-one error in #pragma clang system_header. 2013-04-17 19:09:18 +00:00
pragma_sysheader.h
pragma_unknown.c FileCheck'ize a test 2013-02-09 16:25:38 +00:00
predefined-arch-macros.c Driver: Add support for -march=bdver3 on x86. 2013-11-04 10:29:51 +00:00
predefined-exceptions.m
predefined-macros.c Fix PR 12730: Add _GCC_HAVE_SYNC_COMPARE_AND_SWAP macros for ARM 2013-09-30 22:51:32 +00:00
print_line_count.c FileCheck'ize tests 2013-02-09 16:41:47 +00:00
print_line_empty_file.c
print_line_include.c Make sure clang puts tokens from different files on separate lines in "-E -P" mode. <rdar://problem/12774044> 2013-01-09 03:16:42 +00:00
print_line_include.h Make sure clang puts tokens from different files on separate lines in "-E -P" mode. <rdar://problem/12774044> 2013-01-09 03:16:42 +00:00
print_line_track.c
pushable-diagnostics.c
skipping_unclean.c FileCheck'ize tests 2013-02-09 16:41:47 +00:00
stdint.c [Mips] Add tests for MIPS/MIPS64 type defines and type limits macros. No 2013-11-14 11:15:10 +00:00
stringize_misc.c
stringize_space.c FileCheck'ize and merge tests 2013-01-28 17:31:40 +00:00
traditional-cpp.c Fix "//" comments with -traditional-cpp in C++. 2013-08-28 20:53:32 +00:00
ucn-allowed-chars.c Properly validate UCNs for C99 and C++03 (both more restrictive than C(++)11). 2013-02-09 01:10:25 +00:00
ucn-pp-identifier.c Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
undef-error.c Add pedantic warning -Wempty-translation-unit (C11 6.9p1). 2012-06-06 17:25:21 +00:00
unterminated.c
user_defined_system_framework.c Correct test inovocations to use %clang_cc1 rather than direct invocation (so that it can have additional options set when trying to debug issues causing regressions). 2012-10-25 13:56:30 +00:00
utf8-allowed-chars.c Properly validate UCNs for C99 and C++03 (both more restrictive than C(++)11). 2013-02-09 01:10:25 +00:00
warn-disabled-macro-expansion.c Reinstate r173952, this time limiting it to exactly the form 2013-01-30 23:10:17 +00:00
warn-macro-unused.c Split isFromMainFile into two functions. 2013-08-22 00:27:10 +00:00
warn-macro-unused.h
warning_tests.c Made the "expected string literal" diagnostic more expressive 2012-11-17 19:16:52 +00:00
x86_target_features.c Enabling 3DNow! prefetch instruction support for a few AMD processors in the 2013-10-16 19:07:02 +00:00