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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [property/] [dotsyntax-4.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Contributed by Nicola Pero , November 2010.  */
2
/* { dg-do compile } */
3
 
4
/* Test the 'dot syntax' without a declarated property.  This tests
5
   syntax errors in the case where the object is a Class.  */
6
 
7
 
8
#include 
9
#include 
10
#include 
11
 
12
@interface MyRootClass
13
{
14
  Class isa;
15
}
16
+ (id) initialize;
17
+ (id) alloc;
18
- (id) init;
19
@end
20
 
21
@implementation MyRootClass
22
+ (id) initialize { return self; }
23
+ (id) alloc { return class_createInstance (self, 0); }
24
- (id) init { return self; }
25
@end
26
 
27
int main (void)
28
{
29
  MyRootClass.invalid = 40;      /* { dg-error "could not find setter.getter" } */
30
  if (MyRootClass.invalid != 40) /* { dg-error "could not find setter.getter" } */
31
    abort ();
32
 
33
  MyRootClass.;           /* { dg-error "expected identifier" } */
34
  if (MyRootClass.)       /* { dg-error "expected identifier" } */
35
    abort ();
36
 
37
  MyRootClass.int;        /* { dg-error "expected identifier" } */
38
                          /* { dg-error "expected" "" { target *-*-* } 37 } */
39
  if (MyRootClass.int)    /* { dg-error "expected identifier" } */
40
                          /* { dg-error "expected" "" { target *-*-* } 39 } */
41
    abort ();
42
 
43
  return 0;
44
}

powered by: WebSVN 2.1.0

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