summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/objc.dg/ivar-problem-1.m
blob: 4a877680549ace198a06bd69a2d5037e5d2635fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
/* { dg-do compile } */

/* This test checks what happens if there are 16 instance variables.
   In that case, the class was not created correctly.  In this testcase,
   we have two classes, one with 15 variables and one with 16.  Older
   GCCs would generate a bogus warning for the second class but not 
   for the first one.  */

#include <stdlib.h>
#include <objc/objc.h>

@interface MyRootClass1
{
  Class isa;
  int v2;
  int v3;
  int v4;
  int v5;
  int v6;
  int v7;
  int v8;
  int v9;
  int v10;
  int v11;
  int v12;
  int v13;
  int v14;
  int v15;
}
- (id) init;
@end

@implementation MyRootClass1
- (id) init { return self; }
@end


@interface MyRootClass2
{
  Class isa;
  int v2;
  int v3;
  int v4;
  int v5;
  int v6;
  int v7;
  int v8;
  int v9;
  int v10;
  int v11;
  int v12;
  int v13;
  int v14;
  int v15;
  /* Adding the 16th variable used to cause bogus warnings to be
     generated.  */
  int v16;
}
- (id) init;
@end

@implementation MyRootClass2
- (id) init { return self; } /* This should not generate a bogus warning.  */
@end
OpenPOWER on IntegriCloud