1 // Test that `-ffuchsia-api-level` is propagated to cc1.
3 // REQUIRES: x86-registered-target
4 // RUN: %clang -target x86_64-unknown-fuchsia -ffuchsia-api-level=16 -c %s -### 2>&1| FileCheck %s
6 // It should also be exposed to non-fuchsia platforms. This is desireable when
7 // using common Fuchsia headers for building host libraries that also depend on
8 // the Fuchsia version (such as using a compatible host-side FIDL library that
9 // talks with a Fuchsia FIDL library of the same version).
10 // RUN: %clang -target x86_64-unknown-linux-gnu -ffuchsia-api-level=16 -c %s -### 2>&1 | FileCheck %s
12 // Check Fuchsia API level macro.
13 // RUN: %clang -target x86_64-unknown-fuchsia -ffuchsia-api-level=15 -c %s -o %t
14 // RUN: llvm-readobj --symbols %t | FileCheck %s --check-prefix=CHECK-F15
16 // RUN: %clang -target x86_64-unknown-fuchsia -ffuchsia-api-level=16 -c %s -o %t
17 // RUN: llvm-readobj --symbols %t | FileCheck %s --check-prefix=CHECK-F16
19 // Check using a non-integer Fuchsia API level.
20 // RUN: not %clang -target x86_64-unknown-fuchsia -ffuchsia-api-level=16.0.0 -c %s 2>&1| FileCheck %s --check-prefix=CHECK-ERROR
23 // CHECK: "-ffuchsia-api-level=16"
25 // CHECK-F15: Name: f15
27 // CHECK-F16: Name: f16
29 // CHECK-ERROR: error: invalid integral value '16.0.0' in '-ffuchsia-api-level=16.0.0'
31 #if __Fuchsia_API_level__ >= 16
41 int main(int argc
, char* argv
[]) {
42 #if __Fuchsia_API_level__ >= 16