Skip to content

[cxx-interop] Disable test with an older runtime #82299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions test/Interop/Cxx/class/Inputs/simple-structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,38 +52,4 @@ struct Outer {
Outer() : privStruct(1, 2, 3, 4, 5, 6), publStruct(7, 8, 9, 10, 11, 12) {}
};

struct ImmortalFRT {
private:
int priv = 1;

public:
int publ = 2;
} __attribute__((swift_attr("import_reference")))
__attribute__((swift_attr("retain:immortal")))
__attribute__((swift_attr("release:immortal")));

struct FRTCustomStringConvertible {
public:
private:
int priv = 1;

public:
int publ = 2;
} __attribute__((swift_attr("import_reference")))
__attribute__((swift_attr("retain:immortal")))
__attribute__((swift_attr("release:immortal")));

struct FRType {
private:
int priv = 1;

public:
int publ = 2;
} __attribute__((swift_attr("import_reference")))
__attribute__((swift_attr("retain:retain")))
__attribute__((swift_attr("release:release")));

void retain(FRType *v) {};
void release(FRType *v) {};

#endif
35 changes: 1 addition & 34 deletions test/Interop/Cxx/class/print-simple-structs.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// RUN: %target-run-simple-swift(-cxx-interoperability-mode=default -Xfrontend -disable-availability-checking -I %S/Inputs) | %FileCheck %s
// RUN: %target-run-simple-swift(-cxx-interoperability-mode=default -I %S/Inputs) | %FileCheck %s

// REQUIRES: executable_test
// Metadata for foreign reference types is not supported on Windows.
// UNSUPPORTED: OS=windows-msvc

import SimpleStructs

Expand All @@ -26,28 +24,6 @@ func printCxxStructNested() {
print(s)
}

func printCxxImmortalFRT() {
let s = ImmortalFRT()
print(s)
}

extension FRTCustomStringConvertible : CustomStringConvertible {
public var description: String {
return "FRTCustomStringConvertible(publ: \(publ))"
}
}

func printCxxFRTCustomStringConvertible() {
let s = FRTCustomStringConvertible()
print(s)
}

func printCxxFRType() {
let s = FRType()
print(s)
}


printCxxStructPrivateFields()
// CHECK: HasPrivateFieldsOnly()

Expand All @@ -59,12 +35,3 @@ printCxxStructPrivatePublicProtectedFields()

printCxxStructNested()
// CHECK: Outer(publStruct: {{.*}}.HasPrivatePublicProtectedFields(publ1: 8, publ2: 12))

printCxxImmortalFRT()
// CHECK: ImmortalFRT()

printCxxFRTCustomStringConvertible()
// CHECK: FRTCustomStringConvertible(publ: 2)

printCxxFRType()
// CHECK: FRType()
5 changes: 5 additions & 0 deletions test/Interop/Cxx/foreign-reference/Inputs/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,8 @@ module FunctionsAndMethodsReturningFRT {
header "cxx-functions-and-methods-returning-frt.h"
requires cplusplus
}

module Printed {
header "printed.h"
requires cplusplus
}
34 changes: 34 additions & 0 deletions test/Interop/Cxx/foreign-reference/Inputs/printed.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
struct ImmortalFRT {
private:
int priv = 1;

public:
int publ = 2;
} __attribute__((swift_attr("import_reference")))
__attribute__((swift_attr("retain:immortal")))
__attribute__((swift_attr("release:immortal")));

struct FRTCustomStringConvertible {
public:
private:
int priv = 1;

public:
int publ = 2;
} __attribute__((swift_attr("import_reference")))
__attribute__((swift_attr("retain:immortal")))
__attribute__((swift_attr("release:immortal")));

struct FRType {
private:
int priv = 1;

public:
int publ = 2;
} __attribute__((swift_attr("import_reference")))
__attribute__((swift_attr("retain:retain")))
__attribute__((swift_attr("release:release")));

void retain(FRType *v) {};
void release(FRType *v) {};

42 changes: 42 additions & 0 deletions test/Interop/Cxx/foreign-reference/print-reference.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// RUN: %target-run-simple-swift(-cxx-interoperability-mode=default -Xfrontend -disable-availability-checking -I %S/Inputs) | %FileCheck %s

// REQUIRES: executable_test

// Metadata for foreign reference types is not supported on Windows.
// UNSUPPORTED: OS=windows-msvc

// Temporarily disable when running with an older runtime (rdar://153205860)
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

import Printed

func printCxxImmortalFRT() {
let s = ImmortalFRT()
print(s)
}

extension FRTCustomStringConvertible : CustomStringConvertible {
public var description: String {
return "FRTCustomStringConvertible(publ: \(publ))"
}
}

func printCxxFRTCustomStringConvertible() {
let s = FRTCustomStringConvertible()
print(s)
}

func printCxxFRType() {
let s = FRType()
print(s)
}

printCxxImmortalFRT()
// CHECK: ImmortalFRT()

printCxxFRTCustomStringConvertible()
// CHECK: FRTCustomStringConvertible(publ: 2)

printCxxFRType()
// CHECK: FRType()