Skip to content

test: add test for anonymous version definition diagnostic#1152

Closed
sai18022001 wants to merge 4 commits into
qualcomm:mainfrom
sai18022001:fix/issue-1124-anonymous-version-definition-test
Closed

test: add test for anonymous version definition diagnostic#1152
sai18022001 wants to merge 4 commits into
qualcomm:mainfrom
sai18022001:fix/issue-1124-anonymous-version-definition-test

Conversation

@sai18022001
Copy link
Copy Markdown

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 in ScriptParser::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 linking
  • Inputs/vs_mixed — version script mixing a named and anonymous version node to trigger the diagnostic
  • VersionScriptAnonymousMixed.test — compiles 1.c into an object file,
    links it as a shared library with vs_mixed via --version-script=,
    expects the link to fail (%not), and verifies the error message using
    FileCheck

Testing :
Tested on AArch64, ARM, RISCV, RISCV64 — all pass.
x86 is marked UNSUPPORTED consistent with other version script tests.
Hexagon failure is a local toolchain issue (-mv75 unsupported), confirmed the same failure occurs on existing tests like
VersionScriptAnonymousTagMerge.

- Add tests for --section-start, -Ttext, -Tdata, -Tbss, -Ttext-segment
- Add -Trodata-segment and -Tldata-segment support and tests
- Update userguide with option descriptions

Resolves qualcomm#1099

Signed-off-by: Sai Sanjay Chikne <saichikne180201@gmail.com>
…options

- Add tests for --section-start, -Ttext, -Tdata, -Tbss, -Ttext-segment
- Add -Trodata-segment and -Tldata-segment support and tests
- Implement -Ttext-segment, -Trodata-segment, -Tldata-segment options
- Update userguide with option descriptions

Resolves qualcomm#1099

Signed-off-by: Sai Sanjay Chikne <saichikne180201@gmail.com>
Signed-off-by: Sai Sanjay Chikne <saichikne180201@gmail.com>
Add 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.

The diagnostic is emitted in ScriptParser::readVersionScriptCommand()
when the parser encounters an anonymous block '{' after one or more
named version nodes in the same version script file.

Test location: test/Common/standalone/VersionScriptAnonymousMixed/

Fixes qualcomm#1124

Signed-off-by: Sai Sanjay Chikne <saichikne180201@gmail.com>
@sai18022001
Copy link
Copy Markdown
Author

sai18022001 commented May 10, 2026

Closing this PR due to unintentional commits.
This is new PR #1153 which is based cleanly on main.

@sai18022001 sai18022001 deleted the fix/issue-1124-anonymous-version-definition-test branch May 10, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

There is no test for the error anonymous version definition is used in combination with other version definitions

1 participant