Files
swift-mirror/test/Macros/expand_on_imported_objc.swift
Eric Miotto 89c3f47c41 Require build of StringProcessing for some Macros tests (#84126)
Also mark them as not executable, since they don't call `%target-run`.
    
This is needed in back deployment configurations where StringProcessing is
not supported.
    
Addresses rdar://159635486
2025-09-05 22:34:12 -07:00

31 lines
1.7 KiB
Swift

// REQUIRES: swift_swift_parser, objc_interop, concurrency, string_processing
// REQUIRES: swift_feature_MacrosOnImports
// REQUIRES: OS=macosx
// RUN: %empty-directory(%t)
// RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath -swift-version 5
// Build the macro library to give us access to AddAsync.
// RUN: %target-swift-frontend -swift-version 5 -emit-module -o %t/macro_library.swiftmodule %S/Inputs/macro_library.swift -module-name macro_library -load-plugin-library %t/%target-library-name(MacroDefinition)
// Diagnostics testing
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify -swift-version 5 -enable-experimental-feature MacrosOnImports -load-plugin-library %t/%target-library-name(MacroDefinition) -module-name ModuleUser %s -I %t -DTEST_DIAGNOSTICS
// Emit IR just to make sure nothing else fails.
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-ir -swift-version 5 -g -enable-experimental-feature MacrosOnImports -load-plugin-library %t/%target-library-name(MacroDefinition) -module-name ModuleUser %s -I %t | %FileCheck %s
import CompletionHandlerGlobals
import macro_library
@available(SwiftStdlib 5.1, *)
func testAll(x: Double, y: Double, computer: Computer, untypedComputer: AnyObject) async {
let _: Double = await computer.multiply(x, by: y)
#if TEST_DIAGNOSTICS
// expected-error@+1{{missing argument for parameter 'afterDone' in call}}
untypedComputer.multiply(x, by: y)
#endif
}
// CHECK: define linkonce_odr hidden swifttailcc void @"$sSo8ComputerC8multiply_2byS2d_SdtYaF"