Ted Kremenek | 565e465 | 2010-02-05 02:06:54 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -triple i386-apple-darwin10 -analyzer-store=region |
| 2 | // RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -triple i386-apple-darwin10 -analyzer-store=basic |
Ted Kremenek | bcf62a9 | 2009-08-25 22:55:09 +0000 | [diff] [blame] | 3 | |
| 4 | // Note that the target triple is important for this test case. It specifies that we use the |
| 5 | // fragile Objective-C ABI. |
| 6 | |
| 7 | @interface Foo { |
| 8 | int x; |
| 9 | } |
| 10 | @end |
| 11 | |
| 12 | @implementation Foo |
| 13 | static Foo* bar(Foo *p) { |
| 14 | if (p->x) |
| 15 | return ++p; // This is only valid for the fragile ABI. |
| 16 | |
| 17 | return p; |
| 18 | } |
| 19 | @end |