Ted Kremenek | 2d6c906 | 2010-07-30 00:47:46 +0000 | [diff] [blame] | 1 | // 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 Jahanian | 232220c | 2007-11-12 22:29:28 +0000 | [diff] [blame] | 3 | |
| 4 | @interface current |
| 5 | { |
Fariborz Jahanian | 935fd76 | 2009-03-03 01:21:12 +0000 | [diff] [blame] | 6 | @public |
Fariborz Jahanian | 232220c | 2007-11-12 22:29:28 +0000 | [diff] [blame] | 7 | int ivar; |
| 8 | int ivar1; |
| 9 | int ivar2; |
| 10 | } |
| 11 | @end |
| 12 | |
| 13 | current *pc; |
| 14 | |
| 15 | int foo() |
| 16 | { |
Ted Kremenek | 2d6c906 | 2010-07-30 00:47:46 +0000 | [diff] [blame] | 17 | return pc->ivar2 + (*pc).ivar + pc->ivar1; |
Fariborz Jahanian | 232220c | 2007-11-12 22:29:28 +0000 | [diff] [blame] | 18 | } |
Ted Kremenek | 2d6c906 | 2010-07-30 00:47:46 +0000 | [diff] [blame] | 19 | |
| 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 | |