File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -849,10 +849,12 @@ internal func constant_vprintf_backend(
849849@_semantics ( " oslog.requires_constant_arguments " )
850850@inlinable
851851@_transparent
852+ @_alwaysEmitIntoClient
852853@_optimize ( none)
853854public func constant_vprintf( _ message: ConstantVPrintFMessage ) {
854855 let formatString = message. interpolation. formatString
855856 let argumentClosures = message. interpolation. arguments. argumentClosures
857+ if Bool ( _builtinBooleanLiteral: Builtin . ifdef_PRINT_DISABLED ( ) ) { return }
856858 let formatStringPointer = _getGlobalStringTablePointer ( formatString)
857859 constant_vprintf_backend (
858860 fmt: formatStringPointer,
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: %target-build-swift %s -I %t -o %t/a1.out -O && %target-run %t/a1.out | %FileCheck %s
3+ // RUN: %target-build-swift %s -D PRINT_DISABLED -I %t -o %t/a2.out -O && %target-run %t/a2.out | %FileCheck %s --check-prefix CHECK-PRINT-DISABLED --allow-empty
4+
5+ // REQUIRES: executable_test
6+ // REQUIRES: stdlib_static_print
7+
8+ let x = 42
9+ let s = " ABCDE "
10+ constant_vprintf ( " Hello World \( 5 ) \( x) \( s) " )
11+
12+ // CHECK: Hello World 5 42 ABCDE
13+ // CHECK-PRINT-DISABLED-NOT: Hello World
You can’t perform that action at this time.
0 commit comments