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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc.dg/] [stret-2.m] - Blame information for rev 853

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

Line No. Rev Author Line
1 149 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
 
7
#include <objc/Object.h>
8
 
9
struct astruct {
10
  float a, b;
11
} glob = { 1.0, 2.0 };
12
 
13
struct bstruct {
14
  float a, b, c, d, e, f;
15
} globb = { 1, 2, 3, 4, 5, 6 };
16
 
17
@interface foo : Object
18
- (struct astruct) stret;
19
- (struct bstruct) stretb;
20
@end
21
 
22
@implementation foo : Object
23
- (struct astruct) stret { return glob; }
24
- (struct bstruct) stretb { return globb; }
25
@end
26
 
27
@interface bar: foo
28
- (struct astruct) stret;
29
- (struct bstruct) stretb;
30
@end
31
 
32
@implementation bar
33
- (struct astruct) stret { return [super stret]; }
34
- (struct bstruct) stretb { return [super stretb]; }
35
@end
36
 
37
struct astruct afunc(foo *foo_obj) {
38
  return [foo_obj stret];
39
}
40
 
41
/* { dg-final { scan-assembler "objc_msgSend_stret" } } */
42
/* { dg-final { scan-assembler "objc_msgSendSuper_stret" } } */
43
 
44
/* { dg-final { scan-assembler-not "objc_msgSend\[^_S\]" } } */
45
/* { dg-final { scan-assembler-not "objc_msgSendSuper\[^_\]" } } */
46
 

powered by: WebSVN 2.1.0

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