+2017-04-28 Tom de Vries <tom@codesourcery.com>
+
+ PR testsuite/80557
+ * obj-c++.dg/bitfield-1.mm: Replace absolute linenrs.
+ * obj-c++.dg/bitfield-4.mm: Same.
+ * obj-c++.dg/bitfield-5.mm: Same.
+ * obj-c++.dg/exceptions-3.mm: Same.
+ * obj-c++.dg/exceptions-5.mm: Same.
+ * obj-c++.dg/method-1.mm: Same.
+ * obj-c++.dg/method-12.mm: Same.
+ * obj-c++.dg/method-13.mm: Same.
+ * obj-c++.dg/method-15.mm: Same.
+ * obj-c++.dg/method-16.mm: Same.
+ * obj-c++.dg/property/at-property-18.mm: Same.
+ * obj-c++.dg/property/at-property-25.mm: Same.
+ * obj-c++.dg/property/at-property-5.mm: Same.
+ * obj-c++.dg/property/dynamic-2.mm: Same.
+ * obj-c++.dg/property/property-neg-3.mm: Same.
+ * obj-c++.dg/protocol-inheritance-1.mm: Same.
+ * obj-c++.dg/protocol-inheritance-2.mm: Same.
+ * obj-c++.dg/syntax-error-1.mm: Same.
+ * obj-c++.dg/try-catch-13.mm: Same.
+ * objc.dg/bitfield-4.m: Same.
+ * objc.dg/class-1.m: Same.
+ * objc.dg/method-11.m: Same.
+ * objc.dg/method-6.m: Same.
+ * objc.dg/method-7.m: Same.
+ * objc.dg/method-9.m: Same.
+ * objc.dg/missing-proto-3.m: Same.
+ * objc.dg/naming-2.m: Same.
+ * objc.dg/property/at-property-16.m: Same.
+ * objc.dg/property/at-property-18.m: Same.
+ * objc.dg/property/at-property-25.m: Same.
+ * objc.dg/property/at-property-5.m: Same.
+ * objc.dg/property/dynamic-2.m: Same.
+ * objc.dg/property/property-neg-3.m: Same.
+ * objc.dg/protocol-inheritance-1.m: Same.
+ * objc.dg/protocol-inheritance-2.m: Same.
+
2017-04-28 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/tree-ssa/cmpexactdiv-2.c: Update for X-Z OP Y-Z.
signed e: 5;
unsigned f: 4;
enum Enum g: 3;
-}
+} /* { dg-line interface_Derived } */
@end
-struct Derived_0 {
+struct Derived_0 { /* { dg-line struct_Derived_0 } */
Class isa;
unsigned a: 2;
int b: 3;
@interface Leaf: Derived {
@public
signed h: 2;
-}
+} /* { dg-line interface_Leaf } */
@end
-struct Leaf_0 {
+struct Leaf_0 { /* { dg-line struct_Leaf_0 } */
Class isa;
unsigned a: 2;
int b: 3;
/* Note that the semicolon after @defs(...) is optional. */
typedef struct { @defs(Base) } Base_t; /* { dg-warning "padding struct size to alignment boundary" } */
-typedef struct { @defs(Derived); } Derived_t;
-typedef struct { @defs(Leaf); } Leaf_t;
+typedef struct { @defs(Derived); } Derived_t; /* { dg-line Derived_t_def } */
+typedef struct { @defs(Leaf); } Leaf_t; /* { dg-line Leaf_t_def } */
int main(void)
{
/* { dg-prune-output "In file included from" } Ignore this message. */
/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */
-/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 42 } */
-/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 45 } */
-/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 59 } */
-/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 62 } */
-/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 77 } */
-/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 78 } */
+/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } interface_Derived } */
+/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } struct_Derived_0 } */
+/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } interface_Leaf } */
+/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } struct_Leaf_0 } */
+/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } Derived_t_def } */
+/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } Leaf_t_def } */
signed e: 5;
int f: 4;
enum Enum g: 3;
-}
+} /* { dg-line interface_Derived } */
@end
/* Note that the semicolon after @defs(...) is optional. */
typedef struct { @defs(Base) } Base_t; /* { dg-warning "padding struct size to alignment boundary" } */
-typedef struct { @defs(Derived); } Derived_t;
+typedef struct { @defs(Derived); } Derived_t; /* { dg-line Derived_t_def } */
int main(void)
{
/* { dg-prune-output "In file included from" } Ignore this message. */
/* { dg-bogus "padding struct to align" "PR23610" { target *-*-* } 0 } */
-/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 28 } */
-/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } 34 } */
+/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } interface_Derived } */
+/* { dg-bogus "padding struct size" "PR23610" { xfail lp64 } Derived_t_def } */
@end
@interface WithBitfields: Base {
- void *isa;
- unsigned a: 3;
+ void *isa; /* { dg-line WithBitfields_isa } */
+ unsigned a: 3; /* { dg-line WithBitfields_a } */
signed b: 4;
- int c: 5;
+ int c: 5; /* { dg-line WithBitfields_c } */
}
@end
@implementation WithBitfields {
char *isa; /* { dg-error "conflicting instance variable type .char \\*isa." } */
- /* { dg-error "previous declaration of .void \\*isa." "" { target *-*-* } 13 } */
+ /* { dg-error "previous declaration of .void \\*isa." "" { target *-*-* } WithBitfields_isa } */
unsigned a: 5; /* { dg-error "conflicting instance variable type .unsigned( int)? a: 5." } */
- /* { dg-error "previous declaration of .unsigned( int)? a: 3." "" { target *-*-* } 14 } */
+ /* { dg-error "previous declaration of .unsigned( int)? a: 3." "" { target *-*-* } WithBitfields_a } */
signed b: 4; /* This one is fine. */
int c: 3; /* { dg-error "conflicting instance variable type .int c: 3." } */
- /* { dg-error "previous declaration of .int c: 5." "" { target *-*-* } 16 } */
+ /* { dg-error "previous declaration of .int c: 5." "" { target *-*-* } WithBitfields_c } */
}
@end
@interface MyObject
{
Class isa;
-}
+} /* { dg-line interface_MyObject } */
@end
@implementation MyObject
@try { @throw object; }
@catch (MyObject x) /* { dg-error "@catch parameter is not a known Objective-C class type" } */
{ /* { dg-error "no matching function" "" { target *-*-* } .-1 } */
- dummy++; /* { dg-message "MyObject" "" { target *-*-* } 13 } */
- } /* { dg-message "candidate" "" { target *-*-* } 13 } */
+ dummy++; /* { dg-message "MyObject" "" { target *-*-* } interface_MyObject } */
+ } /* { dg-message "candidate" "" { target *-*-* } interface_MyObject } */
@try { @throw object; }
@catch (static MyObject *x) /* { dg-error "storage class" } */
{
@interface MyObject
{
Class isa;
-}
+} /* { dg-line interface_MyObject } */
@end
@implementation MyObject
@try { @throw object; }
@catch (MyObject) /* { dg-error "@catch parameter is not a known Objective-C class type" } */
{ /* { dg-error "no matching function" "" { target *-*-* } .-1 } */
- dummy++; /* { dg-message "MyObject" "" { target *-*-* } 13 } */
- } /* { dg-message "candidate" "" { target *-*-* } 13 } */
+ dummy++; /* { dg-message "MyObject" "" { target *-*-* } interface_MyObject } */
+ } /* { dg-message "candidate" "" { target *-*-* } interface_MyObject } */
@try { @throw object; }
@catch (static MyObject *) /* { dg-error "storage class" } */
@end
int main(void) {
- id i = [(Int2 *)[Int1 classMethod1] int2Method]; /* { dg-bogus "may not respond to" } */
+ id i = [(Int2 *)[Int1 classMethod1] int2Method]; /* { dg-line i_def } */
+ /* { dg-bogus "may not respond to" "" { target *-*-* } i_def } */
int j = [(Int2 *)[Int2 classMethod2] instanceMethod: 45]; /* { dg-bogus "multiple methods" } */
- /* { dg-bogus "invalid conversion" "" { target *-*-* } 25 } */
- /* { dg-bogus "invalid conversion" "" { target *-*-* } 25 } */
+ /* { dg-bogus "invalid conversion" "" { target *-*-* } i_def } */
+ /* { dg-bogus "invalid conversion" "" { target *-*-* } i_def } */
return j;
}
#include <objc/Protocol.h>
@interface Base
-- (unsigned)port;
+- (unsigned)port; /* { dg-line Base_port } */
@end
@interface Derived: Base
- (Object *)port;
-+ (Protocol *)port;
++ (Protocol *)port; /* { dg-line Derived_port_last } */
- (id)starboard;
@end
Class receiver;
[receiver port]; /* { dg-warning "multiple methods named .\\+port. found" } */
- /* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } 10 } */
- /* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } 15 } */
+ /* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } Base_port } */
+ /* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } Derived_port_last } */
[receiver starboard]; /* { dg-warning "no .\\+starboard. method found" } */
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } .-1 } */
#include "../objc-obj-c++-shared/TestsuiteObject.h"
@interface Class1
-- (void)setWindow:(TestsuiteObject *)wdw;
+- (void)setWindow:(TestsuiteObject *)wdw; /* { dg-line Class1_setWindow } */
@end
@interface Class2
-- (void)setWindow:(Class1 *)window;
+- (void)setWindow:(Class1 *)window; /* { dg-line Class2_setWindow } */
@end
id foo(void) {
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } .-2 } */
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } .-3 } */
[obj2 setWindow:nil]; /* { dg-warning "multiple methods named .\\-setWindow:. found" } */
- /* { dg-message "using .\\-\\(void\\)setWindow:\\(TestsuiteObject \\*\\)wdw." "" { target *-*-* } 8 } */
- /* { dg-message "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } 12 } */
+ /* { dg-message "using .\\-\\(void\\)setWindow:\\(TestsuiteObject \\*\\)wdw." "" { target *-*-* } Class1_setWindow } */
+ /* { dg-message "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } Class2_setWindow } */
return obj;
}
#include "../objc-obj-c++-shared/TestsuiteObject.h"
@protocol MyObject
-- (id)initWithData:(TestsuiteObject *)data;
+- (id)initWithData:(TestsuiteObject *)data; /* { dg-line MyObject_initWithData } */
@end
@protocol SomeOther
-- (id)initWithData:(int)data;
+- (id)initWithData:(int)data; /* { dg-line SomeOther_initWithData } */
@end
@protocol MyCoding
-- (id)initWithData:(id<MyObject, MyCoding>)data;
+- (id)initWithData:(id<MyObject, MyCoding>)data; /* { dg-line MyCoding_initWithData } */
@end
@interface NTGridDataObject: TestsuiteObject <MyCoding>
}
+ (NTGridDataObject*)dataObject:(id<MyObject, MyCoding>)data
{
- NTGridDataObject *result = [[NTGridDataObject alloc] initWithData:data];
+ NTGridDataObject *result = [[NTGridDataObject alloc] initWithData:data]; /* { dg-line result_init } */
/* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } .-1 } */
- /* { dg-message "using .\\-\\(id\\)initWithData:\\(TestsuiteObject \\*\\)data." "" { target *-*-* } 9 } */
- /* { dg-message "also found .\\-\\(id\\)initWithData:\\(id <MyObject, MyCoding>\\)data." "" { target *-*-* } 17 } */
- /* { dg-message "also found .\\-\\(id\\)initWithData:\\(int\\)data." "" { target *-*-* } 13 } */
+ /* { dg-message "using .\\-\\(id\\)initWithData:\\(TestsuiteObject \\*\\)data." "" { target *-*-* } MyObject_initWithData } */
+ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(id <MyObject, MyCoding>\\)data." "" { target *-*-* } MyCoding_initWithData } */
+ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(int\\)data." "" { target *-*-* } SomeOther_initWithData } */
/* The following warning is a consequence of picking the "wrong" method signature. */
- /* { dg-warning "passing argument 1 of .initWithData:. from distinct Objective\\-C type" "" { target *-*-* } 33 } */
+ /* { dg-warning "passing argument 1 of .initWithData:. from distinct Objective\\-C type" "" { target *-*-* } result_init } */
return result;
}
@end
#include <objc/objc.h>
@interface Object1
-- (void)initWithData:(Object1 *)data;
+- (void)initWithData:(Object1 *)data; /* { dg-line Object1_initWithData } */
@end
@interface Object2
-- (id)initWithData:(Object1 *)data;
+- (id)initWithData:(Object1 *)data; /* { dg-line Object2_initWithData } */
@end
@interface Object3
-- (id)initWithData:(Object2 *)data;
+- (id)initWithData:(Object2 *)data; /* { dg-line Object3_initWithData } */
@end
void foo(void) {
id obj1, obj2 = 0;
- obj2 = [obj1 initWithData: obj2];
+ obj2 = [obj1 initWithData: obj2]; /* { dg-line obj2_assign } */
/* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } .-1 } */
- /* { dg-message "using .\\-\\(void\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } 13 } */
- /* { dg-message "also found .\\-\\(id\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } 17 } */
- /* { dg-message "also found .\\-\\(id\\)initWithData:\\(Object2 \\*\\)data." "" { target *-*-* } 21 } */
+ /* { dg-message "using .\\-\\(void\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } Object1_initWithData } */
+ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } Object2_initWithData } */
+ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(Object2 \\*\\)data." "" { target *-*-* } Object3_initWithData } */
/* The following error is a consequence of picking the "wrong" method signature. */
- /* { dg-error "void value not ignored as it ought to be" "" { target *-*-* } 26 } */
+ /* { dg-error "void value not ignored as it ought to be" "" { target *-*-* } obj2_assign } */
}
{
Class isa;
}
-@property (assign) id a;
-@property (retain) id b;
-@property int c;
-@property (nonatomic) int d;
-@property int e;
-@property int f;
-@property int g;
+@property (assign) id a; /* { dg-line MyRootClass_a } */
+@property (retain) id b; /* { dg-line MyRootClass_b } */
+@property int c; /* { dg-line MyRootClass_c } */
+@property (nonatomic) int d; /* { dg-line MyRootClass_d } */
+@property int e; /* { dg-line MyRootClass_e } */
+@property int f; /* { dg-line MyRootClass_f } */
+@property int g; /* { dg-line MyRootClass_g } */
@property (readonly) int h;
-@property (readonly,getter=getMe) int i;
+@property (readonly,getter=getMe) int i; /* { dg-line MyRootClass_i } */
@property (nonatomic) float j;
@end
@interface MyRootClass (Category)
@property (retain) id a; /* { dg-warning "assign semantics attributes of property .a. conflict with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 16 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_a } */
@property (assign) id b; /* { dg-warning "assign semantics attributes of property .b. conflict with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 17 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_b } */
@property (nonatomic) int c; /* { dg-warning ".nonatomic. attribute of property .c. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 18 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_c } */
@property int d; /* { dg-warning ".nonatomic. attribute of property .d. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 19 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_d } */
@property (setter=setX:) int e; /* { dg-warning ".setter. attribute of property .e. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 20 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_e } */
@property (getter=x) int f; /* { dg-warning ".getter. attribute of property .f. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 21 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_f } */
@property (readonly) int g; /* { dg-warning ".readonly. attribute of property .g. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 22 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_g } */
@property (readwrite) int h; /* Ok */
@property (readonly) int i; /* { dg-warning ".getter. attribute of property .i. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 24 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_i } */
@property (nonatomic) float j; /* Ok */
@end
@implementation MySubClass4
@end
-
-/* { dg-warning "incomplete implementation of class" "" { target *-*-* } 81 } */
-/* { dg-warning "method definition for ..setCount1:. not found" "" { target *-*-* } 81 } */
-/* { dg-warning "method definition for ..count1. not found" "" { target *-*-* } 81 } */
-/* { dg-warning "method definition for ..count2. not found" "" { target *-*-* } 81 } */
-/* { dg-warning "class .MySubClass4. does not fully implement the .count2. protocol" "" { target *-*-* } 81 } */
+/* { dg-warning "incomplete implementation of class" "" { target *-*-* } .-1 } */
+/* { dg-warning "method definition for ..setCount1:. not found" "" { target *-*-* } .-2 } */
+/* { dg-warning "method definition for ..count1. not found" "" { target *-*-* } .-3 } */
+/* { dg-warning "method definition for ..count2. not found" "" { target *-*-* } .-4 } */
+/* { dg-warning "class .MySubClass4. does not fully implement the .count2. protocol" "" { target *-*-* } .-5 } */
@property (retain) int property_c; /* { dg-error ".retain. attribute is only valid for Objective-C objects" } */
@property (copy) int property_d; /* { dg-error ".copy. attribute is only valid for Objective-C objects" } */
-@property (retain) id property_e;
+@property (retain) id property_e; /* { dg-line property_e_first } */
@property (retain) id property_f;
@property (retain) id property_g;
@property (retain) id property_h;
@property (retain) id property_e; /* { dg-error "redeclaration of property .property_e." } */
- /* { dg-message "originally specified here" "" { target *-*-* } 26 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } property_e_first } */
@end
@property id test; /* { dg-error "misplaced .@property. Objective-C.. construct" } */
@end
@implementation AnotherTest
-@dynamic one;
+@dynamic one; /* { dg-line dynamic_one_first } */
@dynamic one; /* { dg-error "property .one. already specified in .@dynamic." } */
- /* { dg-message "originally specified here" "" { target *-*-* } 41 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } dynamic_one_first } */
@dynamic three; /* { dg-error "no declaration of property .three. found in the interface" } */
@end
@end
@implementation Person
-@dynamic firstName;
+@dynamic firstName; /* { dg-line firstName_first } */
@synthesize firstName; /* { dg-error "property .firstName. already specified in .@dynamic." } */
- /* { dg-message "originally specified here" "" { target *-*-* } 11 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } firstName_first } */
@end
@implementation MySubClass2
@end /* Warnings here, below. */
-
-/* { dg-warning "incomplete implementation of class .MySubClass2." "" { target *-*-* } 50 } */
-/* { dg-warning "method definition for .\\-method2. not found" "" { target *-*-* } 50 } */
-/* { dg-warning "class .MySubClass2. does not fully implement the .MyProtocol2. protocol" "" { target *-*-* } 50 } */
+/* { dg-warning "incomplete implementation of class .MySubClass2." "" { target *-*-* } .-1 } */
+/* { dg-warning "method definition for .\\-method2. not found" "" { target *-*-* } .-2 } */
+/* { dg-warning "class .MySubClass2. does not fully implement the .MyProtocol2. protocol" "" { target *-*-* } .-3 } */
@implementation MySubClass
@end
-
-/* { dg-warning "incomplete implementation of class .MySubClass." "" { target *-*-* } 39 } */
-/* { dg-warning "method definition for .\\-method. not found" "" { target *-*-* } 39 } */
-/* { dg-warning "class .MySubClass. does not fully implement the .MyProtocol. protocol" "" { target *-*-* } 39 } */
+/* { dg-warning "incomplete implementation of class .MySubClass." "" { target *-*-* } .-1 } */
+/* { dg-warning "method definition for .\\-method. not found" "" { target *-*-* } .-2 } */
+/* { dg-warning "class .MySubClass. does not fully implement the .MyProtocol. protocol" "" { target *-*-* } .-3 } */
/* The subclass instead does not inherit the method method2 (and does
@implementation MySubClass2
@end /* Warnings here, below. */
-
-/* { dg-warning "incomplete implementation of class .MySubClass2." "" { target *-*-* } 53 } */
-/* { dg-warning "method definition for .\\-method2. not found" "" { target *-*-* } 53 } */
-/* { dg-warning "class .MySubClass2. does not fully implement the .MyProtocol2. protocol" "" { target *-*-* } 53 } */
+/* { dg-warning "incomplete implementation of class .MySubClass2." "" { target *-*-* } .-1 } */
+/* { dg-warning "method definition for .\\-method2. not found" "" { target *-*-* } .-2 } */
+/* { dg-warning "class .MySubClass2. does not fully implement the .MyProtocol2. protocol" "" { target *-*-* } .-3 } */
@implementation Test2
- (void) foo2
- NXLog("Hello, world!"); /* { dg-error "expected .\{. before .NXLog." } */
+ NXLog("Hello, world!"); /* { dg-line Test2_foo2_body } */
+ /* { dg-error "expected .\{. before .NXLog." "" { target *-*-* } Test2_foo2_body } */
} /* { dg-error "stray .\}. between Objective\\-C\\+\\+ methods" } */
@end
-/* { dg-error "expected constructor, destructor, or type conversion before" "" { target *-*-* } 28 } */
+/* { dg-error "expected constructor, destructor, or type conversion before" "" { target *-*-* } Test2_foo2_body } */
- (void) testSpoon;
@end
-extern void some_func (int *);
+extern void some_func (int *); /* { dg-line some_func_decl } */
@implementation TestMyTests
- (void) testSpoon {
typeof(q) k = 66;
some_func (&j);
/* { dg-error "invalid conversion" "" { target *-*-* } .-1 } */
-/* { dg-message "initializing argument" "" { target *-*-* } 12 } */
+/* { dg-message "initializing argument" "" { target *-*-* } some_func_decl } */
some_func (&k);
}
@catch (id exc) {
/* { dg-error "invalid conversion" "" { target *-*-* } .-1 } */
/* The following is disabled as it is already checked above and the testsuites seems
to count multiple different identical errors on the same line only once */
-/* dg-message "initializing argument" "" { target *-*-* } 12 */
+/* dg-message "initializing argument" "" { target *-*-* } some_func_decl */
}
@catch (id exc) {
@throw;
/* { dg-error "invalid conversion" "" { target *-*-* } .-1 } */
/* The following is disabled as it is already checked above and the testsuites seems
to count multiple different identical errors on the same line only once */
-/* dg-message "initializing argument" "" { target *-*-* } 12 */
+/* dg-message "initializing argument" "" { target *-*-* } some_func_decl */
some_func (&k);
}
@catch (id exc) {
@end
@interface WithBitfields: Base {
- void *isa;
- unsigned a: 3;
+ void *isa; /* { dg-line WithBitFields_isa } */
+ unsigned a: 3; /* { dg-line WithBitFields_a } */
signed b: 4;
- int c: 5;
+ int c: 5; /* { dg-line WithBitFields_c } */
}
@end
@implementation WithBitfields {
char *isa; /* { dg-error "conflicting instance variable type .char \\*isa." } */
- /* { dg-error "previous declaration of .void \\*isa." "" { target *-*-* } 12 } */
+ /* { dg-error "previous declaration of .void \\*isa." "" { target *-*-* } WithBitFields_isa } */
unsigned a: 5; /* { dg-error "conflicting instance variable type .unsigned( int)? a: 5." } */
- /* { dg-error "previous declaration of .unsigned( int)? a: 3." "" { target *-*-* } 13 } */
+ /* { dg-error "previous declaration of .unsigned( int)? a: 3." "" { target *-*-* } WithBitFields_a } */
signed b: 4; /* This one is fine. */
int c: 3; /* { dg-error "conflicting instance variable type .int c: 3." } */
- /* { dg-error "previous declaration of .int c: 5." "" { target *-*-* } 15 } */
+ /* { dg-error "previous declaration of .int c: 5." "" { target *-*-* } WithBitFields_c } */
}
@end
/* Redeclarations of class names. */
/* { dg-do compile } */
-typedef int foo;
+typedef int foo; /* { dg-line foo_def } */
@class foo; /* { dg-error "redeclared as different kind of symbol" } */
-/* { dg-error "previous declaration of" "" { target *-*-* } 4 } */
+/* { dg-error "previous declaration of" "" { target *-*-* } foo_def } */
-typedef int bar;
+typedef int bar; /* { dg-line bar_def } */
@interface bar
@end /* { dg-error "redeclared as different kind of symbol" } */
-/* { dg-error "previous declaration of" "" { target *-*-* } 9 } */
+/* { dg-error "previous declaration of" "" { target *-*-* } bar_def } */
-int glob;
+int glob; /* { dg-line glob_def } */
@implementation glob
-@end /* { dg-error "redeclared as different kind of symbol" } */
-/* { dg-error "previous declaration of" "" { target *-*-* } 15 } */
-/* { dg-warning "annot find interface declaration" "" { target *-*-* } 18 } */
+@end /* { dg-line glob_impl_end } */
+/* { dg-error "redeclared as different kind of symbol" "" { target *-*-* } glob_impl_end } */
+/* { dg-error "previous declaration of" "" { target *-*-* } glob_def } */
+/* { dg-warning "annot find interface declaration" "" { target *-*-* } glob_impl_end } */
#include <objc/objc.h>
@interface Object1
-- (void)initWithData:(Object1 *)data;
+- (void)initWithData:(Object1 *)data; /* { dg-line Object1_initWithData } */
@end
@interface Object2
-- (id)initWithData:(Object1 *)data;
+- (id)initWithData:(Object1 *)data; /* { dg-line Object2_initWithData } */
@end
@interface Object3
-- (id)initWithData:(Object2 *)data;
+- (id)initWithData:(Object2 *)data; /* { dg-line Object3_initWithData } */
@end
void foo(void) {
id obj1, obj2 = 0;
- obj2 = [obj1 initWithData: obj2];
+ obj2 = [obj1 initWithData: obj2]; /* { dg-line initWithData_message } */
/* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } .-1 } */
- /* { dg-message "using .\\-\\(void\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } 12 } */
- /* { dg-message "also found .\\-\\(id\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } 16 } */
- /* { dg-message "also found .\\-\\(id\\)initWithData:\\(Object2 \\*\\)data." "" { target *-*-* } 20 } */
+ /* { dg-message "using .\\-\\(void\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } Object1_initWithData } */
+ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } Object2_initWithData } */
+ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(Object2 \\*\\)data." "" { target *-*-* } Object3_initWithData } */
/* The following error is a consequence of picking the "wrong" method signature. */
- /* { dg-error "void value not ignored as it ought to be" "" { target *-*-* } 25 } */
+ /* { dg-error "void value not ignored as it ought to be" "" { target *-*-* } initWithData_message } */
}
#endif
@interface Base
-- (unsigned)port;
+- (unsigned)port; /* { dg-line Base_port } */
@end
@interface Derived: Base
- (OBJECT *)port;
-+ (Protocol *)port;
++ (Protocol *)port; /* { dg-line Derived_port_last } */
- (id)starboard;
@end
Class receiver;
[receiver port]; /* { dg-warning "multiple methods named .\\+port. found" } */
- /* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } 17 } */
- /* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } 22 } */
+ /* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } Base_port } */
+ /* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } Derived_port_last } */
[receiver starboard]; /* { dg-warning "no .\\+starboard. method found" } */
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } .-1 } */
#include "../objc-obj-c++-shared/TestsuiteObject.h"
@interface Class1
-- (void)setWindow:(TestsuiteObject *)wdw;
+- (void)setWindow:(TestsuiteObject *)wdw; /* { dg-line Class1_setWindow } */
@end
@interface Class2
-- (void)setWindow:(Class1 *)window;
+- (void)setWindow:(Class1 *)window; /* { dg-line Class2_setWindow } */
@end
id foo(void) {
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } .-2 } */
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } .-3 } */
[obj2 setWindow:nil]; /* { dg-warning "multiple methods named .\\-setWindow:. found" } */
- /* { dg-message "using .\\-\\(void\\)setWindow:\\(TestsuiteObject \\*\\)wdw." "" { target *-*-* } 10 } */
- /* { dg-message "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } 14 } */
+ /* { dg-message "using .\\-\\(void\\)setWindow:\\(TestsuiteObject \\*\\)wdw." "" { target *-*-* } Class1_setWindow } */
+ /* { dg-message "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } Class2_setWindow } */
return obj;
}
#include "../objc-obj-c++-shared/TestsuiteObject.h"
@protocol MyObject
-- (id)initWithData:(TestsuiteObject *)data;
+- (id)initWithData:(TestsuiteObject *)data; /* { dg-line MyObject_initWithData } */
@end
@protocol SomeOther
-- (id)initWithData:(int)data;
+- (id)initWithData:(int)data; /* { dg-line SomeOther_initWithData } */
@end
@protocol MyCoding
-- (id)initWithData:(id<MyObject, MyCoding>)data;
+- (id)initWithData:(id<MyObject, MyCoding>)data; /* { dg-line MyCoding_initWithData } */
@end
@interface NTGridDataObject: TestsuiteObject <MyCoding>
}
+ (NTGridDataObject*)dataObject:(id<MyObject, MyCoding>)data
{
- NTGridDataObject *result = [[NTGridDataObject alloc] initWithData:data];
+ NTGridDataObject *result = [[NTGridDataObject alloc] initWithData:data]; /* { dg-line initWithData_message } */
/* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } .-1 } */
- /* { dg-message "using .\\-\\(id\\)initWithData:\\(TestsuiteObject \\*\\)data." "" { target *-*-* } 11 } */
- /* { dg-message "also found .\\-\\(id\\)initWithData:\\(id <MyObject, MyCoding>\\)data." "" { target *-*-* } 19 } */
- /* { dg-message "also found .\\-\\(id\\)initWithData:\\(int\\)data." "" { target *-*-* } 15 } */
+ /* { dg-message "using .\\-\\(id\\)initWithData:\\(TestsuiteObject \\*\\)data." "" { target *-*-* } MyObject_initWithData } */
+ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(id <MyObject, MyCoding>\\)data." "" { target *-*-* } MyCoding_initWithData } */
+ /* { dg-message "also found .\\-\\(id\\)initWithData:\\(int\\)data." "" { target *-*-* } SomeOther_initWithData } */
/* The following warning is a consequence of picking the "wrong" method signature. */
- /* { dg-warning "passing argument 1 of .initWithData:. from distinct Objective\\-C type" "" { target *-*-* } 35 } */
+ /* { dg-warning "passing argument 1 of .initWithData:. from distinct Objective\\-C type" "" { target *-*-* } initWithData_message } */
return result;
}
@end
return self;
}
@end
-
-/* { dg-warning "incomplete implementation of class .MyClass." "" { target *-*-* } 21 } */
-/* { dg-warning "method definition for .\\-missingMethod1. not found" "" { target *-*-* } 21 } */
-/* { dg-warning "class .MyClass. does not fully implement the .DefinedProtocol. protocol" "" { target *-*-* } 21 } */
+/* { dg-warning "incomplete implementation of class .MyClass." "" { target *-*-* } .-1 } */
+/* { dg-warning "method definition for .\\-missingMethod1. not found" "" { target *-*-* } .-2 } */
+/* { dg-warning "class .MyClass. does not fully implement the .DefinedProtocol. protocol" "" { target *-*-* } .-3 } */
@end
float Foo; /* { dg-error "parse error|syntax error|expected|redeclaration" } */
-double Bar;
+double Bar; /* { dg-line Bar_decl } */
@interface Bar
@end /* { dg-error "redeclared as different kind of symbol" } */
-/* { dg-error "previous declaration of" "" { target *-*-* } 9 } */
+/* { dg-error "previous declaration of" "" { target *-*-* } Bar_decl } */
{
Class isa;
}
-@property (assign) id a;
-@property (retain) id b;
-@property int c;
-@property (nonatomic) int d;
-@property int e;
-@property int f;
-@property int g;
-@property (readonly) int h;
-@property (readonly,getter=getMe) int i;
+@property (assign) id a; /* { dg-line MyRootClass_property_a } */
+@property (retain) id b; /* { dg-line MyRootClass_property_b } */
+@property int c; /* { dg-line MyRootClass_property_c } */
+@property (nonatomic) int d; /* { dg-line MyRootClass_property_d } */
+@property int e; /* { dg-line MyRootClass_property_e } */
+@property int f; /* { dg-line MyRootClass_property_f } */
+@property int g; /* { dg-line MyRootClass_property_g } */
+@property (readonly) int h;
+@property (readonly,getter=getMe) int i; /* { dg-line MyRootClass_property_i } */
@end
@interface MyClass : MyRootClass
@interface MyClass2 : MyRootClass
@property (retain) id a; /* { dg-warning "assign semantics attributes of property .a. conflict with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 13 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_a } */
@property (assign) id b; /* { dg-warning "assign semantics attributes of property .b. conflict with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 14 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_b } */
@property (nonatomic) int c; /* { dg-warning ".nonatomic. attribute of property .c. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 15 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_c } */
@property int d; /* { dg-warning ".nonatomic. attribute of property .d. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 16 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_d } */
@property (setter=setX:) int e; /* { dg-warning ".setter. attribute of property .e. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 17 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_e } */
@property (getter=x) int f; /* { dg-warning ".getter. attribute of property .f. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 18 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_f } */
@property (readonly) int g; /* { dg-warning ".readonly. attribute of property .g. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 19 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_g } */
@property (readwrite) int h; /* Ok */
@property (readonly) int i; /* { dg-warning ".getter. attribute of property .i. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 21 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_i } */
@end
{
Class isa;
}
-@property (assign) id a;
-@property (retain) id b;
-@property int c;
-@property (nonatomic) int d;
-@property int e;
-@property int f;
-@property int g;
+@property (assign) id a; /* { dg-line MyRootClass_property_a } */
+@property (retain) id b; /* { dg-line MyRootClass_property_b } */
+@property int c; /* { dg-line MyRootClass_property_c } */
+@property (nonatomic) int d; /* { dg-line MyRootClass_property_d } */
+@property int e; /* { dg-line MyRootClass_property_e } */
+@property int f; /* { dg-line MyRootClass_property_f } */
+@property int g; /* { dg-line MyRootClass_property_g } */
@property (readonly) int h;
-@property (readonly,getter=getMe) int i;
+@property (readonly,getter=getMe) int i; /* { dg-line MyRootClass_property_i } */
@property (nonatomic) float j;
@end
@interface MyRootClass (Category)
@property (retain) id a; /* { dg-warning "assign semantics attributes of property .a. conflict with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 16 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_a } */
@property (assign) id b; /* { dg-warning "assign semantics attributes of property .b. conflict with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 17 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_b } */
@property (nonatomic) int c; /* { dg-warning ".nonatomic. attribute of property .c. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 18 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_c } */
@property int d; /* { dg-warning ".nonatomic. attribute of property .d. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 19 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_d } */
@property (setter=setX:) int e; /* { dg-warning ".setter. attribute of property .e. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 20 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_e } */
@property (getter=x) int f; /* { dg-warning ".getter. attribute of property .f. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 21 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_f } */
@property (readonly) int g; /* { dg-warning ".readonly. attribute of property .g. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 22 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_g } */
@property (readwrite) int h; /* Ok */
@property (readonly) int i; /* { dg-warning ".getter. attribute of property .i. conflicts with previous declaration" } */
- /* { dg-message "originally specified here" "" { target *-*-* } 24 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } MyRootClass_property_i } */
@property (nonatomic) float j; /* Ok */
@end
@implementation MySubClass4
@end
-
-/* { dg-warning "incomplete implementation of class" "" { target *-*-* } 81 } */
-/* { dg-warning "method definition for ..setCount1:. not found" "" { target *-*-* } 81 } */
-/* { dg-warning "method definition for ..count1. not found" "" { target *-*-* } 81 } */
-/* { dg-warning "method definition for ..count2. not found" "" { target *-*-* } 81 } */
-/* { dg-warning "class .MySubClass4. does not fully implement the .count2. protocol" "" { target *-*-* } 81 } */
+/* { dg-warning "incomplete implementation of class" "" { target *-*-* } .-1 } */
+/* { dg-warning "method definition for ..setCount1:. not found" "" { target *-*-* } .-2 } */
+/* { dg-warning "method definition for ..count1. not found" "" { target *-*-* } .-3 } */
+/* { dg-warning "method definition for ..count2. not found" "" { target *-*-* } .-4 } */
+/* { dg-warning "class .MySubClass4. does not fully implement the .count2. protocol" "" { target *-*-* } .-5 } */
@property (retain) int property_c; /* { dg-error ".retain. attribute is only valid for Objective-C objects" } */
@property (copy) int property_d; /* { dg-error ".copy. attribute is only valid for Objective-C objects" } */
-@property (retain) id property_e;
+@property (retain) id property_e; /* { dg-line property_e_first } */
@property (retain) id property_f;
@property (retain) id property_g;
@property (retain) id property_h;
@property (retain) id property_e; /* { dg-error "redeclaration of property .property_e." } */
- /* { dg-message "originally specified here" "" { target *-*-* } 26 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } property_e_first } */
@end
@property id test; /* { dg-error "property declaration not in .interface or .protocol context" } */
@end
@implementation AnotherTest
-@dynamic one;
+@dynamic one; /* { dg-line dynamic_one_first } */
@dynamic one; /* { dg-error "property .one. already specified in .@dynamic." } */
- /* { dg-message "originally specified here" "" { target *-*-* } 41 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } dynamic_one_first } */
@dynamic three; /* { dg-error "no declaration of property .three. found in the interface" } */
@end
@end
@implementation Person
-@dynamic firstName;
+@dynamic firstName; /* { dg-line dynamic_firstName } */
@synthesize firstName; /* { dg-error "property .firstName. already specified in .@dynamic." } */
- /* { dg-message "originally specified here" "" { target *-*-* } 11 } */
+ /* { dg-message "originally specified here" "" { target *-*-* } dynamic_firstName } */
@end
@implementation MySubClass2
@end /* Warnings here, below. */
-
-/* { dg-warning "incomplete implementation of class .MySubClass2." "" { target *-*-* } 50 } */
-/* { dg-warning "method definition for .\\-method2. not found" "" { target *-*-* } 50 } */
-/* { dg-warning "class .MySubClass2. does not fully implement the .MyProtocol2. protocol" "" { target *-*-* } 50 } */
+/* { dg-warning "incomplete implementation of class .MySubClass2." "" { target *-*-* } .-1 } */
+/* { dg-warning "method definition for .\\-method2. not found" "" { target *-*-* } .-2 } */
+/* { dg-warning "class .MySubClass2. does not fully implement the .MyProtocol2. protocol" "" { target *-*-* } .-3 } */
@implementation MySubClass
@end
-
-/* { dg-warning "incomplete implementation of class .MySubClass." "" { target *-*-* } 39 } */
-/* { dg-warning "method definition for .\\-method. not found" "" { target *-*-* } 39 } */
-/* { dg-warning "class .MySubClass. does not fully implement the .MyProtocol. protocol" "" { target *-*-* } 39 } */
+/* { dg-warning "incomplete implementation of class .MySubClass." "" { target *-*-* } .-1 } */
+/* { dg-warning "method definition for .\\-method. not found" "" { target *-*-* } .-2 } */
+/* { dg-warning "class .MySubClass. does not fully implement the .MyProtocol. protocol" "" { target *-*-* } .-3 } */
/* The subclass instead does not inherit the method method2 (and does
@implementation MySubClass2
@end /* Warnings here, below. */
-
-/* { dg-warning "incomplete implementation of class .MySubClass2." "" { target *-*-* } 53 } */
-/* { dg-warning "method definition for .\\-method2. not found" "" { target *-*-* } 53 } */
-/* { dg-warning "class .MySubClass2. does not fully implement the .MyProtocol2. protocol" "" { target *-*-* } 53 } */
+/* { dg-warning "incomplete implementation of class .MySubClass2." "" { target *-*-* } .-1 } */
+/* { dg-warning "method definition for .\\-method2. not found" "" { target *-*-* } .-2 } */
+/* { dg-warning "class .MySubClass2. does not fully implement the .MyProtocol2. protocol" "" { target *-*-* } .-3 } */