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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [zero-link-2.m] - Blame information for rev 704

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 704 jeremybenn
/* Check if the '-fno-zero-link' flag correctly _omits_ an objc_getClass() call. */
2
/* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
3
 
4
/* { dg-do compile { target *-*-darwin* } } */
5
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
6
/* { dg-options "-fno-zero-link" } */
7
 
8
#include <objc/Object.h>
9
 
10
extern void abort(void);
11
#define CHECK_IF(expr) if(!(expr)) abort();
12
 
13
@interface Base: Object
14
+ (int) getValue;
15
@end
16
 
17
@implementation Base
18
+ (int) getValue { return 1593; }
19
@end
20
 
21
int main(void) {
22
  int val = [Base getValue];
23
  CHECK_IF(val == 1593);
24
  return 0;
25
}
26
 
27
/* { dg-final { scan-assembler "_OBJC_ClassRefs_0"  { target { *-*-darwin* && { ! lp64 } } } } } */
28
/* { dg-final { scan-assembler "_OBJC_ClassRef_Base"  { target { *-*-darwin* && { lp64 } } } } } */
29
/* { dg-final { scan-assembler-not "objc_getClass" } } */

powered by: WebSVN 2.1.0

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