1; REQUIRES: x86, xar
2; RUN: rm -rf %t; split-file %s %t
3; RUN: opt -module-summary %t/test.ll -o %t/test.o
4; RUN: opt -module-summary %t/foo.ll -o %t/foo.o
5; RUN: %lld -lSystem -bitcode_bundle %t/test.o %t/foo.o -o %t/test
6; RUN: llvm-objdump --macho --section=__LLVM,__bundle %t/test | FileCheck %s
7
8; CHECK:      Contents of (__LLVM,__bundle) section
9; CHECK-NEXT: For (__LLVM,__bundle) section: xar header
10; CHECK-NEXT:                   magic XAR_HEADER_MAGIC
11; CHECK-NEXT:                    size 28
12; CHECK-NEXT:                 version 1
13; CHECK-NEXT:   toc_length_compressed
14; CHECK-NEXT: toc_length_uncompressed
15; CHECK-NEXT:               cksum_alg XAR_CKSUM_SHA1
16; CHECK-NEXT: For (__LLVM,__bundle) section: xar table of contents:
17; CHECK-NEXT: <?xml version="1.0" encoding="UTF-8"?>
18; CHECK-NEXT: <xar>
19; CHECK-NEXT:  <toc>
20; CHECK-NEXT:   <checksum style="sha1">
21; CHECK-NEXT:    <size>20</size>
22; CHECK-NEXT:    <offset>0</offset>
23; CHECK-NEXT:   </checksum>
24; CHECK-NEXT:   <creation-time>{{.*}}</creation-time>
25; CHECK-NEXT:  </toc>
26; CHECK-NEXT: </xar>
27
28;--- foo.ll
29target triple = "x86_64-apple-darwin"
30target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
31
32define void @foo() {
33  ret void
34}
35
36;--- test.ll
37target triple = "x86_64-apple-darwin"
38target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
39
40define void @main() {
41  ret void
42}
43