@@ -8583,6 +8583,80 @@ fileprivate struct TaskConstructionTests: CoreBasedTests {
85838583 }
85848584 }
85858585
8586+ @Test(.requireSDKs(.host))
8587+ func framePointerControl() async throws {
8588+ try await withTemporaryDirectory { tmpDir in
8589+ let testProject = try await TestProject(
8590+ "aProject",
8591+ sourceRoot: tmpDir,
8592+ groupTree: TestGroup(
8593+ "SomeFiles", path: "Sources",
8594+ children: [
8595+ TestFile("SourceFile.c"),
8596+ TestFile("Source.swift"),
8597+ ]),
8598+ buildConfigurations: [
8599+ TestBuildConfiguration("Debug", buildSettings: [
8600+ "SWIFT_EXEC": swiftCompilerPath.str,
8601+ "SWIFT_VERSION": swiftVersion,
8602+ ])
8603+ ],
8604+ targets: [
8605+ TestStandardTarget(
8606+ "Library",
8607+ type: .dynamicLibrary,
8608+ buildConfigurations: [
8609+ TestBuildConfiguration("Debug")
8610+ ],
8611+ buildPhases: [
8612+ TestSourcesBuildPhase([
8613+ "SourceFile.c",
8614+ "Source.swift"
8615+ ])
8616+ ]
8617+ )]
8618+ )
8619+
8620+ let fs = PseudoFS()
8621+
8622+ let core = try await getCore()
8623+ let tester = try TaskConstructionTester(core, testProject)
8624+
8625+ await tester.checkBuild(BuildParameters(configuration: "Debug", overrides: [:]), runDestination: .host, fs: fs) { results in
8626+ results.checkTask(.matchRuleType("CompileC")) { task in
8627+ task.checkCommandLineDoesNotContain("-fomit-frame-pointer")
8628+ task.checkCommandLineDoesNotContain("-fno-omit-frame-pointer")
8629+ }
8630+ results.checkTask(.matchRuleType("SwiftDriver Compilation")) { task in
8631+ task.checkCommandLineDoesNotContain("-fomit-frame-pointer")
8632+ task.checkCommandLineDoesNotContain("-fno-omit-frame-pointer")
8633+ }
8634+ }
8635+
8636+ await tester.checkBuild(BuildParameters(configuration: "Debug", overrides: ["CLANG_OMIT_FRAME_POINTERS": "YES", "SWIFT_OMIT_FRAME_POINTERS": "YES"]), runDestination: .host, fs: fs) { results in
8637+ results.checkTask(.matchRuleType("CompileC")) { task in
8638+ task.checkCommandLineContains(["-fomit-frame-pointer"])
8639+ task.checkCommandLineDoesNotContain("-fno-omit-frame-pointer")
8640+ }
8641+ results.checkTask(.matchRuleType("SwiftDriver Compilation")) { task in
8642+ task.checkCommandLineContains(["-Xcc", "-fomit-frame-pointer"])
8643+ task.checkCommandLineDoesNotContain("-fno-omit-frame-pointer")
8644+ }
8645+ }
8646+
8647+ await tester.checkBuild(BuildParameters(configuration: "Debug", overrides: ["CLANG_OMIT_FRAME_POINTERS": "NO", "SWIFT_OMIT_FRAME_POINTERS": "NO"]), runDestination: .host, fs: fs) { results in
8648+ results.checkTask(.matchRuleType("CompileC")) { task in
8649+ task.checkCommandLineDoesNotContain("-fomit-frame-pointer")
8650+ task.checkCommandLineContains(["-fno-omit-frame-pointer"])
8651+ }
8652+ results.checkTask(.matchRuleType("SwiftDriver Compilation")) { task in
8653+ task.checkCommandLineDoesNotContain("-fomit-frame-pointer")
8654+ task.checkCommandLineContains(["-Xcc", "-fno-omit-frame-pointer"])
8655+ }
8656+ }
8657+ }
8658+ }
8659+
85868660 @Test(.requireSDKs(.macOS))
85878661 func warningSuppression() async throws {
85888662 try await withTemporaryDirectory { tmpDir in
0 commit comments