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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [property/] [dotsyntax-4.m] - Blame information for rev 858

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

Line No. Rev Author Line
1 704 jeremybenn
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, 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 <stdlib.h>
9
#include <objc/objc.h>
10
#include <objc/runtime.h>
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
  if (MyRootClass.int)    /* { dg-error "expected identifier" } */
39
    abort ();
40
 
41
  return 0;
42
}

powered by: WebSVN 2.1.0

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