OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc.dg/] [undeclared-selector.m] - Blame information for rev 315

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 309 jeremybenn
/* Test for -Wundeclared-selector.  */
2
/* Author: Nicola Pero <nicola@brainstorm.co.uk>.  */
3
/* { dg-do compile } */
4
/* { dg-options "-Wundeclared-selector" } */
5
 
6
#include <objc/objc.h>
7
 
8
@interface MyClass
9
 
10
+ (void) methodA;
11
- (void) methodB;
12
+ (void) methodD;
13
- (void) methodF;
14
 
15
@end
16
 
17
@implementation MyClass
18
 
19
+ (void) methodA {}
20
- (void) methodB {}
21
+ (void) methodD
22
{
23
  SEL d = @selector(methodD); /* Ok */
24
  SEL e = @selector(methodE); /* { dg-warning "undeclared selector" } */
25
}
26
 
27
- (void) methodE
28
{
29
  SEL e = @selector(methodE); /* Ok */
30
}
31
 
32
- (void) methodF
33
{
34
  SEL e = @selector(methodE); /* Ok */
35
}
36
 
37
@end
38
 
39
int main (void)
40
{
41
  SEL a = @selector(methodA); /* Ok */
42
  SEL b = @selector(methodB); /* Ok */
43
  SEL c = @selector(methodC); /* { dg-warning "undeclared selector" } */
44
  SEL d = @selector(methodD); /* Ok */
45
  SEL e = @selector(methodE); /* Ok */
46
  return 0;
47
 
48
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.