| 1 | // RUN: %clang_cc1 -fsyntax-only -Wunguarded-availability -fdiagnostics-parseable-fixits -triple x86_64-apple-darwin9 %s 2>&1 | FileCheck %s |
| 2 | |
| 3 | __attribute__((availability(macos, introduced=10.12))) |
| 4 | int function(void); |
| 5 | |
| 6 | void use() { |
| 7 | function(); |
| 8 | // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:3-[[@LINE-1]]:3}:"if (__builtin_available(macOS 10.12, *)) {\n " |
| 9 | // CHECK-NEXT: fix-it:{{.*}}:{[[@LINE-2]]:14-[[@LINE-2]]:14}:"\n } else {\n // Fallback on earlier versions\n }" |
| 10 | } |
| 11 | |
| 12 | __attribute__((availability(macos, introduced=10.12))) |
| 13 | struct New { }; |
| 14 | |
| 15 | struct NoFixit { |
| 16 | struct New field; |
| 17 | }; |
| 18 | // CHECK-NOT: API_AVAILABLE |
| 19 | |