blob: bd2afb44bb0fdc7b0a2a6329f7be4c85b695add4 [file] [log] [blame]
Steven Wu27fb5222016-05-11 16:26:03 +00001; REQUIRES: arm-registered-target
2; REQUIRES: aarch64-registered-target
3; check .ll input
4; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
5; RUN: -fembed-bitcode=all -x ir %s -o - \
6; RUN: | FileCheck %s
7; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
8; RUN: -fembed-bitcode=marker -x ir %s -o - \
9; RUN: | FileCheck %s -check-prefix=CHECK-MARKER
10; RUN: %clang_cc1 -triple aarch64-unknown-linux-gnueabi -emit-llvm \
11; RUN: -fembed-bitcode=all -x ir %s -o - \
12; RUN: | FileCheck %s -check-prefix=CHECK-ELF
13
14; check .bc input
15; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm-bc \
16; RUN: -x ir %s -o %t.bc
17; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
18; RUN: -fembed-bitcode=all -x ir %t.bc -o - \
19; RUN: | FileCheck %s
20; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
21; RUN: -fembed-bitcode=bitcode -x ir %t.bc -o - \
22; RUN: | FileCheck %s -check-prefix=CHECK-ONLY-BITCODE
23; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
24; RUN: -fembed-bitcode=marker -x ir %t.bc -o - \
25; RUN: | FileCheck %s -check-prefix=CHECK-MARKER
26
27; run through -fembed-bitcode twice and make sure it doesn't crash
28; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm-bc \
29; RUN: -fembed-bitcode=all -x ir %s -o - \
30; RUN: | %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
31; RUN: -fembed-bitcode=all -x ir - -o /dev/null
32
33; check the magic number of bitcode at the beginning of the string
Steven Wu2c059a52016-05-16 18:54:58 +000034; CHECK: @llvm.embedded.module = private constant
Steven Wu27fb5222016-05-11 16:26:03 +000035; CHECK: c"\DE\C0\17\0B
36; CHECK: section "__LLVM,__bitcode"
Steven Wu2c059a52016-05-16 18:54:58 +000037; CHECK: @llvm.cmdline = private constant
Steven Wu27fb5222016-05-11 16:26:03 +000038; CHECK: section "__LLVM,__cmdline"
39
40; CHECK-ELF: @llvm.embedded.module
41; CHECK-ELF: section ".llvmbc"
42; CHECK-ELF: @llvm.cmdline
43; CHECK-ELF: section ".llvmcmd"
44
Steven Wu2c059a52016-05-16 18:54:58 +000045; CHECK-ONLY-BITCODE: @llvm.embedded.module = private constant
Steven Wu27fb5222016-05-11 16:26:03 +000046; CHECK-ONLY-BITCODE: c"\DE\C0\17\0B
47; CHECK-ONLY-BITCODE: section "__LLVM,__bitcode"
Steven Wu2c059a52016-05-16 18:54:58 +000048; CHECK-ONLY-BITCODE-NOT: @llvm.cmdline = private constant
Steven Wu27fb5222016-05-11 16:26:03 +000049; CHECK-ONLY-BITCODE-NOT: section "__LLVM,__cmdline"
50
51; CHECK-MARKER: @llvm.embedded.module
52; CHECK-MARKER: constant [0 x i8] zeroinitializer
53; CHECK-MARKER: section "__LLVM,__bitcode"
54; CHECK-MARKER: @llvm.cmdline
55; CHECK-MARKER: section "__LLVM,__cmdline"
56
57define i32 @f0() {
58 ret i32 0
59}