Files
swift-mirror/test/ClangImporter/system-search-paths.swift
Ian Anderson cdb42c3535 [ClangImporter] clang's -iframework comes before builtin usr/local/include, but Swift's -Fsystem comes after
When Swift passes search paths to clang, it does so directly into the HeaderSearch. That means that those paths get ordered inconsistently compared to the equivalent clang flag, and causes inconsistencies when building clang modules with clang and with Swift. Instead of touching the HeaderSearch directly, pass Swift search paths as driver flags, just do them after the -Xcc ones.

Swift doesn't have a way to pass a search path to clang as -isystem, only as -I which usually isn't the right flag. Add an -Isystem Swift flag so that those paths can be passed to clang as -isystem.

rdar://93951328
2024-12-23 22:15:52 -08:00

14 lines
948 B
Swift

// The clang modules trigger a warning, make sure that -Fsystem/-Isystem have the effect of importing as system, which will suppress the warning.
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -F %S/Inputs/systemsearchpaths/Frameworks -I %S/Inputs/systemsearchpaths/include -module-cache-path %t/mcp1 %s 2> %t/stderr-as-user.txt
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -Fsystem %S/Inputs/systemsearchpaths/Frameworks -Isystem %S/Inputs/systemsearchpaths/include -module-cache-path %t/mcp2 %s 2> %t/stderr-as-system.txt
// RUN: %FileCheck -input-file=%t/stderr-as-user.txt %s -check-prefix=CHECK-USER
// RUN: %FileCheck -input-file=%t/stderr-as-system.txt %s -check-prefix=CHECK-SYSTEM --allow-empty
// CHECK-USER-COUNT-2: non-void function does not return a value
// CHECK-SYSTEM-NOT: non-void function does not return a value
import FWModule
import Module