aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-04 02:17:09 +0000
committerChris Lattner <sabre@nondot.org>2009-02-04 02:17:09 +0000
commit953b4b0950cb074156d66b45e8dab26725d4bccb (patch)
tree7560bca565eb6dd6467bc7d12b2acc57199d95c5
parent0e0e5da00e92a9ee97b2469009355926ee8d94bf (diff)
Add simple #line directive test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63713 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Preprocessor/line-directive.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/Preprocessor/line-directive.c b/test/Preprocessor/line-directive.c
index 3faac15c27..6946ad4854 100644
--- a/test/Preprocessor/line-directive.c
+++ b/test/Preprocessor/line-directive.c
@@ -1,4 +1,6 @@
-// RUN: clang -fsyntax-only -verify -pedantic %s
+// RUN: clang -fsyntax-only -verify -pedantic %s &&
+// RUN: clang -E %s 2>&1 | grep 'blonk.c:92:2: error: #error ABC' &&
+// RUN: clang -E %s 2>&1 | grep 'blonk.c:93:2: error: #error DEF'
#line 'a' // expected-error {{#line directive requires a positive integer argument}}
#line 0 // expected-error {{#line directive requires a positive integer argument}}
@@ -25,3 +27,10 @@
# 42 "foo" 3 1 // expected-error {{invalid flag line marker directive}}
# 42 "foo" 42 // expected-error {{invalid flag line marker directive}}
# 42 "foo" 1 2 // expected-error {{invalid flag line marker directive}}
+
+
+// These are checked by the RUN line.
+#line 92 "blonk.c"
+#error ABC // expected-error {{#error ABC}}
+#error DEF // expected-error {{#error DEF}}
+