blob: d9f99f513da72c694184a23bf24b77ef1f0b89ed [file] [log] [blame]
Ted Kremenek2d6c9062010-07-30 00:47:46 +00001// RUN: %clang_cc1 -triple i386-unknown-unknown -ast-print %s 2>&1 | FileCheck %s
2// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -ast-print %s 2>&1 | FileCheck %s
Fariborz Jahanian232220c2007-11-12 22:29:28 +00003
4@interface current
5{
Fariborz Jahanian935fd762009-03-03 01:21:12 +00006@public
Fariborz Jahanian232220c2007-11-12 22:29:28 +00007 int ivar;
8 int ivar1;
9 int ivar2;
10}
11@end
12
13current *pc;
14
15int foo()
16{
Ted Kremenek2d6c9062010-07-30 00:47:46 +000017 return pc->ivar2 + (*pc).ivar + pc->ivar1;
Fariborz Jahanian232220c2007-11-12 22:29:28 +000018}
Ted Kremenek2d6c9062010-07-30 00:47:46 +000019
20// CHECK: @interface current{
21// CHECK: int ivar;
22// CHECK: int ivar1;
23// CHECK: int ivar2;
24// CHECK: }
25// CHECK: @end
26// CHECK: current *pc;
27// CHECK: int foo() {
28// CHECK: return pc->ivar2 + (*pc).ivar + pc->ivar1;
29// CHECK: }
30