File: embed-bitcode.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (56 lines) | stat: -rw-r--r-- 2,746 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
; REQUIRES: CPU=x86_64
; RUN: llvm-as %s -o %t.bc

; This test uses '%swiftc_driver_plain -frontend' instead of '%swift' or
; '%target-swift-frontend' because it checks the contents of the command line as
; serialized in the object file.

; RUN: %swiftc_driver_plain -frontend -target x86_64-apple-darwin10 -c -module-name someModule -embed-bitcode -disable-llvm-optzns -Xllvm -time-passes -o %t2.o %t.bc -dump-clang-diagnostics 2> %t.diags.txt
; RUN: llvm-objdump --macho --section="__LLVM,__bitcode" %t2.o | %FileCheck %s
; RUN: llvm-objdump --macho --section="__LLVM,__swift_cmdline" %t2.o | %FileCheck -check-prefix=CHECK-CMD %s
; RUN: %FileCheck -check-prefix CHECK-COMPILER %s < %t.diags.txt

; RUN: %swiftc_driver_plain -frontend -O -target x86_64-apple-darwin10 -c -module-name someModule -embed-bitcode -disable-llvm-optzns -Xllvm -time-passes -o %t2-opt.o %t.bc -dump-clang-diagnostics -Xllvm -debug-pass=Structure 2> %t.diags-opt.txt
; RUN: llvm-objdump --macho --section="__LLVM,__bitcode" %t2-opt.o | %FileCheck %s
; RUN: llvm-objdump --macho --section="__LLVM,__swift_cmdline" %t2-opt.o | %FileCheck -check-prefix=CHECK-CMD-OPT %s
; RUN: %FileCheck -check-prefix CHECK-COMPILER-OPT %s < %t.diags-opt.txt

; RUN: %swiftc_driver_plain -frontend -target x86_64-apple-darwin10 -c -module-name someModule -embed-bitcode-marker  -o %t3.o %t.bc
; RUN: llvm-objdump --macho --section="__LLVM,__bitcode" %t3.o | %FileCheck -check-prefix=MARKER %s
; RUN: llvm-objdump --macho --section="__LLVM,__swift_cmdline" %t3.o | %FileCheck -check-prefix=MARKER-CMD %s

target triple = "x86_64-apple-darwin10"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"

; CHECK: Contents of (__LLVM,__bitcode) section
; CHECK-CMD: Contents of (__LLVM,__swift_cmdline) section
; -target
; CHECK-CMD: {{^[0-9a-f]+}} 2d 74 61 72 67 65 74 00
; CHECK-CMD-OPT: Contents of (__LLVM,__swift_cmdline) section
; -O -target
; CHECK-CMD-OPT: {{^[0-9a-f]+}} 2d 4f 00 2d 74 61 72 67 65 74 00

; MARKER: Contents of (__LLVM,__bitcode) section
; MARKER-NEXT: 00
; MARKER-CMD: Contents of (__LLVM,__swift_cmdline) section
; MARKER-CMD-NEXT: 00

; CHECK-COMPILER-NOT: argument unused
; CHECK-COMPILER: bin{{/|\\}}clang
; CHECK-COMPILER-SAME: -fembed-bitcode
; CHECK-COMPILER-SAME: -target
; CHECK-COMPILER-NOT: argument unused
; CHECK-COMPILER: Fast Register Allocator

; CHECK-COMPILER-OPT-NOT: argument unused
; CHECK-COMPILER-OPT: bin{{/|\\}}clang
; CHECK-COMPILER-OPT-SAME: -fembed-bitcode
; CHECK-COMPILER-OPT-SAME: -target
; CHECK-COMPILER-OPT-SAME: -Os
; CHECK-COMPILER-OPT-NOT: argument unused
; CHECK-COMPILER-OPT-DAG: Control Flow Optimizer
; CHECK-COMPILER-OPT-DAG: Machine Common Subexpression Elimination

define i32 @f0() nounwind ssp {
       ret i32 0
}