File tree Expand file tree Collapse file tree 2 files changed +6
-23
lines changed Expand file tree Collapse file tree 2 files changed +6
-23
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift -I %swift-host-lib-dir -L %swift-host-lib-dir -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath
3
3
// RUNx: %target-swift-frontend -dump-ast -enable-experimental-feature Macros -load-plugin-library %t/%target-library-name(MacroDefinition) -I %swift-host-lib-dir %s -module-name MacroUser 2>&1 | %FileCheck --check-prefix CHECK-AST %s
4
- // RUN: %target-build-swift -enable-experimental-feature Macros -load-plugin-library %t/%target-library-name(MacroDefinition) -I %swift-host-lib-dir -L %swift-host-lib-dir %s -o %t/main -module-name MacroUser
4
+ // RUN: %target-build-swift -enable-experimental-feature Macros -enable-experimental-feature Macros - load-plugin-library %t/%target-library-name(MacroDefinition) -I %swift-host-lib-dir -L %swift-host-lib-dir %s -o %t/main -module-name MacroUser
5
5
// RUN: %target-run %t/main | %FileCheck %s
6
6
// REQUIRES: executable_test
7
7
10
10
11
11
macro customFileID: String = MacroDefinition. FileIDMacro
12
12
macro stringify< T> ( _ value: T ) -> ( T , String ) = MacroDefinition . StringifyMacro
13
+ macro fileID< T: _ExpressibleByStringLitera > : T = MacroDefinition. FileIDMacro
13
14
14
15
func testFileID( a: Int , b: Int ) {
15
16
// CHECK: MacroUser/macro_external_exec.swift
16
17
print ( " Result is \( #customFileID) " )
18
+
19
+ // CHECK: Builtin result is MacroUser/macro_external_exec.swift
20
+ // CHECK-AST: macro_expansion_expr type='String'{{.*}}name=line
21
+ print( " Builtin result is \( #fileID) " )
17
22
}
18
23
19
24
testFileID ( a: 1 , b: 2 )
You can’t perform that action at this time.
0 commit comments