URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 309 |
Rev 338 |
/* Test for -Wundeclared-selector. */
|
/* Test for -Wundeclared-selector. */
|
/* Author: Nicola Pero <nicola@brainstorm.co.uk>. */
|
/* Author: Nicola Pero <nicola@brainstorm.co.uk>. */
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-Wundeclared-selector" } */
|
/* { dg-options "-Wundeclared-selector" } */
|
|
|
#include <objc/objc.h>
|
#include <objc/objc.h>
|
|
|
@interface MyClass
|
@interface MyClass
|
|
|
+ (void) methodA;
|
+ (void) methodA;
|
- (void) methodB;
|
- (void) methodB;
|
+ (void) methodD;
|
+ (void) methodD;
|
- (void) methodF;
|
- (void) methodF;
|
|
|
@end
|
@end
|
|
|
@implementation MyClass
|
@implementation MyClass
|
|
|
+ (void) methodA {}
|
+ (void) methodA {}
|
- (void) methodB {}
|
- (void) methodB {}
|
+ (void) methodD
|
+ (void) methodD
|
{
|
{
|
SEL d = @selector(methodD); /* Ok */
|
SEL d = @selector(methodD); /* Ok */
|
SEL e = @selector(methodE); /* { dg-warning "undeclared selector" } */
|
SEL e = @selector(methodE); /* { dg-warning "undeclared selector" } */
|
}
|
}
|
|
|
- (void) methodE
|
- (void) methodE
|
{
|
{
|
SEL e = @selector(methodE); /* Ok */
|
SEL e = @selector(methodE); /* Ok */
|
}
|
}
|
|
|
- (void) methodF
|
- (void) methodF
|
{
|
{
|
SEL e = @selector(methodE); /* Ok */
|
SEL e = @selector(methodE); /* Ok */
|
}
|
}
|
|
|
@end
|
@end
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
SEL a = @selector(methodA); /* Ok */
|
SEL a = @selector(methodA); /* Ok */
|
SEL b = @selector(methodB); /* Ok */
|
SEL b = @selector(methodB); /* Ok */
|
SEL c = @selector(methodC); /* { dg-warning "undeclared selector" } */
|
SEL c = @selector(methodC); /* { dg-warning "undeclared selector" } */
|
SEL d = @selector(methodD); /* Ok */
|
SEL d = @selector(methodD); /* Ok */
|
SEL e = @selector(methodE); /* Ok */
|
SEL e = @selector(methodE); /* Ok */
|
return 0;
|
return 0;
|
|
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.