mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Clang does not accept `-x objective-c` with WebAssembly target and it crashes with "Objective-C support is unimplemented for object file format" for now. `-enable-objc-interop` can work without the objc runtime support (which is indicated by `objc_interop` feature), so this adds a new `objc_codegen` feature to require Objective-C support only at compile-time.
25 lines
1.3 KiB
Swift
25 lines
1.3 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %build-irgen-test-overlays
|
|
// RUN: %target-swift-frontend -sdk %S/Inputs -primary-file %s -trap-function oopsie -enable-objc-interop -emit-ir -module-name trap_function -I %t | %FileCheck %s -check-prefix=TRAPFN
|
|
// RUN: %target-swift-frontend -O -sdk %S/Inputs -primary-file %s -trap-function oopsie -enable-objc-interop -emit-ir -module-name trap_function -I %t | %FileCheck %s -check-prefix=TRAPFN_OPT
|
|
// RUN: %target-swift-frontend -sdk %S/Inputs -primary-file %s -enable-objc-interop -emit-ir -module-name trap_function -I %t | %FileCheck %s -check-prefix=NOTRAPFN
|
|
// REQUIRES: objc_codegen
|
|
|
|
import gizmo
|
|
|
|
// TRAPFN-LABEL: define hidden swiftcc void @"$s13trap_function18checkClangImporteryyF"
|
|
// TRAPFN: call void @llvm.trap() [[ATTR0:#[0-9]+]]
|
|
|
|
// TRAPFN_OPT-LABEL: define hidden swiftcc void @"$s13trap_function18checkClangImporteryyF"
|
|
// TRAPFN_OPT: call void @llvm.trap() [[ATTR0:#[0-9]+]]
|
|
|
|
// NOTRAPFN-LABEL: define hidden swiftcc void @"$s13trap_function18checkClangImporteryyF"
|
|
// NOTRAPFN: call void @llvm.trap(){{$}}
|
|
func checkClangImporter() {
|
|
ackbar()
|
|
}
|
|
|
|
// TRAPFN: attributes [[ATTR0]] = { {{.*}}"trap-func-name"="oopsie" }
|
|
// TRAPFN_OPT: attributes [[ATTR0]] = { {{.*}}"trap-func-name"="oopsie" }
|
|
// NOTRAPFN-NOT: attributes {{.*}} = { {{.*}}"trap-func-name"="oopsie" }
|