OSDN Git Service

2005-06-28 Thomas Koenig <Thomas.Koenig@online.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / method-4.m
1 /* Check if class references (generated for the NeXT runtime) are appropriately 
2    folded.  This test is safe to run on all targets.  */
3 /* Author: Ziemowit Laski <zlaski@apple.com>.  */
4 /* { dg-options "-fnext-runtime" } */
5 /* { dg-do compile } */
6
7 #include <objc/Object.h>
8
9 typedef Object ObjectTypedef1;
10 typedef ObjectTypedef1 ObjectTypedef2;
11 @compatibility_alias ObjectAlias1 ObjectTypedef2;
12 @compatibility_alias ObjectAlias2 ObjectAlias1;
13 typedef ObjectAlias2 ObjectTypedef3;
14
15 void foo(void) {
16   id obj = [Object new];
17   obj = [ObjectTypedef1 new];
18   obj = [ObjectTypedef2 new];
19   obj = [ObjectTypedef3 new];
20   obj = [ObjectAlias1 new];
21   obj = [ObjectAlias2 new];
22 }
23
24 /* { dg-final { scan-assembler "_OBJC_CLASS_REFERENCES_0" } } */
25 /* { dg-final { scan-assembler-not "_OBJC_CLASS_REFERENCES_1" } } */