summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-03-29 18:07:29 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-03-29 18:07:29 +0000
commit851f310cec3376982097f2ff69b6d8d5d00af785 (patch)
tree4c3ae07249abd5c4865e2c76f1c1a103f7f30db5 /clang/test
parentd15c2805ab833180dedb2cadd1420e56ec0bd295 (diff)
downloadbcm5719-llvm-851f310cec3376982097f2ff69b6d8d5d00af785.tar.gz
bcm5719-llvm-851f310cec3376982097f2ff69b6d8d5d00af785.zip
[edit] Don't hit an assert when trying to delete a trailing space at EOF
The buffer is guaranteed to be zero-terminated so we can just circumvent the check. Found by afl-fuzz. llvm-svn: 233496
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/FixIt/fixit-eof-space.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/FixIt/fixit-eof-space.c b/clang/test/FixIt/fixit-eof-space.c
new file mode 100644
index 00000000000..dc9a45d0c52
--- /dev/null
+++ b/clang/test/FixIt/fixit-eof-space.c
@@ -0,0 +1,9 @@
+// RUN: not %clang_cc1 %s -fsyntax-only -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
+// vim: set binary noeol:
+
+// This file intentionally ends without a \n on the last line. Make sure your
+// editor doesn't add one. The trailing space is also intentional.
+
+// CHECK: :9:8: warning: duplicate 'extern' declaration specifier
+// CHECK: fix-it:"{{.*}}":{9:8-9:15}:""
+extern extern \ No newline at end of file
OpenPOWER on IntegriCloud