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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [method-17.m] - Blame information for rev 801

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

Line No. Rev Author Line
1 704 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/TestsuiteObject.h"
7
 
8
@interface Foo: TestsuiteObject
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 [TestsuiteObject 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.