embed-bitcode.ll 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ; 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. ; check .bc input
  14. ; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm-bc \
  15. ; RUN: -x ir %s -o %t.bc
  16. ; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
  17. ; RUN: -fembed-bitcode=all -x ir %t.bc -o - \
  18. ; RUN: | FileCheck %s
  19. ; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
  20. ; RUN: -fembed-bitcode=bitcode -x ir %t.bc -o - \
  21. ; RUN: | FileCheck %s -check-prefix=CHECK-ONLY-BITCODE
  22. ; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
  23. ; RUN: -fembed-bitcode=marker -x ir %t.bc -o - \
  24. ; RUN: | FileCheck %s -check-prefix=CHECK-MARKER
  25. ; run through -fembed-bitcode twice and make sure it doesn't crash
  26. ; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm-bc \
  27. ; RUN: -fembed-bitcode=all -x ir %s -o - \
  28. ; RUN: | %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
  29. ; RUN: -fembed-bitcode=all -x ir - -o /dev/null
  30. ; check the magic number of bitcode at the beginning of the string
  31. ; CHECK: @llvm.embedded.module = private constant
  32. ; CHECK: c"\DE\C0\17\0B
  33. ; CHECK: section "__LLVM,__bitcode"
  34. ; CHECK: @llvm.cmdline = private constant
  35. ; CHECK: section "__LLVM,__cmdline"
  36. ; CHECK-ELF: @llvm.embedded.module
  37. ; CHECK-ELF: section ".llvmbc"
  38. ; CHECK-ELF: @llvm.cmdline
  39. ; CHECK-ELF: section ".llvmcmd"
  40. ; CHECK-ONLY-BITCODE: @llvm.embedded.module = private constant
  41. ; CHECK-ONLY-BITCODE: c"\DE\C0\17\0B
  42. ; CHECK-ONLY-BITCODE: section "__LLVM,__bitcode"
  43. ; CHECK-ONLY-BITCODE-NOT: @llvm.cmdline = private constant
  44. ; CHECK-ONLY-BITCODE-NOT: section "__LLVM,__cmdline"
  45. ; CHECK-MARKER: @llvm.embedded.module
  46. ; CHECK-MARKER: constant [0 x i8] zeroinitializer
  47. ; CHECK-MARKER: section "__LLVM,__bitcode"
  48. ; CHECK-MARKER: @llvm.cmdline
  49. ; CHECK-MARKER: section "__LLVM,__cmdline"
  50. define i32 @f0() {
  51. ret i32 0
  52. }