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/] [method-17.m] - Blame information for rev 309

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 309 jeremybenn
/* Test for spurious "may or may not return a value" warnings.  */
2
 
3
/* { dg-do compile } */
4
/* { dg-options "-Wreturn-type -Wextra" } */
5
 
6
#include "../objc-obj-c++-shared/Object1.h"
7
 
8
@interface Foo: Object
9
- (id) meth1;
10
- (void) meth2;
11
@end
12
 
13
extern int bar;
14
 
15
@implementation Foo
16
- (id) meth1 {
17
  if (bar)
18
    return [Object new];
19
  return; /* { dg-warning "'return' with no value, in function returning non-void" } */
20
}
21
- (void) meth2 {
22
  if (!bar)
23
    return;
24
  bar = 0;
25
} /* { dg-bogus "'return' with no value, in function returning non-void" } */
26
@end

powered by: WebSVN 2.1.0

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