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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc.dg/] [method-17.m] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* Test for spurious "may or may not return a value" warnings.  */
2
 
3
/* { dg-do compile } */
4
/* { dg-options "-Wextra" } */
5
 
6
#include <objc/Object.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;
20
} /* { dg-warning "this function may return with or without a value" } */
21
- (void) meth2 {
22
  if (!bar)
23
    return;
24
  bar = 0;
25
} /* { dg-bogus "this function may return with or without a value" } */
26
@end

powered by: WebSVN 2.1.0

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