1 ; REQUIRES: x86-registered-target
3 ; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
4 ; RUN: -fembed-bitcode=all -x ir %s -o - \
6 ; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
7 ; RUN: -fembed-bitcode=marker -x ir %s -o - \
8 ; RUN: | FileCheck %s -check-prefix=CHECK-MARKER
9 ; RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm \
10 ; RUN: -fembed-bitcode=all -x ir %s -o - \
11 ; RUN: | FileCheck %s -check-prefix=CHECK-ELF
12 ; RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm \
13 ; RUN: -fembed-bitcode=marker -x ir %s -o - \
14 ; RUN: | FileCheck %s -check-prefix=CHECK-ELF-MARKER
15 ; RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm \
16 ; RUN: -fembed-bitcode=bitcode -x ir %s -o - \
17 ; RUN: | FileCheck %s -check-prefix=CHECK-ELF-ONLY-BITCODE
20 ; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm-bc \
21 ; RUN: -x ir %s -o %t.bc
22 ; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
23 ; RUN: -fembed-bitcode=all -x ir %t.bc -o - \
25 ; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
26 ; RUN: -fembed-bitcode=bitcode -x ir %t.bc -o - \
27 ; RUN: | FileCheck %s -check-prefix=CHECK-ONLY-BITCODE
28 ; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
29 ; RUN: -fembed-bitcode=marker -x ir %t.bc -o - \
30 ; RUN: | FileCheck %s -check-prefix=CHECK-MARKER
32 ; run through -fembed-bitcode twice and make sure it doesn't crash
33 ; RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm-bc \
34 ; RUN: -fembed-bitcode=all -x ir %s -o - \
35 ; RUN: | %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-llvm \
36 ; RUN: -fembed-bitcode=all -x ir - -o /dev/null
38 ; check the magic number of bitcode at the beginning of the string
39 ; CHECK: @llvm.embedded.module = private constant
40 ; CHECK: c"\DE\C0\17\0B
41 ; CHECK: section "__LLVM,__bitcode"
42 ; CHECK: @llvm.cmdline = private constant
43 ; CHECK: section "__LLVM,__cmdline"
45 ; CHECK-ELF: @llvm.embedded.module
46 ; CHECK-ELF-SAME: section ".llvmbc", align 1
47 ; CHECK-ELF: @llvm.cmdline
48 ; CHECK-ELF-SAME: section ".llvmcmd", align 1
50 ; CHECK-ELF-MARKER: @llvm.embedded.module
51 ; CHECK-ELF-MARKER: constant [0 x i8] zeroinitializer
52 ; CHECK-ELF-MARKER: @llvm.cmdline
53 ; CHECK-ELF-MARKER: section ".llvmcmd", align 1
55 ; CHECK-ELF-ONLY-BITCODE: @llvm.embedded.module
56 ; CHECK-ELF-ONLY-BITCODE-SAME: section ".llvmbc", align 1
57 ; CHECK-ELF-ONLY-BITCODE-NOT: @llvm.cmdline
58 ; CHECK-ELF-ONLY-BITCODE-NOT: section ".llvmcmd"
60 ; CHECK-ONLY-BITCODE: @llvm.embedded.module = private constant
61 ; CHECK-ONLY-BITCODE: c"\DE\C0\17\0B
62 ; CHECK-ONLY-BITCODE: section "__LLVM,__bitcode"
63 ; CHECK-ONLY-BITCODE-NOT: @llvm.cmdline = private constant
64 ; CHECK-ONLY-BITCODE-NOT: section "__LLVM,__cmdline"
66 ; CHECK-MARKER: @llvm.embedded.module
67 ; CHECK-MARKER: constant [0 x i8] zeroinitializer
68 ; CHECK-MARKER: section "__LLVM,__bitcode"
69 ; CHECK-MARKER: @llvm.cmdline
70 ; CHECK-MARKER: section "__LLVM,__cmdline"