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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 704 jeremybenn
/* Check if the '-fzero-link' flag correctly emits 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 "-fzero-link" } */
7
 
8
#include <objc/Object.h>
9
#include <objc/objc.h>
10
 
11
extern void abort(void);
12
#define CHECK_IF(expr) if(!(expr)) abort();
13
 
14
@interface Base: Object
15
+ (int) getValue;
16
@end
17
 
18
@implementation Base
19
+ (int) getValue { return 1593; }
20
@end
21
 
22
int main(void) {
23
  int val = [Base getValue];
24
  CHECK_IF(val == 1593);
25
  return 0;
26
}
27
 
28
/* { dg-final { scan-assembler-not "_OBJC_ClassRefs_0" { target { *-*-darwin* && { ! lp64 } } } } } */
29
/* { dg-final { scan-assembler-not "_OBJC_ClassRef_Base" { target { *-*-darwin* && { lp64 } } } } } */
30
/* { dg-final { scan-assembler "objc_getClass" } } */
31
 

powered by: WebSVN 2.1.0

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