xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/static-ivar-ref-1.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple i386-unknown-unknown -ast-print %s 2>&1 | FileCheck  %s
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10  -ast-print %s  2>&1  | FileCheck %s
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc@interface current
5*f4a2713aSLionel Sambuc{
6*f4a2713aSLionel Sambuc@public
7*f4a2713aSLionel Sambuc  int ivar;
8*f4a2713aSLionel Sambuc  int ivar1;
9*f4a2713aSLionel Sambuc  int ivar2;
10*f4a2713aSLionel Sambuc}
11*f4a2713aSLionel Sambuc@end
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuccurrent *pc;
14*f4a2713aSLionel Sambuc
15*f4a2713aSLionel Sambucint foo()
16*f4a2713aSLionel Sambuc{
17*f4a2713aSLionel Sambuc  return pc->ivar2 + (*pc).ivar + pc->ivar1;
18*f4a2713aSLionel Sambuc}
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc// CHECK: @interface current{
21*f4a2713aSLionel Sambuc// CHECK:     int ivar;
22*f4a2713aSLionel Sambuc// CHECK:     int ivar1;
23*f4a2713aSLionel Sambuc// CHECK:     int ivar2;
24*f4a2713aSLionel Sambuc// CHECK: }
25*f4a2713aSLionel Sambuc// CHECK: @end
26*f4a2713aSLionel Sambuc// CHECK: current *pc;
27*f4a2713aSLionel Sambuc// CHECK: int foo() {
28*f4a2713aSLionel Sambuc// CHECK:     return pc->ivar2 + (*pc).ivar + pc->ivar1;
29*f4a2713aSLionel Sambuc// CHECK: }
30*f4a2713aSLionel Sambuc
31