test: add test for anonymous version definition diagnostic#1153
Open
sai18022001 wants to merge 1 commit into
Open
test: add test for anonymous version definition diagnostic#1153sai18022001 wants to merge 1 commit into
sai18022001 wants to merge 1 commit into
Conversation
This was referenced May 10, 2026
parth-07
reviewed
May 12, 2026
| @@ -0,0 +1,14 @@ | |||
| UNSUPPORTED: x86 | |||
Contributor
There was a problem hiding this comment.
Is it required to explicitly disable the x86 architecture here?
Contributor
There was a problem hiding this comment.
In that case, can you please remove it?
| # Test that an error is emitted when an anonymous version definition | ||
| # is used in combination with other named version definitions | ||
| # in a version script. | ||
| # See: https://github.com/qualcomm/eld/issues/1124 |
Contributor
There was a problem hiding this comment.
Suggested change
| # See: https://github.com/qualcomm/eld/issues/1124 |
| @@ -0,0 +1,6 @@ | |||
| VER_1.0 { | |||
Contributor
There was a problem hiding this comment.
Can you please also add a test where anonymous version is first and then we have named version node?
Author
There was a problem hiding this comment.
@parth-07
The anonymous-first case produces a different error: EOF expected, but got VER_1.0 rather than the anonymous version definition is used in combination with other version definitions .
Should I add a separate CHECK for that error ?
Contributor
There was a problem hiding this comment.
Yes, please add a separate check for that.
Add a lit test covering the error diagnostics emitted when an anonymous version definition is used in combination with other named version definitions in a version script. Two cases are tested: - Named version node first, anonymous second: emits 'anonymous version definition is used in combination with other version definitions' - Anonymous version node first, named second: emits 'EOF expected, but got VER_1.0' Test location: test/Common/standalone/VersionScriptAnonymousMixed/ Fixes qualcomm#1124 Signed-off-by: Sai Sanjay Chikne <saichikne180201@gmail.com>
c4f41f0 to
c849c41
Compare
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
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.
Fixes #1124
Adds a lit test covering the error diagnostic emitted when an anonymous
version definition is used in combination with other named version
definitions in a version script.
Problem :
The diagnostic
anonymous version definition is used in combination with other version definitions(emitted inScriptParser::readVersionScriptCommand())had no test coverage.
Solution :
Added a new lit test at
test/Common/standalone/VersionScriptAnonymousMixed/with the following files:
Inputs/1.c— minimal C source file to produce an object file for linkingInputs/vs_mixed— version script mixing a named and anonymous version node to trigger the diagnosticVersionScriptAnonymousMixed.test— compiles1.cinto an object file,links it as a shared library with
vs_mixedvia--version-script=,expects the link to fail (
%not), and verifies the error message usingFileCheckTesting :
Tested on AArch64, ARM, RISCV, RISCV64, Hexagon, x86 - > all pass.