llvm-project
31 строка · 967.0 Байт
1// RUN: %clang_cc1 -triple x86_64-apple-macosx10.11 -emit-llvm -o - %s | FileCheck %s
2
3void use_at_available(void) {
4// CHECK: call i32 @__isPlatformVersionAtLeast(i32 1, i32 10, i32 12, i32 0)
5// CHECK-NEXT: icmp ne
6if (__builtin_available(macos 10.12, *))
7;
8
9// CHECK: call i32 @__isPlatformVersionAtLeast(i32 1, i32 10, i32 12, i32 0)
10// CHECK-NEXT: icmp ne
11if (@available(macos 10.12, *))
12;
13
14// CHECK: call i32 @__isPlatformVersionAtLeast(i32 1, i32 10, i32 12, i32 42)
15// CHECK-NEXT: icmp ne
16if (__builtin_available(ios 10, macos 10.12.42, *))
17;
18
19// CHECK-NOT: call i32 @__isPlatformVersionAtLeast
20// CHECK: br i1 true
21if (__builtin_available(ios 10, *))
22;
23
24// This check should be folded: our deployment target is 10.11.
25// CHECK-NOT: call i32 @__isPlatformVersionAtLeast
26// CHECK: br i1 true
27if (__builtin_available(macos 10.11, *))
28;
29}
30
31// CHECK: declare i32 @__isPlatformVersionAtLeast(i32, i32, i32, i32)
32