[cfe-commits] r63713 - /cfe/trunk/test/Preprocessor/line-directive.c

Chris Lattner sabre at nondot.org
Tue Feb 3 18:17:09 PST 2009


Author: lattner
Date: Tue Feb  3 20:17:09 2009
New Revision: 63713

URL: http://llvm.org/viewvc/llvm-project?rev=63713&view=rev
Log:
Add simple #line directive test.

Modified:
    cfe/trunk/test/Preprocessor/line-directive.c

Modified: cfe/trunk/test/Preprocessor/line-directive.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/line-directive.c?rev=63713&r1=63712&r2=63713&view=diff

==============================================================================
--- cfe/trunk/test/Preprocessor/line-directive.c (original)
+++ cfe/trunk/test/Preprocessor/line-directive.c Tue Feb  3 20:17:09 2009
@@ -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}}
+





More information about the cfe-commits mailing list