Implement handling of file entry/exit notifications from GNU
line markers, including maintenance of the virtual include stack.
For something like this:
# 42 "bar.c" 1
# 142 "bar2.c" 1
#warning zappa
# 92 "bar.c" 2
#warning gonzo
# 102 "foo.c" 2
#warning bonkta
we now produce these three warnings:
#1:
In file included from foo.c:3:
In file included from bar.c:42:
bar2.c:143:2: warning: #warning zappa
#warning zappa
^
#2:
In file included from foo.c:3:
bar.c:92:2: warning: #warning gonzo
#warning gonzo
^
#3:
foo.c:102:2: warning: #warning bonkta
#warning bonkta
^
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63722 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Preprocessor/line-directive.c b/test/Preprocessor/line-directive.c
index 062081c..a1590fa 100644
--- a/test/Preprocessor/line-directive.c
+++ b/test/Preprocessor/line-directive.c
@@ -6,7 +6,7 @@
#line 0 // expected-error {{#line directive requires a positive integer argument}}
#line 2147483648 // expected-warning {{C requires #line number to be less than 2147483648, allowed as extension}}
#line 42 // ok
-#line 42 'a' // expected-error {{nvalid filename for #line directive}}
+#line 42 'a' // expected-error {{invalid filename for #line directive}}
#line 42 "foo/bar/baz.h" // ok
@@ -16,9 +16,10 @@
# 42
# 42 "foo"
-# 42 "foo" 1 3
-# 42 "foo" 2 3
-# 42 "foo" 2 3 4
+# 42 "foo" 2 // expected-error {{invalid line marker flag '2': cannot pop empty include stack}}
+# 42 "foo" 1 3 // enter
+# 42 "foo" 2 3 // exit
+# 42 "foo" 2 3 4 // expected-error {{invalid line marker flag '2': cannot pop empty include stack}}
# 42 "foo" 3 4
# 'a' // expected-error {{invalid preprocessing directive}}