Skip to content

[NFC] Give test input header a meaningful name. #32386

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 17, 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
18 changes: 18 additions & 0 deletions test/SILOptimizer/Inputs/CXXTypesWithUserProvidedDestructor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef TEST_SIL_OPTIMIZER_CXX_WITH_CUSTOM_DESTRUCTOR_H
#define TEST_SIL_OPTIMIZER_CXX_WITH_CUSTOM_DESTRUCTOR_H

struct HasUserProvidedDestructor {
int x;
~HasUserProvidedDestructor() {}
};

struct Loadable {
int x;
};

struct HasMemberWithUserProvidedDestructor {
Loadable y;
~HasMemberWithUserProvidedDestructor() {}
};

#endif // TEST_SIL_OPTIMIZER_CXX_WITH_CUSTOM_DESTRUCTOR_H
18 changes: 0 additions & 18 deletions test/SILOptimizer/Inputs/foo.h

This file was deleted.

4 changes: 2 additions & 2 deletions test/SILOptimizer/Inputs/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Foo {
header "foo.h"
module CXXTypesWithUserProvidedDestructor {
header "CXXTypesWithUserProvidedDestructor.h"
}
18 changes: 9 additions & 9 deletions test/SILOptimizer/dont_broaden_cxx_address_only.sil
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ sil_stage canonical
import Builtin
import Swift
import SwiftShims
import Foo
import CXXTypesWithUserProvidedDestructor

// Make sure we don't try to create a struct here. Foo is not loadable, even
// Make sure we don't try to create a struct here. HasUserProvidedDestructor is not loadable, even
// though it's only property is.
// CHECK-LABEL: @test_foo
// CHECK: bb0
Expand All @@ -16,16 +16,16 @@ import Foo
// CHECK-NEXT: tuple
// CHECK-NEXT: return
// CHECK-LABEL: end sil function 'test_foo'
sil shared [transparent] [serializable] [ossa] @test_foo : $@convention(method) (Int32, @thin Foo.Type) -> @out Foo {
bb0(%0 : $*Foo, %1 : $Int32, %2 : $@thin Foo.Type):
%3 = struct_element_addr %0 : $*Foo, #Foo.x
sil shared [transparent] [serializable] [ossa] @test_foo : $@convention(method) (Int32, @thin HasUserProvidedDestructor.Type) -> @out HasUserProvidedDestructor {
bb0(%0 : $*HasUserProvidedDestructor, %1 : $Int32, %2 : $@thin HasUserProvidedDestructor.Type):
%3 = struct_element_addr %0 : $*HasUserProvidedDestructor, #HasUserProvidedDestructor.x
store %1 to [trivial] %3 : $*Int32
%5 = tuple ()
return %5 : $()
}

// Make sure we create a struct for the first (loadable) type but not the second
// type (Bar).
// type (HasMemberWithUserProvidedDestructor).
// CHECK-LABEL: @test_bar
// CHECK: bb0
// CHECK-NEXT: [[E:%.*]] = struct_element_addr
Expand All @@ -34,9 +34,9 @@ bb0(%0 : $*Foo, %1 : $Int32, %2 : $@thin Foo.Type):
// CHECK-NEXT: tuple
// CHECK-NEXT: return
// CHECK-LABEL: end sil function 'test_bar'
sil shared [transparent] [serializable] [ossa] @test_bar : $@convention(method) (Int32, @thin Bar.Type) -> @out Bar {
bb0(%0 : $*Bar, %1 : $Int32, %2 : $@thin Bar.Type):
%3 = struct_element_addr %0 : $*Bar, #Bar.y
sil shared [transparent] [serializable] [ossa] @test_bar : $@convention(method) (Int32, @thin HasMemberWithUserProvidedDestructor.Type) -> @out HasMemberWithUserProvidedDestructor {
bb0(%0 : $*HasMemberWithUserProvidedDestructor, %1 : $Int32, %2 : $@thin HasMemberWithUserProvidedDestructor.Type):
%3 = struct_element_addr %0 : $*HasMemberWithUserProvidedDestructor, #HasMemberWithUserProvidedDestructor.y
%3a = struct_element_addr %3 : $*Loadable, #Loadable.x
store %1 to [trivial] %3a : $*Int32
%5 = tuple ()
Expand Down