mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Avoids a bogus "argument unused" warning, since bitcode compilation doesn't bother to set up much of a Clang AST context. (-embed-bitcode compiles in two steps: source -> bitcode, then bitcode -> object file. This is about the second step.) Patch by Bob Wilson, who's currently on vacation but wanted this to get in sooner rather than later. rdar://problem/31372950
31 lines
1.3 KiB
LLVM
31 lines
1.3 KiB
LLVM
; REQUIRES: CPU=x86_64
|
|
; RUN: llvm-as %s -o %t.bc
|
|
; RUN: %swift -target x86_64-apple-darwin10 -c -module-name someModule -embed-bitcode -disable-llvm-optzns -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-IMPORTER %s < %t.diags.txt
|
|
|
|
; RUN: %swift -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
|
|
|
|
; MARKER: Contents of (__LLVM,__bitcode) section
|
|
; MARKER-NEXT: 00
|
|
; MARKER-CMD: Contents of (__LLVM,__swift_cmdline) section
|
|
; MARKER-CMD-NEXT: 00
|
|
|
|
; CHECK-IMPORTER: clang
|
|
; CHECK-IMPORTER: -fembed-bitcode
|
|
; CHECK-IMPORTER: -target
|
|
; CHECK-IMPORTER-NOT: argument unused
|
|
|
|
define i32 @f0() nounwind ssp {
|
|
ret i32 0
|
|
}
|