Skip to content

[nfc] Add tests for witness table size optimizations. #34995

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
Feb 1, 2021

Conversation

zoecarver
Copy link
Contributor

No description provided.


// CHECK-DAG: @"$sBi8_WV" = external global i8*, align 8
// CHECK-DAG: @"$sSo5EmptyVMn" = linkonce_odr hidden constant <{ i32, i32, i32, i32, i32, i32, i32, i32 }> <{ i32 131089, i32 trunc (i64 sub (i64 ptrtoint (<{ i32, i32, i32 }>* @"$sSoMXM" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i32, i32, i32, i32, i32, i32, i32, i32 }>, <{ i32, i32, i32, i32, i32, i32, i32, i32 }>* @"$sSo5EmptyVMn", i32 0, i32 1) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @5 to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i32, i32, i32, i32, i32, i32, i32, i32 }>, <{ i32, i32, i32, i32, i32, i32, i32, i32 }>* @"$sSo5EmptyVMn", i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (%swift.metadata_response (i64)* @"$sSo5EmptyVMa" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i32, i32, i32, i32, i32, i32, i32, i32 }>, <{ i32, i32, i32, i32, i32, i32, i32, i32 }>* @"$sSo5EmptyVMn", i32 0, i32 3) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ({ i32, i32, i16, i16, i32 }* @"$sSo5EmptyVMF" to i64), i64 ptrtoint (i32* getelementptr inbounds (<{ i32, i32, i32, i32, i32, i32, i32, i32 }>, <{ i32, i32, i32, i32, i32, i32, i32, i32 }>* @"$sSo5EmptyVMn", i32 0, i32 4) to i64)) to i32), i32 0, i32 2, i32 0 }>, section "__TEXT,__const", align 4
// CHECK-DAG: @"$sSo5EmptyVMf" = linkonce_odr hidden constant <{ i8**, i64, <{ i32, i32, i32, i32, i32, i32, i32, i32 }>* }> <{ i8** @"$sBi8_WV", i64 512, <{ i32, i32, i32, i32, i32, i32, i32, i32 }>* @"$sSo5EmptyVMn" }>, align 8
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely sure that this is the correct (or portable) way to test this. It would probably be sufficient just to test line 9, 14, and 19.

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test Linux.

@zoecarver zoecarver force-pushed the tests/witness-table-opts branch from 24d32ac to 2530b95 Compare January 13, 2021 19:56
@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test.

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test macOS.

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test Windows.

@zoecarver
Copy link
Contributor Author

Forgot to save the errors 😕

@swift-ci please smoke test Linux.

@gribozavr gribozavr added c++ interop Feature: Interoperability with C++ code health labels Jan 20, 2021
@zoecarver zoecarver force-pushed the tests/witness-table-opts branch from 2530b95 to 6ec369a Compare January 31, 2021 21:15
@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test.

@zoecarver zoecarver force-pushed the tests/witness-table-opts branch from 6ec369a to 8c0b8eb Compare January 31, 2021 21:17
@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test.

@zoecarver
Copy link
Contributor Author

@swift-ci please test Windows.

@zoecarver
Copy link
Contributor Author

@swift-ci please test Windows platform.

@zoecarver zoecarver force-pushed the tests/witness-table-opts branch from 8c0b8eb to ec2e130 Compare January 31, 2021 23:57
// that have the appropriate size/shape (for example, { i8 x 4 } -> i32).

// These witness tables look very differnt on Windows so it doesn't make sense
// to test them in the same file.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As the comment says, the witness tables appear fairly different on Windows, so I don't think it's feasible to test both platforms in the same file. If anyone disagrees, let me know and I'll investigate further / update the test.

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test.

@zoecarver zoecarver merged commit 60e8c8d into swiftlang:main Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++ code health
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants