1 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.11 -emit-llvm -o - %s | FileCheck %s
3 void use_at_available(void) {
4 // CHECK: call i32 @__isPlatformVersionAtLeast(i32 1, i32 10, i32 12, i32 0)
6 if (__builtin_available(macos 10.12, *))
9 // CHECK: call i32 @__isPlatformVersionAtLeast(i32 1, i32 10, i32 12, i32 0)
10 // CHECK-NEXT: icmp ne
11 if (@available(macos 10.12, *))
14 // CHECK: call i32 @__isPlatformVersionAtLeast(i32 1, i32 10, i32 12, i32 42)
15 // CHECK-NEXT: icmp ne
16 if (__builtin_available(ios 10, macos 10.12.42, *))
19 // CHECK-NOT: call i32 @__isPlatformVersionAtLeast
21 if (__builtin_available(ios 10, *))
24 // This check should be folded: our deployment target is 10.11.
25 // CHECK-NOT: call i32 @__isPlatformVersionAtLeast
27 if (__builtin_available(macos 10.11, *))
31 // CHECK: declare i32 @__isPlatformVersionAtLeast(i32, i32, i32, i32)