In gcc/testsuite/: 2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com>

In gcc/testsuite/:
2011-01-12  Nicola Pero  <nicola.pero@meta-innovation.com>

	Fixed the Objective-C++ testsuite and updated all tests.
	* lib/obj-c++.exp (obj-c++_init): Declare and set
	gcc_warning_prefix and gcc_error_prefix.	
	* obj-c++.dg/attributes/categ-attribute-2.mm: Fixed usage of
	'dg-warning', 'dg-message' and 'dg-error'.
	* obj-c++.dg/class-extension-3.mm: Likewise.
	* obj-c++.dg/class-protocol-1.mm: Likewise.
	* obj-c++.dg/cxx-scope-2.mm: Likewise.
	* obj-c++.dg/encode-7.mm: Likewise.
	* obj-c++.dg/exceptions-3.mm: Likewise.
	* obj-c++.dg/exceptions-5.mm: Likewise.	
	* obj-c++.dg/method-12.mm: Likewise.
	* obj-c++.dg/method-13.mm: Likewise.
	* obj-c++.dg/method-15.mm: Likewise.
	* obj-c++.dg/method-16.mm: Likewise.
	* obj-c++.dg/method-4.mm: Likewise.
	* obj-c++.dg/method-8.mm: Likewise.
	* obj-c++.dg/method-conflict-1.mm: Likewise.
	* obj-c++.dg/method-conflict-2.mm: Likewise.
	* obj-c++.dg/method-conflict-3.mm: Likewise. Also, removed FIXME
	and uncommented second part of the testcase now that the testsuite
	works correctly.
	* obj-c++.dg/method-conflict-4.mm: Likewise.  Also, removed FIXME
	and uncommented second part of the testcase now that the testsuite
	works correctly.
	* obj-c++.dg/private-1.mm: Likewise.	
	* obj-c++.dg/proto-lossage-4.mm: Likewise.
	* obj-c++.dg/syntax-error-7.mm: Likewise.
	* obj-c++.dg/warn5.mm: Likewise.
	* obj-c++.dg/property/at-property-14.mm: Likewise.
	* obj-c++.dg/property/at-property-16.mm: Likewise, and removed
	FIXME.	
	* obj-c++.dg/property/at-property-18.mm: Likewise.
	* obj-c++.dg/property/at-property-20.mm: Likewise, and removed
	FIXME.
	* obj-c++.dg/property/at-property-21.mm: Likewise.
	* obj-c++.dg/property/at-property-28.mm: Likewise.
	* obj-c++.dg/property/at-property-5.mm: Likewise.
	* obj-c++.dg/property/dynamic-2.mm: Likewise.
	* obj-c++.dg/property/property-neg-3.mm: Likewise.
	* obj-c++.dg/property/synthesize-11.mm: Likewise.
	* obj-c++.dg/property/synthesize-6.mm: Likewise.
	* obj-c++.dg/property/synthesize-8.mm: Likewise.
	* obj-c++.dg/property/synthesize-9.mm: Likewise.
	* obj-c++.dg/tls/diag-5.mm: Likewise.
	* obj-c++.dg/ivar-invalid-type-1.mm: Removed FIXME and uncommented
	dg-error, now matched correctly.

From-SVN: r168699
This commit is contained in:
Nicola Pero 2011-01-12 09:46:56 +00:00 committed by Nicola Pero
parent d853ee42d2
commit 81dc6eea5e
38 changed files with 180 additions and 131 deletions

View File

@ -1,3 +1,52 @@
2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com>
Fixed the Objective-C++ testsuite and updated all tests.
* lib/obj-c++.exp (obj-c++_init): Declare and set
gcc_warning_prefix and gcc_error_prefix.
* obj-c++.dg/attributes/categ-attribute-2.mm: Fixed usage of
'dg-warning', 'dg-message' and 'dg-error'.
* obj-c++.dg/class-extension-3.mm: Likewise.
* obj-c++.dg/class-protocol-1.mm: Likewise.
* obj-c++.dg/encode-7.mm: Likewise.
* obj-c++.dg/exceptions-3.mm: Likewise.
* obj-c++.dg/exceptions-5.mm: Likewise.
* obj-c++.dg/method-12.mm: Likewise.
* obj-c++.dg/method-13.mm: Likewise.
* obj-c++.dg/method-15.mm: Likewise.
* obj-c++.dg/method-16.mm: Likewise.
* obj-c++.dg/method-4.mm: Likewise.
* obj-c++.dg/method-8.mm: Likewise.
* obj-c++.dg/method-conflict-1.mm: Likewise.
* obj-c++.dg/method-conflict-2.mm: Likewise.
* obj-c++.dg/method-conflict-3.mm: Likewise. Also, removed FIXME
and uncommented second part of the testcase now that the testsuite
works correctly.
* obj-c++.dg/method-conflict-4.mm: Likewise. Also, removed FIXME
and uncommented second part of the testcase now that the testsuite
works correctly.
* obj-c++.dg/private-1.mm: Likewise.
* obj-c++.dg/proto-lossage-4.mm: Likewise.
* obj-c++.dg/syntax-error-7.mm: Likewise.
* obj-c++.dg/warn5.mm: Likewise.
* obj-c++.dg/property/at-property-14.mm: Likewise.
* obj-c++.dg/property/at-property-16.mm: Likewise, and removed
FIXME.
* obj-c++.dg/property/at-property-18.mm: Likewise.
* obj-c++.dg/property/at-property-20.mm: Likewise, and removed
FIXME.
* obj-c++.dg/property/at-property-21.mm: Likewise.
* obj-c++.dg/property/at-property-28.mm: Likewise.
* obj-c++.dg/property/at-property-5.mm: Likewise.
* obj-c++.dg/property/dynamic-2.mm: Likewise.
* obj-c++.dg/property/property-neg-3.mm: Likewise.
* obj-c++.dg/property/synthesize-11.mm: Likewise.
* obj-c++.dg/property/synthesize-6.mm: Likewise.
* obj-c++.dg/property/synthesize-8.mm: Likewise.
* obj-c++.dg/property/synthesize-9.mm: Likewise.
* obj-c++.dg/tls/diag-5.mm: Likewise.
* obj-c++.dg/ivar-invalid-type-1.mm: Removed FIXME and uncommented
dg-error, now matched correctly.
2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/property/at-property-29.m: New.

View File

@ -211,6 +211,8 @@ proc obj-c++_init { args } {
global OBJCXX_UNDER_TEST
global TESTING_IN_BUILD_TREE
global target_triplet
global gcc_warning_prefix
global gcc_error_prefix
if ![info exists OBJCXX_UNDER_TEST] then {
if [info exists TOOL_EXECUTABLE] {
@ -265,6 +267,9 @@ proc obj-c++_init { args } {
# error-message parsing machinery.
lappend ALWAYS_OBJCXXFLAGS "additional_flags=-fmessage-length=0"
set gcc_warning_prefix "warning:"
set gcc_error_prefix "error:"
if { [string match "*-*-darwin*" $target_triplet] } {
lappend ALWAYS_OBJCXXFLAGS "ldflags=-multiply_defined suppress"
}

View File

@ -20,7 +20,7 @@ __attribute__ ((deprecated("no dep_categ")))
@end
__attribute__ ((deprecated))
@implementation obj (dep_categ) /* { dg-error "prefix attributes are ignored before" } */
@implementation obj (dep_categ) /* { dg-warning "prefix attributes are ignored before" } */
- (int) depmth { return var + 1; }
@end

View File

@ -10,8 +10,8 @@
Class isa;
int count;
}
- (int) test; /* { dg-warning "previous declaration" } */
@property int count; /* { dg-warning "originally specified here" } */
- (int) test; /* { dg-message "previous declaration" } */
@property int count; /* { dg-message "originally specified here" } */
@end
@interface MyObject ()

View File

@ -326,8 +326,8 @@ testComptypes(void)
objP1 == cls; /* { dg-warning "lacks a cast" } */
}
{ /* id <protocol>, non-ObjC */
num == objP1; /* { dg-warning "between pointer" } */
objP1 == num; /* { dg-warning "between pointer" } */
num == objP1; /* { dg-error "between pointer" } */
objP1 == num; /* { dg-error "between pointer" } */
ptr == objP1;
objP1 == ptr;
@ -352,8 +352,8 @@ testComptypes(void)
clsP1 == cls;
}
{ /* Class <protocol>, non-ObjC */
num == clsP1; /* { dg-warning "between pointer" } */
clsP1 == num; /* { dg-warning "between pointer" } */
num == clsP1; /* { dg-error "between pointer" } */
clsP1 == num; /* { dg-error "between pointer" } */
ptr == clsP1;
clsP1 == ptr;

View File

@ -11,9 +11,9 @@
@end
int main(void) {
id i = [std::iostream new]; /* { dg-warning "not an Objective\\-C class name or alias" } */
id i = [std::iostream new]; /* { dg-error "not an Objective\\-C class name or alias" } */
i = [iostream new];
i = [std::basic_string<char> new]; /* { dg-warning "not an Objective\\-C class name or alias" } */
i = [std::basic_string<char> new]; /* { dg-error "not an Objective\\-C class name or alias" } */
return 0;
}

View File

@ -26,7 +26,7 @@
@interface Test : Object
{ float j; }
-(void) test2: (int [5])a with: (int [])b;
-(id) test3: (Test **)b; /* { dg-warning "previous declaration of .\\-\\(id\\)test3:\\(Test \\*\\*\\)b." } */
-(id) test3: (Test **)b; /* { dg-message "previous declaration of .\\-\\(id\\)test3:\\(Test \\*\\*\\)b." } */
@end
@implementation Test

View File

@ -71,9 +71,9 @@ int test (id object)
@try { @throw object; }
@catch (MyObject x) /* { dg-error "@catch parameter is not a known Objective-C class type" } */
{ /* { dg-error "no matching function" "" { target *-*-* } 72 } */
dummy++; /* { dg-warning "MyObject" "" { target *-*-* } 13 } */
} /* { dg-warning "candidate" "" { target *-*-* } 13 } */
/* { dg-warning "candidate" "" { target *-*-* } 72 } */
dummy++; /* { dg-message "MyObject" "" { target *-*-* } 13 } */
} /* { dg-message "candidate" "" { target *-*-* } 13 } */
/* { dg-message "candidates" "" { target *-*-* } 72 } */
@try { @throw object; }
@catch (static MyObject *x) /* { dg-error "storage class" } */
{

View File

@ -71,9 +71,9 @@ int test (id object)
@try { @throw object; }
@catch (MyObject) /* { dg-error "@catch parameter is not a known Objective-C class type" } */
{ /* { dg-error "no matching function" "" { target *-*-* } 72 } */
dummy++; /* { dg-warning "MyObject" "" { target *-*-* } 13 } */
} /* { dg-warning "candidate" "" { target *-*-* } 13 } */
/* { dg-warning "candidate" "" { target *-*-* } 72 } */
dummy++; /* { dg-message "MyObject" "" { target *-*-* } 13 } */
} /* { dg-message "candidate" "" { target *-*-* } 13 } */
/* { dg-message "candidate" "" { target *-*-* } 72 } */
@try { @throw object; }
@catch (static MyObject *) /* { dg-error "storage class" } */

View File

@ -14,6 +14,6 @@
static int c; /* { dg-error "invalid type" } */
inline int d; /* { dg-error "declared as an .inline." } */
typedef int e; /* { dg-error "invalid type" } */
__thread int f; /* dg-error "invalid type" */ /* FIXME: The compiler generates this message, but the testsuite does not match it. */
__thread int f; /* { dg-error "invalid type" } */
}
@end

View File

@ -19,8 +19,8 @@ void foo(void) {
Class receiver;
[receiver port]; /* { dg-warning "multiple methods named .\\+port. found" } */
/* { dg-warning "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } 9 } */
/* { dg-warning "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } 14 } */
/* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } 9 } */
/* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } 14 } */
[receiver starboard]; /* { dg-warning "no .\\+starboard. method found" } */
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 25 } */

View File

@ -20,8 +20,8 @@ id foo(void) {
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 18 } */
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 18 } */
[obj2 setWindow:nil]; /* { dg-warning "multiple methods named .\\-setWindow:. found" } */
/* { dg-warning "using .\\-\\(void\\)setWindow:\\(Object \\*\\)wdw." "" { target *-*-* } 8 } */
/* { dg-warning "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } 12 } */
/* { dg-message "using .\\-\\(void\\)setWindow:\\(Object \\*\\)wdw." "" { target *-*-* } 8 } */
/* { dg-message "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } 12 } */
return obj;
}

View File

@ -32,9 +32,9 @@
{
NTGridDataObject *result = [[NTGridDataObject alloc] initWithData:data];
/* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } 33 } */
/* { dg-warning "using .\\-\\(id\\)initWithData:\\(Object \\*\\)data." "" { target *-*-* } 9 } */
/* { dg-warning "also found .\\-\\(id\\)initWithData:\\(id <MyObject, MyCoding>\\)data." "" { target *-*-* } 17 } */
/* { dg-warning "also found .\\-\\(id\\)initWithData:\\(int\\)data." "" { target *-*-* } 13 } */
/* { dg-message "using .\\-\\(id\\)initWithData:\\(Object \\*\\)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 } */
/* 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 } */

View File

@ -25,9 +25,9 @@ void foo(void) {
id obj1, obj2 = 0;
obj2 = [obj1 initWithData: obj2];
/* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } 26 } */
/* { dg-warning "using .\\-\\(void\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } 13 } */
/* { dg-warning "also found .\\-\\(id\\)initWithData:\\(Object1 \\*\\)data." "" { target *-*-* } 17 } */
/* { dg-warning "also found .\\-\\(id\\)initWithData:\\(Object2 \\*\\)data." "" { target *-*-* } 21 } */
/* { 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 } */
/* 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 } */

View File

@ -7,13 +7,13 @@
#include <objc/objc.h>
@interface Base
- (id) meth1: (Base *)arg1; /* { dg-warning "using .\\-\\(id\\)meth1:\\(Base \\*\\)arg1." } */
- (id) window; /* { dg-warning "using .\\-\\(id\\)window" } */
- (id) meth1: (Base *)arg1; /* { dg-message "using .\\-\\(id\\)meth1:\\(Base \\*\\)arg1." } */
- (id) window; /* { dg-message "using .\\-\\(id\\)window" } */
@end
@interface Derived: Base
- (id) meth1: (Derived *)arg1; /* { dg-warning "also found .\\-\\(id\\)meth1:\\(Derived \\*\\)arg1." } */
- (Base *) window; /* { dg-warning "also found .\\-\\(Base \\*\\)window." } */
- (id) meth1: (Derived *)arg1; /* { dg-message "also found .\\-\\(id\\)meth1:\\(Derived \\*\\)arg1." } */
- (Base *) window; /* { dg-message "also found .\\-\\(Base \\*\\)window." } */
@end
void foo(void) {

View File

@ -2,12 +2,12 @@
/* { dg-do compile } */
@interface class1
- (int) meth1; /* { dg-error "previous declaration" } */
- (int) meth1; /* { dg-message "previous declaration" } */
- (void) meth1; /* { dg-error "duplicate declaration of method .\\-meth1." } */
@end
@interface class2
+ (void) meth1; /* { dg-error "previous declaration" } */
+ (void) meth1; /* { dg-message "previous declaration" } */
+ (int) meth1; /* { dg-error "duplicate declaration of method .\\+meth1." } */
@end

View File

@ -7,17 +7,17 @@
with the same name but conflicting method signatures. */
@protocol MyProtocol
+ (int) method1: (int)x; /* { dg-error "previous declaration" } */
+ (int) method1: (int)x; /* { dg-message "previous declaration" } */
+ (float) method1: (int)x; /* { dg-error "duplicate declaration of method .\\+method1." } */
- (int) method2: (int)x; /* { dg-error "previous declaration" } */
- (int) method2: (int)x; /* { dg-message "previous declaration" } */
- (int) method2: (float)x; /* { dg-error "duplicate declaration of method .\\-method2." } */
@optional
+ (int *) method3: (int)x; /* { dg-error "previous declaration" } */
+ (int *) method3: (int)x; /* { dg-message "previous declaration" } */
+ (int *) method3: (int **)x; /* { dg-error "duplicate declaration of method .\\+method3." } */
- (id) method4: (id)x; /* { dg-error "previous declaration" } */
- (id) method4: (id)x; /* { dg-message "previous declaration" } */
- (void) method4: (id)x; /* { dg-error "duplicate declaration of method .\\-method4." } */
@end

View File

@ -11,8 +11,8 @@
@protocol MyProtocol
@optional
+ (void) method1: (id)x; /* { dg-error "previous declaration" } */
- (id) method2: (long)x; /* { dg-error "previous declaration" } */
+ (void) method1: (id)x; /* { dg-message "previous declaration" } */
- (id) method2: (long)x; /* { dg-message "previous declaration" } */
@required
+ (void) method1: (id)x; /* { dg-error "declared .@optional. and .@required. at the same time" } */
@ -24,8 +24,8 @@
@protocol MyProtocol2
@required
+ (void) method3: (Class)x; /* { dg-error "previous declaration" } */
- (id *) method4: (long)x; /* { dg-error "previous declaration" } */
+ (void) method3: (Class)x; /* { dg-message "previous declaration" } */
- (id *) method4: (long)x; /* { dg-message "previous declaration" } */
@optional
+ (void) method3: (Class)x; /* { dg-error "declared .@optional. and .@required. at the same time" } */

View File

@ -27,39 +27,37 @@
- (void) method6: (id <A, A, B, B, C, C>)x;
- (void) method6: (id <C, A, B>)x; /* Ok */
- (void) method7: (id)x; /* { dg-warning "previous declaration" } */
- (void) method7: (id)x; /* { dg-message "previous declaration" } */
- (void) method7: (id <A>)x; /* { dg-error "duplicate declaration" } */
- (void) method8: (id <A>)x; /* { dg-warning "previous declaration" } */
- (void) method8: (id <A>)x; /* { dg-message "previous declaration" } */
- (void) method8: (id)x; /* { dg-error "duplicate declaration" } */
- (void) method9: (id <A>)x; /* { dg-warning "previous declaration" } */
- (void) method9: (id <A>)x; /* { dg-message "previous declaration" } */
- (void) method9: (id <B>)x; /* { dg-error "duplicate declaration" } */
- (void) methodA: (id <A>)x; /* { dg-warning "previous declaration" } */
- (void) methodA: (id <A>)x; /* { dg-message "previous declaration" } */
- (void) methodA: (id <A, B>)x; /* { dg-error "duplicate declaration" } */
/* FIXME: Bug in the testsuite - the following are done Ok by the compiler, but
the testsuite barfs so we have to comment out the tests. */
/* - (void) methodB: (id <A, B>)x; dg-warning "previous declaration" */
/* - (void) methodB: (id <A>)x; dg-error "duplicate declaration" */
- (void) methodB: (id <A, B>)x; /* { dg-message "previous declaration" } */
- (void) methodB: (id <A>)x; /* { dg-error "duplicate declaration" } */
/* - (void) methodC: (id <A, B, C>)x; dg-warning "previous declaration" */
/* - (void) methodC: (id <A, B>)x; dg-error "duplicate declaration" */
- (void) methodC: (id <A, B, C>)x; /* { dg-message "previous declaration" } */
- (void) methodC: (id <A, B>)x; /* { dg-error "duplicate declaration" } */
/* - (void) methodD: (id <A, B, C>)x; dg-warning "previous declaration" */
/* - (void) methodD: (id <A, B, A>)x; dg-error "duplicate declaration" */
- (void) methodD: (id <A, B, C>)x; /* { dg-message "previous declaration" } */
- (void) methodD: (id <A, B, A>)x; /* { dg-error "duplicate declaration" } */
/* - (void) methodE: (MyClass <A, B, C> *)x; dg-warning "previous declaration" */
/* - (void) methodE: (MyClass <A, B, A> *)x; dg-error "duplicate declaration" */
- (void) methodE: (MyClass <A, B, C> *)x; /* { dg-message "previous declaration" } */
- (void) methodE: (MyClass <A, B, A> *)x; /* { dg-error "duplicate declaration" } */
- (void) methodF: (MyClass <A, B, A> *)x;
- (void) methodF: (MyClass <A, B, A> *)x; /* Ok */
/* - (void) methodG: (MyClass *)x; dg-warning "previous declaration" */
/* - (void) methodG: (MyClass <A, B, C> *)x; dg-error "duplicate declaration" */
- (void) methodG: (MyClass *)x; /* { dg-message "previous declaration" } */
- (void) methodG: (MyClass <A, B, C> *)x; /* { dg-error "duplicate declaration" } */
/* - (void) methodH: (MyClass <A, C>*)x; dg-warning "previous declaration" */
/* - (void) methodH: (MyClass *)x; dg-error "duplicate declaration" */
- (void) methodH: (MyClass <A, C>*)x; /* { dg-message "previous declaration" } */
- (void) methodH: (MyClass *)x; /* { dg-error "duplicate declaration" } */
@end

View File

@ -21,10 +21,10 @@
@end
@interface MyClass2
- (void) aMethod: (id <A>)x; /* { dg-error "previous declaration" } */
- (void) aMethod: (id <A>)x; /* { dg-message "previous declaration" } */
- (void) aMethod: (id <B>)x; /* { dg-error "duplicate declaration" } */
- (void) bMethod: (id <B>)x; /* { dg-error "previous declaration" } */
- (void) bMethod: (id <B>)x; /* { dg-message "previous declaration" } */
- (void) bMethod: (id <A>)x; /* { dg-error "duplicate declaration" } */
- (void) cMethod: (id <A, B>)x;
@ -33,16 +33,15 @@
- (void) dMethod: (id <A, B>)x;
- (void) dMethod: (id <B, A>)x; /* Ok */
/* FIXME: The compiler works, but the testsuite produces errors anyway. */
/* - (void) eMethod: (id <A>)x; dg-error "previous declaration" */
/* - (void) eMethod: (id <B, C>)x; dg-error "duplicate declaration" */
- (void) eMethod: (id <A>)x; /* { dg-message "previous declaration" } */
- (void) eMethod: (id <B, C>)x; /* { dg-error "duplicate declaration" } */
/*- (void) fMethod: (id <B, C>)x; dg-error "previous declaration" */
/*- (void) fMethod: (id <A>)x; dg-error "duplicate declaration" */
- (void) fMethod: (id <B, C>)x; /* { dg-message "previous declaration" } */
- (void) fMethod: (id <A>)x; /* { dg-error "duplicate declaration" } */
/* - (void) gMethod: (id <A>)x; dg-error "previous declaration" */
/* - (void) gMethod: (id <A, B, C>)x; dg-error "duplicate declaration" */
- (void) gMethod: (id <A>)x; /* { dg-message "previous declaration" } */
- (void) gMethod: (id <A, B, C>)x; /* { dg-error "duplicate declaration" } */
/* - (void) hMethod: (id <A, B, C>)x; dg-error "previous declaration" */
/* - (void) hMethod: (id <A>)x; dg-error "duplicate declaration" */
- (void) hMethod: (id <A, B, C>)x; /* { dg-message "previous declaration" } */
- (void) hMethod: (id <A>)x; /* { dg-error "duplicate declaration" } */
@end

View File

@ -49,8 +49,8 @@ int main (void)
{
int access;
access = m->_private; /* { dg-error "is @private" } */
access = m->_protected; /* { dg-error "is @protected" } */
access = m->_private; /* { dg-warning "is @private" } */
access = m->_protected; /* { dg-warning "is @protected" } */
access = m->_public; /* Ok */
}

View File

@ -10,11 +10,11 @@
/* Test the warnings on 'assign'. */
@property id property_a; /* { dg-warning "object property .property.a. has no .assign., .retain. or .copy. attribute" } */
/* { dg-warning ".assign. can be unsafe for Objective-C objects" "" { target *-*-* } 12 } */
/* { dg-message ".assign. can be unsafe for Objective-C objects" "" { target *-*-* } 12 } */
@property (readonly) id property_b; /* No 'assign' warning (assign semantics do not matter if the property is readonly). */
@property id *property_c; /* No 'assign' warning (the type is not an Objective-C object). */
@property Class property_d; /* No 'assign' warning (Classes are static objects so assign semantics do not matter for them). */
@property MyRootClass *property_e; /* { dg-warning "object property .property.e. has no .assign., .retain. or .copy. attribute" } */
/* { dg-warning ".assign. can be unsafe for Objective-C objects" "" { target *-*-* } 18 } */
/* { dg-message ".assign. can be unsafe for Objective-C objects" "" { target *-*-* } 18 } */
@end

View File

@ -10,16 +10,15 @@
{
Class isa;
}
@property (assign) id a; /* { dg-warning "originally specified here" } */
@property (retain) id b; /* { dg-warning "originally specified here" } */
@property int c; /* { dg-warning "originally specified here" } */
@property (nonatomic) int d; /* { dg-warning "originally specified here" } */
/* FIXME: Mysteriously the next 3 need to be 'dg-message' instead of 'dg-warning' for the testcase to work. */
@property (assign) id a; /* { dg-message "originally specified here" } */
@property (retain) id b; /* { dg-message "originally specified here" } */
@property int c; /* { dg-message "originally specified here" } */
@property (nonatomic) int d; /* { dg-message "originally specified here" } */
@property int e; /* { dg-message "originally specified here" } */
@property int f; /* { dg-message "originally specified here" } */
@property int g; /* { dg-message "originally specified here" } */
@property (readonly) int h; /* Ok */
@property (readonly,getter=getMe) int i; /* { dg-warning "originally specified here" } */
@property (readonly,getter=getMe) int i; /* { dg-message "originally specified here" } */
@end
@interface MyClass : MyRootClass

View File

@ -26,21 +26,21 @@
@end
@interface MyRootClass (Category)
@property (retain) id a; /* { dg-warning "assign semantics attributes of property .a. conflict with previous declaration" } */
/* { dg-warning "originally specified here" "" { target *-*-* } 16 } */
/* { dg-message "originally specified here" "" { target *-*-* } 16 } */
@property (assign) id b; /* { dg-warning "assign semantics attributes of property .b. conflict with previous declaration" } */
/* { dg-warning "originally specified here" "" { target *-*-* } 17 } */
/* { dg-message "originally specified here" "" { target *-*-* } 17 } */
@property (nonatomic) int c; /* { dg-warning ".nonatomic. attribute of property .c. conflicts with previous declaration" } */
/* { dg-warning "originally specified here" "" { target *-*-* } 18 } */
/* { dg-message "originally specified here" "" { target *-*-* } 18 } */
@property int d; /* { dg-warning ".nonatomic. attribute of property .d. conflicts with previous declaration" } */
/* { dg-warning "originally specified here" "" { target *-*-* } 19 } */
/* { dg-message "originally specified here" "" { target *-*-* } 19 } */
@property (setter=setX:) int e; /* { dg-warning ".setter. attribute of property .e. conflicts with previous declaration" } */
/* { dg-warning "originally specified here" "" { target *-*-* } 20 } */
/* { dg-message "originally specified here" "" { target *-*-* } 20 } */
@property (getter=x) int f; /* { dg-warning ".getter. attribute of property .f. conflicts with previous declaration" } */
/* { dg-warning "originally specified here" "" { target *-*-* } 21 } */
/* { dg-message "originally specified here" "" { target *-*-* } 21 } */
@property (readonly) int g; /* { dg-warning ".readonly. attribute of property .g. conflicts with previous declaration" } */
/* { dg-warning "originally specified here" "" { target *-*-* } 22 } */
/* { dg-message "originally specified here" "" { target *-*-* } 22 } */
@property (readwrite) int h; /* Ok */
@property (readonly) int i; /* { dg-warning ".getter. attribute of property .i. conflicts with previous declaration" } */
/* { dg-warning "originally specified here" "" { target *-*-* } 24 } */
/* { dg-message "originally specified here" "" { target *-*-* } 24 } */
@property (nonatomic) float j; /* Ok */
@end

View File

@ -37,14 +37,13 @@
@interface MyClass : MyRootClass
{ }
@property (assign) id <MyProtocolA> a; /* { dg-warning "originally specified here" } */
@property int b; /* { dg-warning "originally specified here" } */
@property float c; /* { dg-warning "originally specified here" } */
@property (assign) MyRootClass *d; /* { dg-warning "originally specified here" } */
@property (assign) MySubClass1 *e; /* { dg-warning "originally specified here" } */
/* FIXME: Mysteriously two of the next three need to be 'dg-message' instead of 'dg-warning' for the testcase to work. */
@property (assign) id <MyProtocolA> a; /* { dg-message "originally specified here" } */
@property int b; /* { dg-message "originally specified here" } */
@property float c; /* { dg-message "originally specified here" } */
@property (assign) MyRootClass *d; /* { dg-message "originally specified here" } */
@property (assign) MySubClass1 *e; /* { dg-message "originally specified here" } */
@property (assign, readonly) MySubClass1 *f; /* { dg-message "originally specified here" } */
@property (assign) MySubClass3 *g; /* { dg-warning "originally specified here" } */
@property (assign) MySubClass3 *g; /* { dg-message "originally specified here" } */
@property (assign, readonly) MySubClass3 *h; /* { dg-message "originally specified here" } */
@end

View File

@ -14,10 +14,10 @@
/* Test the warnings on 'assign' with protocols. */
@property id <MyProtocol> property_a; /* { dg-warning "object property .property.a. has no .assign., .retain. or .copy. attribute" } */
/* { dg-warning ".assign. can be unsafe for Objective-C objects" "" { target *-*-* } 16 } */
/* { dg-message ".assign. can be unsafe for Objective-C objects" "" { target *-*-* } 16 } */
@property MyRootClass <MyProtocol> *property_b; /* { dg-warning "object property .property.b. has no .assign., .retain. or .copy. attribute" } */
/* { dg-warning ".assign. can be unsafe for Objective-C objects" "" { target *-*-* } 19 } */
/* { dg-message ".assign. can be unsafe for Objective-C objects" "" { target *-*-* } 19 } */
@property Class <MyProtocol> property_c; /* No 'assign' warning (Classes are static objects so assign semantics do not matter for them). */
@end

View File

@ -10,11 +10,11 @@
{
Class isa;
}
@property (readonly, retain) id property1; /* { dg-warning "originally specified here" } */
@property (readonly) int property2; /* { dg-warning "originally specified here" } */
@property (readonly, getter=y) int property3; /* { dg-warning "originally specified here" } */
@property (readonly, retain) id property1; /* { dg-message "originally specified here" } */
@property (readonly) int property2; /* { dg-message "originally specified here" } */
@property (readonly, getter=y) int property3; /* { dg-message "originally specified here" } */
@property (readonly) int property4; /* Ok */
@property (readonly) int property5; /* { dg-warning "originally specified here" } */
@property (readonly) int property5; /* { dg-message "originally specified here" } */
@end
@interface MyRootClass ()

View File

@ -18,7 +18,7 @@
/* Test various error messages. */
@property id property_a; /* { dg-warning "object property .property.a. has no .assign., .retain. or .copy. attribute" } */
/* { dg-warning ".assign. can be unsafe for Objective-C objects" "" { target *-*-* } 20 } */
/* { dg-message ".assign. can be unsafe for Objective-C objects" "" { target *-*-* } 20 } */
@property int property_b = 4; /* { dg-error "expected" } */
@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" } */
@ -28,7 +28,7 @@
@property (retain) id property_g;
@property (retain) id property_h;
@property (retain) id property_e; /* { dg-error "redeclaration of property .property_e." } */
/* { dg-warning "originally specified here" "" { target *-*-* } 26 } */
/* { dg-message "originally specified here" "" { target *-*-* } 26 } */
@end
@property id test; /* { dg-error "misplaced .@property. Objective-C.. construct" } */

View File

@ -40,6 +40,6 @@
@implementation AnotherTest
@dynamic one;
@dynamic one; /* { dg-error "property .one. already specified in .@dynamic." } */
/* { dg-warning "originally specified here" "" { target *-*-* } 41 } */
/* { dg-message "originally specified here" "" { target *-*-* } 41 } */
@dynamic three; /* { dg-error "no declaration of property .three. found in the interface" } */
@end

View File

@ -10,5 +10,5 @@
@implementation Person
@dynamic firstName;
@synthesize firstName; /* { dg-error "property .firstName. already specified in .@dynamic." } */
/* { dg-warning "originally specified here" "" { target *-*-* } 11 } */
/* { dg-message "originally specified here" "" { target *-*-* } 11 } */
@end

View File

@ -10,8 +10,8 @@
@interface MyRootClass
{
Class isa;
int countA : 2; /* { dg-warning "originally specified here" } */
int countB : 3; /* { dg-warning "originally specified here" } */
int countA : 2; /* { dg-message "originally specified here" } */
int countB : 3; /* { dg-message "originally specified here" } */
}
+ (id) initialize;
+ (id) alloc;
@ -27,5 +27,5 @@
@synthesize countA; /* { dg-error ".atomic. property .countA. is using bit-field instance variable .countA." } */
@synthesize countB; /* { dg-error "property .countB. is using instance variable .countB. of incompatible type" } */
@end /* { dg-warning "incomplete implementation of class" } */
/* { dg-warning "method definition for ..setCountA.. not found" "" { target *-*-* } 29 } */
/* { dg-warning "method definition for ..countA. not found" "" { target *-*-* } 29 } */
/* { dg-message "method definition for ..setCountA.. not found" "" { target *-*-* } 29 } */
/* { dg-message "method definition for ..countA. not found" "" { target *-*-* } 29 } */

View File

@ -15,7 +15,7 @@
@property int v2;
@end
@implementation Test
@synthesize v1 = v; /* { dg-warning "originally specified here" } */
@synthesize v1 = v; /* { dg-message "originally specified here" } */
@synthesize v2 = v; /* { dg-error "property .v2. is using the same instance variable as property .v1." } */
@end
@interface Test2 : Test
@ -26,5 +26,5 @@
@synthesize w1; /* { dg-error "ivar .w1. used by .@synthesize. declaration must be an existing ivar" } */
@end
/* { dg-warning "incomplete implementation" "" { target *-*-* } 27 } */
/* { dg-warning "method definition for .-setW1:. not found" "" { target *-*-* } 27 } */
/* { dg-warning "method definition for .-w1. not found" "" { target *-*-* } 27 } */
/* { dg-message "method definition for .-setW1:. not found" "" { target *-*-* } 27 } */
/* { dg-message "method definition for .-w1. not found" "" { target *-*-* } 27 } */

View File

@ -52,13 +52,13 @@
/* This is not OK. */
@interface Test2
{
int v; /* { dg-warning "originally specified here" } */
float w; /* { dg-warning "originally specified here" } */
id x; /* { dg-warning "originally specified here" } */
Test *y; /* { dg-warning "originally specified here" } */
id <MyProtocol> *z; /* { dg-warning "originally specified here" } */
ClassA *a; /* { dg-warning "originally specified here" } */
ClassB *b; /* { dg-warning "originally specified here" } */
int v; /* { dg-message "originally specified here" } */
float w; /* { dg-message "originally specified here" } */
id x; /* { dg-message "originally specified here" } */
Test *y; /* { dg-message "originally specified here" } */
id <MyProtocol> *z; /* { dg-message "originally specified here" } */
ClassA *a; /* { dg-message "originally specified here" } */
ClassB *b; /* { dg-message "originally specified here" } */
}
@property (assign) float v;
@property (assign) id w;

View File

@ -52,12 +52,12 @@
/* This is sometimes OK, sometimes not OK. */
@interface Test2
{
int v; /* { dg-warning "originally specified here" } */
float w; /* { dg-warning "originally specified here" } */
id x; /* { dg-warning "originally specified here" } */
int v; /* { dg-message "originally specified here" } */
float w; /* { dg-message "originally specified here" } */
id x; /* { dg-message "originally specified here" } */
Test *y;
id <MyProtocol> *z; /* { dg-warning "originally specified here" } */
ClassA *a; /* { dg-warning "originally specified here" } */
id <MyProtocol> *z; /* { dg-message "originally specified here" } */
ClassA *a; /* { dg-message "originally specified here" } */
ClassB *b;
}
@property (assign, readonly) float v;

View File

@ -40,7 +40,7 @@ long foo(void) {
receiver += [objrcvr2 someValue];
receiver += [objrcvr2 anotherValue];
receiver += [(Obj *)objrcvr2 someValue]; /* { dg-warning ".Obj. may not respond to .\\-someValue." } */
/* { dg-warning "invalid conversion" "" { target *-*-* } 42 } */
/* { dg-error "invalid conversion" "" { target *-*-* } 42 } */
receiver += [(Obj *)objrcvr2 anotherValue];

View File

@ -9,5 +9,5 @@
-(void) someMethod /* { dg-error "expected before .-." } */
{
}
@end /* { dg-error "incomplete implementation of class" } */
/* { dg-error "method definition for ..someMethod. not found" "" { target *-*-* } 12 } */
@end /* { dg-warning "incomplete implementation of class" } */
/* { dg-warning "method definition for ..someMethod. not found" "" { target *-*-* } 12 } */

View File

@ -1,4 +1,4 @@
/* __thread specifiers on empty declarations. */
/* { dg-require-effective-target tls } */
__thread struct foo; /* { dg-warning "qualifiers can only be specified for objects and functions" } */
__thread struct foo; /* { dg-error "qualifiers can only be specified for objects and functions" } */

View File

@ -16,10 +16,10 @@ struct A {
typedef void (A::*pmf)();
static int mememe = &A::foo - &A::bar; // { dg-warning "" }
pmf b = &A::foo-1; // { dg-warning "" }
static int mememe = &A::foo - &A::bar; // { dg-error "" }
pmf b = &A::foo-1; // { dg-error "" }
int main() {
double y;
y=X(Y-Z); // { dg-warning "" }
y=X(Y-Z); // { dg-error "" }
}