summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/Inputs
diff options
context:
space:
mode:
authorVolodymyr Sapsai <vsapsai@apple.com>2018-07-25 19:16:26 +0000
committerVolodymyr Sapsai <vsapsai@apple.com>2018-07-25 19:16:26 +0000
commit482070b40a52d1dc1425b8a647686f7949ec2e19 (patch)
tree15b605b114e016932805fb104f1d956dc44e7860 /clang/test/Preprocessor/Inputs
parentd78b3945430b928d340963c88c8d06de2e94e968 (diff)
downloadbcm5719-llvm-482070b40a52d1dc1425b8a647686f7949ec2e19.tar.gz
bcm5719-llvm-482070b40a52d1dc1425b8a647686f7949ec2e19.zip
[Preprocessor] Stop entering included files after hitting a fatal error.
Fixes a problem when we have multiple inclusion cycles and try to enumerate all possible ways to reach the max inclusion depth. rdar://problem/38871876 Reviewers: bruno, rsmith, jkorous, aaron.ballman Reviewed By: bruno, jkorous, aaron.ballman Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D48786 llvm-svn: 337953
Diffstat (limited to 'clang/test/Preprocessor/Inputs')
-rw-r--r--clang/test/Preprocessor/Inputs/cycle/a.h8
-rw-r--r--clang/test/Preprocessor/Inputs/cycle/b.h1
-rw-r--r--clang/test/Preprocessor/Inputs/cycle/c.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/Inputs/cycle/a.h b/clang/test/Preprocessor/Inputs/cycle/a.h
new file mode 100644
index 00000000000..dd3ef35d61f
--- /dev/null
+++ b/clang/test/Preprocessor/Inputs/cycle/a.h
@@ -0,0 +1,8 @@
+// Presence of 2 inclusion cycles
+// b.h -> a.h -> b.h -> ...
+// c.h -> a.h -> c.h -> ...
+// makes it unfeasible to reach max inclusion depth in all possible ways. Need
+// to stop earlier.
+
+#include "b.h"
+#include "c.h"
diff --git a/clang/test/Preprocessor/Inputs/cycle/b.h b/clang/test/Preprocessor/Inputs/cycle/b.h
new file mode 100644
index 00000000000..2243de1baf9
--- /dev/null
+++ b/clang/test/Preprocessor/Inputs/cycle/b.h
@@ -0,0 +1 @@
+#include "a.h"
diff --git a/clang/test/Preprocessor/Inputs/cycle/c.h b/clang/test/Preprocessor/Inputs/cycle/c.h
new file mode 100644
index 00000000000..2243de1baf9
--- /dev/null
+++ b/clang/test/Preprocessor/Inputs/cycle/c.h
@@ -0,0 +1 @@
+#include "a.h"
OpenPOWER on IntegriCloud