[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Driver / embed-bitcode.c
blob07e4378dc09401d1f6714505a6d1e0d06ea8910e
1 // RUN: %clang -ccc-print-bindings -c %s -fembed-bitcode 2>&1 | FileCheck %s
2 // CHECK: clang
3 // CHECK: clang
5 // RUN: %clang %s -c -fembed-bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-CC
6 // CHECK-CC: -cc1
7 // CHECK-CC: -emit-llvm-bc
8 // CHECK-CC: -cc1
9 // CHECK-CC: -emit-obj
10 // CHECK-CC: -fembed-bitcode=all
12 // RUN: %clang %s -c -fembed-bitcode=bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-BITCODE
13 // CHECK-BITCODE: -cc1
14 // CHECK-BITCODE: -emit-llvm-bc
15 // CHECK-BITCODE: -cc1
16 // CHECK-BITCODE: -emit-obj
17 // CHECK-BITCODE: -fembed-bitcode=bitcode
19 // RUN: %clang %s -c -save-temps -fembed-bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-SAVE-TEMP
20 // CHECK-SAVE-TEMP: -cc1
21 // CHECK-SAVE-TEMP: -E
22 // CHECK-SAVE-TEMP: -cc1
23 // CHECK-SAVE-TEMP: -emit-llvm-bc
24 // CHECK-SAVE-TEMP: -cc1
25 // CHECK-SAVE-TEMP: -S
26 // CHECK-SAVE-TEMP: -fembed-bitcode=all
27 // CHECK-SAVE-TEMP: -cc1as
29 // RUN: %clang -c %s -flto -fembed-bitcode 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO
30 // RUN: %clang -c %s -flto=full -fembed-bitcode 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO
31 // RUN: %clang -c %s -flto=thin -fembed-bitcode 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO
32 // CHECK-LTO: -cc1
33 // CHECK-LTO: -emit-llvm-bc
34 // CHECK-LTO-NOT: warning: argument unused during compilation: '-fembed-bitcode'
35 // CHECK-LTO-NOT: -cc1
36 // CHECK-LTO-NOT: -fembed-bitcode=all
37 // RUN: touch %t.o
38 // RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %t.o -fembed-bitcode -fembed-bitcode-marker -mlinker-version=277 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO-MARKER-277
39 // RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %t.o -fembed-bitcode -fembed-bitcode-marker -mlinker-version=278 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO-MARKER-278
40 // CHECK-LTO-MARKER-277-NOT: bitcode_process_mode
41 // CHECK-LTO-MARKER-278: bitcode_process_mode
45 // RUN: %clang -c %s -fembed-bitcode-marker -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-MARKER
46 // CHECK-MARKER: -cc1
47 // CHECK-MARKER: -emit-obj
48 // CHECK-MARKER: -fembed-bitcode=marker
49 // CHECK-MARKER-NOT: -cc1
51 // RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -fembed-bitcode=all -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-LINKER
52 // RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -fembed-bitcode=marker -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-LINKER
53 // RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -flto=full -fembed-bitcode=bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-LINKER
54 // RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -flto=thin -fembed-bitcode=bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-LINKER
55 // RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -fembed-bitcode=off -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-NO-LINKER
56 // CHECK-LINKER: ld
57 // CHECK-LINKER: -bitcode_bundle
58 // CHECK-NO-LINKER-NOT: -bitcode_bundle
60 // RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=5.0 %s -fembed-bitcode -### 2>&1 | \
61 // RUN: FileCheck %s -check-prefix=CHECK-PLATFORM-NOTSUPPORTED
62 // CHECK-PLATFORM-NOTSUPPORTED: -fembed-bitcode is not supported on versions of iOS prior to 6.0