mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Extend the module trace format with a field indicating whether a given module, or any module it depends on, was compiled with strict memory safety enabled. This separate output from the compiler can be used as part of an audit to determine what parts of Swift programs are built with strict memory safety checking enabled.
22 lines
1020 B
Swift
22 lines
1020 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module-path %t/unsafe_swift_decls.swiftmodule %S/Inputs/unsafe_swift_decls.swift -enable-experimental-feature AllowUnsafeAttribute
|
|
// RUN: %target-swift-frontend -emit-module-path %t/safe_swift_decls.swiftmodule %S/Inputs/safe_swift_decls.swift -enable-experimental-feature AllowUnsafeAttribute -enable-experimental-feature WarnUnsafe
|
|
|
|
// RUN: %target-typecheck-verify-swift -enable-experimental-feature AllowUnsafeAttribute -enable-experimental-feature WarnUnsafe -I %S/Inputs -I %t -emit-loaded-module-trace-path %t/unsafe.trace
|
|
|
|
// RUN: %FileCheck -check-prefix TRACE %s < %t/unsafe.trace
|
|
|
|
// REQUIRES: swift_feature_AllowUnsafeAttribute
|
|
// REQUIRES: swift_feature_WarnUnsafe
|
|
|
|
import unsafe_decls
|
|
import unsafe_swift_decls
|
|
import safe_swift_decls
|
|
|
|
// Module-level indication
|
|
// TRACE: "strictMemorySafety":true
|
|
|
|
// Dependencies
|
|
// TRACE: "safe_swift_decls"{{.*}}"strictMemorySafety":true
|
|
// TRACE: "unsafe_swift_decls"{{.*}}"strictMemorySafety":false
|