mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 19:45:40 -04:00

Before this patch, Lex() would recurse whenever the current lexer changed (e.g. upon entry into a macro). This patch turns the recursion into a loop: the various lex routines now don't return a token when the current lexer changes, and at the top level Preprocessor::Lex() now loops until it finds a token. Normally, the recursion wouldn't end up being very deep, but the recursion depth can explode in edge cases like a bunch of consecutive macros which expand to nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this patch). <rdar://problem/14569770> llvm-svn: 190980
13 lines
272 B
C
13 lines
272 B
C
// The 1 and # should not go on the same line.
|
|
// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
|
|
// CHECK: {{^1$}}
|
|
// CHECK-NEXT: {{^ #$}}
|
|
// CHECK-NEXT: {{^2$}}
|
|
// CHECK-NEXT: {{^ #$}}
|
|
#define EMPTY
|
|
#define IDENTITY(X) X
|
|
1
|
|
EMPTY #
|
|
2
|
|
IDENTITY() #
|