Skip to content
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

Leading comma in section name when running tests under MacOS #1192

Open
volsa opened this issue Apr 5, 2024 · 2 comments
Open

Leading comma in section name when running tests under MacOS #1192

volsa opened this issue Apr 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@volsa
Copy link
Member

volsa commented Apr 5, 2024

Describe the bug
Currently cargo test will fail with snapshot diffs because a leading comma is appended to the section names. For example the test multiple_files_with_debug_info will fail due to

-define i16 @main() section "fn-main:i16" !dbg !10 {
+define i16 @main() section ",fn-main:i16" !dbg !10 {

-declare !dbg !18 void @mainProg(%mainProg*) section "fn-mainProg:v"
+declare !dbg !18 void @mainProg(%mainProg*) section ",fn-mainProg:v"

-define void @mainProg(%mainProg* %0) section "fn-mainProg:v" !dbg !10 {
+define void @mainProg(%mainProg* %0) section ",fn-mainProg:v" !dbg !10 {

I'm unsure if this is a MacOS thing or ARM in general but I suspect the former.

To Reproduce
Under MacOS 14.4.1 switch to the master branch and run cargo t

Expected behavior
The snapshots shouldn't change

@volsa volsa added the bug Something isn't working label Apr 5, 2024
@volsa
Copy link
Member Author

volsa commented Apr 10, 2024

Hmm, maybe this isn't a bug after all? Inkwell does this intentionally here https://github.com/TheDan64/inkwell/blob/d916c66d2cedb8bc58c187df8403d9fc71eb0ad4/src/values/mod.rs#L219

@volsa
Copy link
Member Author

volsa commented Apr 25, 2024

I tried fixing the snapshot tests under MacOS, removing these leading commas for all tests in the codegen/ folder such that the IR is identical to the master branch. While its working (see https://github.com/PLC-lang/rusty/compare/macos-codegen) the correctness and integration tests fail with a sigbus panic. Not sure why, but the section names seem to cause the panic under MacOS. This needs further investigation...

Edit: https://www.diffchecker.com/YMExZsik/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant