This is an archive of the discontinued LLVM Phabricator instance.

Add test to verify behavior of .cfi_sections .debug_frame intrinsic
ClosedPublic

Authored by rastogishubham on Apr 6 2023, 3:30 PM.

Details

Summary

I noticed that there was some lacking test coverage for checking when the .cfi_sections .debug_frame intrinsic is emitted. I added this test to address this.

On x86_64 we can see that even with -fno-exceptions there is no .cfi_sections .debug_frame intrinsic emitted because there is an unwind table attribute.

On Arm64 we can see that with -fno-exceptions, there is no unwind table attribute, so the .cfi_sections .debug_frame intrinsic is emitted correctly.

Alternatively, with -fexceptions, both Arm64 and x86_64 emit an unwind table and therefore do not emit a .cfi_sections .debug_frame intrinsic

All this work was done in addition to https://reviews.llvm.org/D139663 patch.

Diff Detail

Event Timeline

rastogishubham created this revision.Apr 6 2023, 3:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2023, 3:30 PM
rastogishubham requested review of this revision.Apr 6 2023, 3:30 PM
aprantl requested changes to this revision.Apr 10 2023, 3:38 PM

Clang tests should not depend on a target. The right thing to do here is to generate LLVM IR from the source code and then check in LLVM IR somewhere into llvm/test and compile that with llc. IF there is something in clang that needs to be tested then you can add a second test that does source -> IR -> FileCheck in Clang.

This revision now requires changes to proceed.Apr 10 2023, 3:38 PM

Addressed review feedback by making some tests llc tests instead of the clang driver tests

Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2023, 1:59 PM
aprantl added inline comments.Apr 19 2023, 3:12 PM
llvm/test/DebugInfo/AArch64/test-fexceptions-debug-frame.ll
2

Can you add a comment explaining what is being tested here?

3

Can you also add one positive CHECK as a sanity check? Otherwise this test passes even if the llc binary outputs nothing.

17

it's considered good practice to strip all the "string" attributes that arent' strictly needed from tests, so they are easier to maintain when these attributes change in the future.

llvm/test/DebugInfo/AArch64/test-fno-exceptions-debug-frame.ll
17

strip if possible

llvm/test/DebugInfo/X86/test-fexceptions-debug-frame.ll
17

ditto

llvm/test/DebugInfo/X86/test-fno-exceptions-debug-frame.ll
3

ditto

rastogishubham marked 6 inline comments as done.

Addressed review comments, mainly:

  1. Added a description to explain what each test does
  1. Added a CHECK in tests that just had a CHECK-NOT
  1. Renamed test-cfi.cpp to test-uwtable.cpp
aprantl accepted this revision.Apr 26 2023, 1:18 PM
This revision is now accepted and ready to land.Apr 26 2023, 1:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2023, 4:16 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript