Skip to content

Unify layout for C++ interop tests #30823

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
Apr 6, 2020
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
10 changes: 0 additions & 10 deletions test/ClangImporter/Inputs/custom-modules/module.map
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ module script {
header "script.h"
}

module AccessSpecifiers {
header "AccessSpecifiers.h"
export *
}

module AvailabilityExtras {
header "AvailabilityExtras.h"
export *
Expand Down Expand Up @@ -89,11 +84,6 @@ module LinkMusket {
link framework "Barrel"
}

module MemoryLayout {
header "MemoryLayout.h"
export *
}

module MissingHeader {
header "this-header-does-not-exist.h"
}
Expand Down
7 changes: 0 additions & 7 deletions test/CxxInterop/class/Inputs/module.modulemap

This file was deleted.

10 changes: 9 additions & 1 deletion test/Interop/Cxx/class/Inputs/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
module CxxMemberVariables {
module AccessSpecifiers {
header "access-specifiers.h"
}

module MemoryLayout {
header "memory-layout.h"
}

module MemberVariables {
header "member-variables.h"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Test module interface produced for C++ access specifiers test.
// In particular, we don't want any of the private members showing up here.

// RUN: %target-swift-ide-test -print-module -module-to-print=AccessSpecifiers -I %S/Inputs/ -source-filename=x -enable-cxx-interop | %FileCheck %s
// RUN: %target-swift-ide-test -print-module -module-to-print=AccessSpecifiers -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s

// CHECK: struct PublicPrivate {
// CHECK-NEXT: typealias PublicTypedef = Int32
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Test that C++ access specifiers are honored, i.e. private members aren't
// imported.

// RUN: %target-typecheck-verify-swift -verify-ignore-unknown -I %S/Inputs/custom-modules/ -enable-cxx-interop
// RUN: %target-typecheck-verify-swift -verify-ignore-unknown -I %S/Inputs -enable-cxx-interop

import AccessSpecifiers

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-ide-test -print-module -module-to-print=CxxMemberVariables -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s
// RUN: %target-swift-ide-test -print-module -module-to-print=MemberVariables -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s

// CHECK: struct MyClass {
// CHECK-NEXT: var const_member: Int32 { get }
Expand Down
2 changes: 1 addition & 1 deletion test/Interop/Cxx/class/member-variables-typechecker.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %target-typecheck-verify-swift -I %S/Inputs -enable-cxx-interop

import CxxMemberVariables
import MemberVariables

var s = MyClass()
s.const_member = 42 // expected-error {{cannot assign to property: 'const_member' setter is inaccessible}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -I %S/Inputs/custom-modules/ -o %t/class_layout -Xfrontend -enable-cxx-interop
// RUN: %target-build-swift %s -I %S/Inputs -o %t/class_layout -Xfrontend -enable-cxx-interop
// RUN: %target-codesign %t/class_layout
// RUN: %target-run %t/class_layout 2&>1
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -I %S/Inputs/custom-modules/ -enable-cxx-interop -emit-ir -o - %s | %FileCheck %s
// RUN: %target-swift-frontend -I %S/Inputs -enable-cxx-interop -emit-ir -o - %s | %FileCheck %s

import MemoryLayout

Expand Down