Commit Graph

10 Commits

Author SHA1 Message Date
Benjamin Kramer 28954c618f [lex] Don't create a garbage token if parsing of __has_include fails.
It will crash downstream somewhere. Found by afl-fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233493 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-29 15:33:29 +00:00
David Blaikie abc0bea57d PR15539: Record "evaluating if/elif condition" flag in the right place
The previous implementation missed the case where the elif condition was
evaluated from the context of an #ifdef that was false causing PR15539.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177345 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:22:28 +00:00
Argyrios Kyrtzidis b3a49f567a Add a test to make sure __has_include works from inside a macro.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176152 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27 01:34:48 +00:00
Aaron Ballman 31672b1745 No longer crashing with an assert when __has_include or __has_include_next is used outside of a preprocessor directive. This fixes PR14837.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172639 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 19:32:21 +00:00
Eli Friedman a0f2d02d16 Make __has_include a bit more resilient in the presence of macros. <rdar://problem/12748859>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171939 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 02:20:00 +00:00
Richard Trieu 97bc3d54a9 Fix for PR13334. This prevents crashes that result from badly formed
expressions involving __has_include


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166438 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-22 20:28:48 +00:00
Jordan Rose 4b49756fdc Start testing some commented-out cases of badly-formed __has_include.
Filed PR13334 for the cases that cause the compiler to crash, and
PR13335 for the cases where we should be recovering more gracefully.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160070 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-11 20:12:19 +00:00
Chandler Carruth ba772ba69b This really seems like a boring set of fixes to our tests to make them more
independent of the underlying system. Let me know if any of these are too
aggressive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119345 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 10:26:08 +00:00
Daniel Dunbar a5728872c7 Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 20:14:24 +00:00
John Thompson 92bd8c70a6 Added __has_include and __has_include_next.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 22:28:12 +00:00