Benjamin Kramer | e50d4f6 | 2012-10-02 09:29:48 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-macosx10.8.0 -fobjc-runtime=macosx-10.8.0 -fsyntax-only -Wunused-function %s > %t.nonarc 2>&1 |
| 2 | // RUN: %clang_cc1 -triple x86_64-apple-macosx10.8.0 -fobjc-runtime=macosx-10.8.0 -fsyntax-only -Wunused-function -fobjc-arc %s > %t.arc 2>&1 |
Ted Kremenek | 3ba17ee | 2012-10-02 05:36:02 +0000 | [diff] [blame] | 3 | // RUN: FileCheck -input-file=%t.nonarc %s |
| 4 | // RUN: FileCheck -input-file=%t.arc -check-prefix=ARC %s |
| 5 | |
| 6 | static void bar() {} // Intentionally unused. |
| 7 | |
| 8 | void foo(id self) { |
| 9 | __weak id weakSelf = self; |
| 10 | } |
| 11 | |
| 12 | // CHECK: 9:13: warning: __weak attribute cannot be specified on an automatic variable when ARC is not enabled |
| 13 | // CHECK: 6:13: warning: unused function 'bar' |
| 14 | // CHECK: 2 warnings generated |
| 15 | // ARC: 6:13: warning: unused function 'bar' |
| 16 | // ARC: 1 warning generated |