Files
swift-mirror/test/ClangImporter/pch-loaded-from-header-name.swift
Ben Barham 9b8f7c30d1 [ClangImporter] Probe for a PCH when the header is missing
The default for `ProbePrecompiled` was changed in rebranch. Set it back
to `true` to avoid breaking existing clients.

Resolves rdar://106966024.
2023-03-20 15:49:13 -07:00

24 lines
702 B
Swift

// REQUIRES: objc_interop
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/pch)
// RUN: split-file %s %t
// Precompile a header into a separate directory and check that it can be
// loaded via its original header name, even if the header isn't adjacent
// to the PCH. This used to be the default, but was changed in clang 16
// (see `CreateInvocationOptions::ProbePrecompiled`).
// RUN: %target-swift-frontend -emit-pch %t/header.h -o %t/pch/header.h.pch
// RUN: %target-swift-frontend -verify -typecheck %t/use.swift -Xcc -include -Xcc %t/pch/header.h -import-objc-header %t/empty.h
//--- empty.h
//--- header.h
void headerFunc();
//--- use.swift
func useHeaderFunc() {
headerFunc()
}