llvm-project/clang/test/Lexer/eof-number.c
Benjamin Kramer 8671028e95 [lex] Don't read past the end of the buffer
While dereferencing ThisTokEnd is fine and we know that it's not in
[a-zA-Z0-9_.], ThisTokEnd[1] is really past the end.

Found by asan and with a little help from clang-fuzz.

llvm-svn: 233491
2015-03-29 14:11:37 +00:00

9 lines
308 B
C

// RUN: %clang_cc1 %s -verify -fsyntax-only -Wnewline-eof
// vim: set binary noeol:
// This file intentionally ends without a \n on the last line. Make sure your
// editor doesn't add one.
// expected-error@+2{{unterminated conditional directive}}
// expected-warning@+1{{no newline at end of file}}
#if 0