Replace absolute linenrs in objc.dg,obj-c++.dg
[official-gcc.git] / gcc / testsuite / obj-c++.dg / syntax-error-1.mm
blob320d56c5ec13a5cd050bf56abc296a8299784dd9
1 /* Graceful handling of a syntax error.  */
2 /* { dg-do compile } */
4 #ifdef __NEXT_RUNTIME__
5 #include <Foundation/NSObject.h>
6 #define OBJECT NSObject
7 #else
8 #include <objc/Object.h>
9 #define OBJECT Object
10 #endif
12 class foo {
13   public:
14     foo();
15     virtual ~foo();
19 extern void NXLog(const char *, ...);
21 @interface Test2 : OBJECT {
23 - (void) foo2;
24 @end
26 @implementation Test2
27 - (void) foo2
28   NXLog("Hello, world!"); /* { dg-line Test2_foo2_body } */
29   /* { dg-error "expected .\{. before .NXLog." "" { target *-*-* } Test2_foo2_body } */
30 } /* { dg-error "stray .\}. between Objective\\-C\\+\\+ methods" } */
31 @end
33 /* { dg-error "expected constructor, destructor, or type conversion before" "" { target *-*-* } Test2_foo2_body } */