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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 309 jeremybenn
/* Test for handling of struct-returning methods
2
   for the Mac OS X ("NeXT") runtime (which uses specialized entry
3
   points).  */
4
/* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
5
/* { dg-do compile { target *-*-darwin* } } */
6
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
7
/* { dg-require-effective-target ilp32 } */
8
 
9
#include "../objc-obj-c++-shared/Object1.h"
10
 
11
struct astruct {
12
  float a, b;
13
  char c;
14
} glob = { 1.0, 2.0, 'a' };
15
 
16
struct bstruct {
17
  float a, b, c, d, e, f;
18
} globb = { 1, 2, 3, 4, 5, 6 };
19
 
20
@interface foo : Object
21
- (struct astruct) stret;
22
- (struct bstruct) stretb;
23
@end
24
 
25
@implementation foo : Object
26
- (struct astruct) stret { return glob; }
27
- (struct bstruct) stretb { return globb; }
28
@end
29
 
30
@interface bar: foo
31
- (struct astruct) stret;
32
- (struct bstruct) stretb;
33
@end
34
 
35
@implementation bar
36
- (struct astruct) stret { return [super stret]; }
37
- (struct bstruct) stretb { return [super stretb]; }
38
@end
39
 
40
struct astruct afunc(foo *foo_obj) {
41
  return [foo_obj stret];
42
}
43
 
44
/* { dg-final { scan-assembler "objc_msgSend_stret" } } */
45
/* { dg-final { scan-assembler "objc_msgSendSuper_stret" } } */
46
 
47
/* { dg-final { scan-assembler-not "objc_msgSend\[^_S\]" } } */
48
/* { dg-final { scan-assembler-not "objc_msgSendSuper\[^_\]" } } */
49
 

powered by: WebSVN 2.1.0

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