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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [objc.dg/] [method-17.m] - Diff between revs 309 and 338

Only display areas with differences | Details | Blame | View Log

Rev 309 Rev 338
/* Test for spurious "may or may not return a value" warnings.  */
/* Test for spurious "may or may not return a value" warnings.  */
 
 
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "-Wreturn-type -Wextra" } */
/* { dg-options "-Wreturn-type -Wextra" } */
 
 
#include "../objc-obj-c++-shared/Object1.h"
#include "../objc-obj-c++-shared/Object1.h"
 
 
@interface Foo: Object
@interface Foo: Object
- (id) meth1;
- (id) meth1;
- (void) meth2;
- (void) meth2;
@end
@end
 
 
extern int bar;
extern int bar;
 
 
@implementation Foo
@implementation Foo
- (id) meth1 {
- (id) meth1 {
  if (bar)
  if (bar)
    return [Object new];
    return [Object new];
  return; /* { dg-warning "'return' with no value, in function returning non-void" } */
  return; /* { dg-warning "'return' with no value, in function returning non-void" } */
}
}
- (void) meth2 {
- (void) meth2 {
  if (!bar)
  if (!bar)
    return;
    return;
  bar = 0;
  bar = 0;
} /* { dg-bogus "'return' with no value, in function returning non-void" } */
} /* { dg-bogus "'return' with no value, in function returning non-void" } */
@end
@end
 
 

powered by: WebSVN 2.1.0

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