]> granicus.if.org Git - clang/commitdiff
Frontend: Handle empty input on stdin.
authorDaniel Dunbar <daniel@zuster.org>
Sat, 21 Mar 2009 17:55:43 +0000 (17:55 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 21 Mar 2009 17:55:43 +0000 (17:55 +0000)
 - PR3854.

I think it makes more sense to change MemoryBuffer::getSTDIN (return 0
should indicate error, not empty), but it is documented to return 0
for empty inputs, and some other code appears to rely on this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67448 91177308-0d34-0410-b5e6-96231b3b80d8

test/Frontend/stdin.c [new file with mode: 0644]

diff --git a/test/Frontend/stdin.c b/test/Frontend/stdin.c
new file mode 100644 (file)
index 0000000..1b1bc67
--- /dev/null
@@ -0,0 +1,3 @@
+// RUN: clang -E - < /dev/null &> %t
+// RUN: grep '<predefines>' %t