Files
swift-mirror/test/ClangImporter/InternalBridgingHeader/implementation_only_checking.swift
Henrik G. Olsson cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00

22 lines
1.1 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: mkdir -p %t/tmp
// Test with the normal bridging header.
// RUN: %target-typecheck-verify-swift -verify-ignore-unrelated -internal-import-bridging-header %S/../Inputs/c-bridging-header.h -sdk %clang-importer-sdk -verify-ignore-unknown
// RUN: not %target-swift-frontend -typecheck -internal-import-bridging-header %S/../Inputs/c-bridging-header.h -sdk %clang-importer-sdk %s 2>&1 | %FileCheck %s
// Test with a precompiled bridging header.
// RUN: %target-swift-frontend -emit-pch -o %t/c-bridging-header.pch %S/../Inputs/c-bridging-header.h -sdk %clang-importer-sdk
// RUN: %target-typecheck-verify-swift -verify-ignore-unrelated -internal-import-bridging-header %t/c-bridging-header.pch -sdk %clang-importer-sdk -verify-ignore-unknown
@inlinable
public func f() -> Any {
return red
// expected-error@-1{{var 'red' is internal and cannot be referenced from an '@inlinable' function}}
// expected-warning@-2{{getter for var 'red' is internal and should not be referenced from an '@inlinable' function}}
}
// CHECK: var 'red' imported as 'internal' from bridging header