John McCall | d1e40d5 | 2011-10-02 01:16:38 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -triple i386-apple-darwin10 -fobjc-fragile-abi -analyzer-store=region %s |
Ted Kremenek | bcf62a9 | 2009-08-25 22:55:09 +0000 | [diff] [blame] | 2 | |
| 3 | // Note that the target triple is important for this test case. It specifies that we use the |
| 4 | // fragile Objective-C ABI. |
| 5 | |
| 6 | @interface Foo { |
| 7 | int x; |
| 8 | } |
| 9 | @end |
| 10 | |
| 11 | @implementation Foo |
| 12 | static Foo* bar(Foo *p) { |
| 13 | if (p->x) |
| 14 | return ++p; // This is only valid for the fragile ABI. |
| 15 | |
| 16 | return p; |
| 17 | } |
| 18 | @end |