mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This change PCMacro and PlaygroundTransform to return an a moduleID and fileID in addition to the source location information. The Frontend has been changed to run PCMacro and PlaygroundTransform on all input files instead of the main file only. The tests have been updated to conform to these changes with an addition of module and file ID specific tests. The Playgrounds related tests were adjusted to make a module out of the stub interface files since those files should not have PCMacro and PlaygroundTransform applied to them. rdar://problem/50821146
22 lines
1.1 KiB
Swift
22 lines
1.1 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: cp %s %t/main.swift
|
|
// RUN: %target-build-swift -force-single-frontend-invocation -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/PCMacroRuntime.swift %S/Inputs/SilentPlaygroundsRuntime.swift
|
|
// RUN: %target-build-swift -Xfrontend -pc-macro -o %t/test -I=%t %t/PlaygroundSupport.o %S/Inputs/PlaygroundModuleAndFileIDs.swift %t/main.swift
|
|
// RUN: %target-codesign %t/test
|
|
// RUN: %target-run %t/test | %FileCheck %s
|
|
// RUN: %target-build-swift -Xfrontend -pc-macro -Xfrontend -playground -o %t/test2 -I=%t %t/PlaygroundSupport.o %S/Inputs/PlaygroundModuleAndFileIDs.swift %t/main.swift
|
|
// RUN: %target-codesign %t/test2
|
|
// RUN: %target-run %t/test2 | %FileCheck %s
|
|
|
|
// REQUIRES: executable_test
|
|
|
|
// FIXME: rdar://problem/30234450 PCMacro tests fail on linux in optimized mode
|
|
// UNSUPPORTED: OS=linux-gnu
|
|
|
|
import PlaygroundSupport
|
|
|
|
#sourceLocation(file: "main.swift", line: 8)
|
|
var a = true
|
|
// CHECK: [1:2] [8:1-8:13] pc before
|
|
// CHECK-NEXT: [1:2] [8:1-8:13] pc after
|