Skip to content

[ClangImporter] Adjust tests after Clang changes for __attribute__((pure)) #75055

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion test/Interop/Cxx/class/inheritance/Inputs/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct Base {
return i * 2;
}

void pure() const __attribute__((pure)) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the const might not be a problem here. I think the const in the clang change might refer to the attribute: https://clang.llvm.org/docs/AttributeReference.html#const

That being said, I am also OK leaving the PR as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're right! Let me bring back const.

int pure() __attribute__((pure)) { return 123; }

inline int sameMethodNameSameSignature() const {
return 42;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// CHECK-NEXT: mutating func swiftRenamed(input i: Int32) -> Int32
// CHECK-NEXT: @available(swift, obsoleted: 3, renamed: "swiftRenamed(input:)")
// CHECK-NEXT: mutating func renamed(_ i: Int32) -> Int32
// CHECK-NEXT: @_effects(readonly) func pure()
// CHECK-NEXT: @_effects(readonly) mutating func pure() -> Int32
// CHECK-NEXT: @discardableResult
// CHECK-NEXT: func sameMethodNameSameSignature() -> Int32
// CHECK-NEXT: @discardableResult
Expand Down Expand Up @@ -65,7 +65,7 @@
// CHECK-NEXT: mutating func swiftRenamed(input i: Int32) -> Int32
// CHECK-NEXT: @available(swift, obsoleted: 3, renamed: "swiftRenamed(input:)")
// CHECK-NEXT: mutating func renamed(_ i: Int32) -> Int32
// CHECK-NEXT: @_effects(readonly) func pure()
// CHECK-NEXT: @_effects(readonly) mutating func pure() -> Int32
// CHECK-NEXT: @discardableResult
// CHECK-NEXT: func sameMethodDifferentSignature() -> Int32
// CHECK-NEXT: @discardableResult
Expand Down Expand Up @@ -96,7 +96,7 @@
// CHECK-NEXT: mutating func swiftRenamed(input i: Int32) -> Int32
// CHECK-NEXT: @available(swift, obsoleted: 3, renamed: "swiftRenamed(input:)")
// CHECK-NEXT: mutating func renamed(_ i: Int32) -> Int32
// CHECK-NEXT: @_effects(readonly) func pure()
// CHECK-NEXT: @_effects(readonly) mutating func pure() -> Int32
// CHECK-NEXT: @discardableResult
// CHECK-NEXT: func sameMethodDifferentSignature() -> Int32
// CHECK-NEXT: @discardableResult
Expand Down