summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-12 01:31:05 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-12 01:31:05 +0000
commit45fe0364aad7bb1ff510a37819f1cff650d9ad3a (patch)
tree081c4dc1e497fa4d0e270b270116f8dd99bf8493 /clang/test
parentae451600fac14c8eb782c2f86ea8c921a4b41ba1 (diff)
downloadbcm5719-llvm-45fe0364aad7bb1ff510a37819f1cff650d9ad3a.tar.gz
bcm5719-llvm-45fe0364aad7bb1ff510a37819f1cff650d9ad3a.zip
Make precompiled headers work with -E. When we're only preprocessing
(with -E), we turn the PCH include into an implicit include of the file from which the PCH file was generated. llvm-svn: 71534
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/PCH/preprocess.c5
-rw-r--r--clang/test/PCH/preprocess.h7
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/PCH/preprocess.c b/clang/test/PCH/preprocess.c
new file mode 100644
index 00000000000..128cc0acb97
--- /dev/null
+++ b/clang/test/PCH/preprocess.c
@@ -0,0 +1,5 @@
+// RUN: clang-cc -emit-pch -o %t %S/preprocess.h &&
+// RUN: clang-cc -include-pch %t -E -o - %s | grep -c "a_typedef" | count 1
+#include "preprocess.h"
+
+int a_value;
diff --git a/clang/test/PCH/preprocess.h b/clang/test/PCH/preprocess.h
new file mode 100644
index 00000000000..39fa006181f
--- /dev/null
+++ b/clang/test/PCH/preprocess.h
@@ -0,0 +1,7 @@
+// Helper header for preprocess.c PCH test
+#ifndef PREPROCESS_H
+#define PREPROCESS_H
+
+typedef int a_typedef;
+
+#endif // PREPROCESS_H
OpenPOWER on IntegriCloud