-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[test] Explicitly sign chars to match expectations #1103
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`char` is not always signed by default. In fact, the signedness of the `char` datatype in C is undefined. That means that on some architectures, the `c_layout.sil` test fails, because it expects the IR for `char chareth(char a);` to use `signedext`, whereas some architectures treat these types as unsigned, and thus `zeroext` is used. In order to ensure identical signedness on all platforms the tests run on, explicitly specify the signedness using the compiler flag `-fsigned-char`.
It's probably better to fix the tests so that they test for the target platform's expected char signedness. |
Ah, good call. In that case, each of the Linux arm targets should probably include their own set of conditional tests. Android armv7 isn't ready to be reviewed yet, so I'll add a set of tests to that project and close this for now. Thanks!! |
modocache
added a commit
to SwiftAndroid/swift
that referenced
this pull request
Feb 9, 2016
`char` is not always signed by default. In fact, the signedness of the `char` datatype in C is undefined. That means that on some architectures, the `c_layout.sil` test fails, because it expects the IR for `char chareth(char a);` to use `signedext`, whereas some architectures treat these types as unsigned, and thus `zeroext` is used. In order to ensure identical signedness on all platforms the tests run on, explicitly specify the signedness using the compiler flag `-fsigned-char`. It would be better to test the signedness for each platform, as suggested in swiftlang#1103. This is an interim solution.
modocache
added a commit
to SwiftAndroid/swift
that referenced
this pull request
Feb 19, 2016
`char` is not always signed by default. In fact, the signedness of the `char` datatype in C is undefined. That means that on some architectures, the `c_layout.sil` test fails, because it expects the IR for `char chareth(char a);` to use `signedext`, whereas some architectures treat these types as unsigned, and thus `zeroext` is used. In order to ensure identical signedness on all platforms the tests run on, explicitly specify the signedness using the compiler flag `-fsigned-char`. It would be better to test the signedness for each platform, as suggested in swiftlang#1103. This is an interim solution.
modocache
added a commit
to SwiftAndroid/swift
that referenced
this pull request
Feb 22, 2016
`char` is not always signed by default. In fact, the signedness of the `char` datatype in C is undefined. That means that on some architectures, the `c_layout.sil` test fails, because it expects the IR for `char chareth(char a);` to use `signedext`, whereas some architectures treat these types as unsigned, and thus `zeroext` is used. In order to ensure identical signedness on all platforms the tests run on, explicitly specify the signedness using the compiler flag `-fsigned-char`. It would be better to test the signedness for each platform, as suggested in swiftlang#1103. This is an interim solution.
modocache
added a commit
to SwiftAndroid/swift
that referenced
this pull request
Feb 23, 2016
`char` is not always signed by default. In fact, the signedness of the `char` datatype in C is undefined. That means that on some architectures, the `c_layout.sil` test fails, because it expects the IR for `char chareth(char a);` to use `signedext`, whereas some architectures treat these types as unsigned, and thus `zeroext` is used. In order to ensure identical signedness on all platforms the tests run on, explicitly specify the signedness using the compiler flag `-fsigned-char`. It would be better to test the signedness for each platform, as suggested in swiftlang#1103. This is an interim solution.
modocache
added a commit
to SwiftAndroid/swift
that referenced
this pull request
Feb 25, 2016
`char` is not always signed by default. In fact, the signedness of the `char` datatype in C is undefined. That means that on some architectures, the `c_layout.sil` test fails, because it expects the IR for `char chareth(char a);` to use `signedext`, whereas some architectures treat these types as unsigned, and thus `zeroext` is used. In order to ensure identical signedness on all platforms the tests run on, explicitly specify the signedness using the compiler flag `-fsigned-char`. It would be better to test the signedness for each platform, as suggested in swiftlang#1103. This is an interim solution.
MaxDesiatov
pushed a commit
to MaxDesiatov/swift
that referenced
this pull request
Jun 5, 2020
[pull] swiftwasm from master
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
char
is not always signed by default. In fact, the signedness of thechar
datatype in C is undefined. That means that on some architectures, thec_layout.sil
test fails, because it expects the IR forchar chareth(char a);
to usesignedext
, whereas some architectures treat these types as unsigned, and thuszeroext
is used.In order to ensure identical signedness on all platforms the tests run on, explicitly specify the signedness using the compiler flag
-fsigned-char
.More information on
char
signedness can be found here: http://blog.cdleary.com/2012/11/arm-chars-are-unsigned-by-default/I discovered this failure when targeting Android armv7. I've tested this change against Android armv7 and Linux x86_64.
@hpux735, I'm curious whether the test is currently failing for you on Linux armv6/armv7, and whether this change fixes things!