diff options
| author | Sam Elliott <selliott@lowrisc.org> | 2019-12-13 20:00:14 +0000 |
|---|---|---|
| committer | Sam Elliott <selliott@lowrisc.org> | 2019-12-13 20:01:04 +0000 |
| commit | a0f43b0043581b37b10d105a85f0653704d3657b (patch) | |
| tree | 3a3361977839f1fd220ecd74fc38ae1a7a54e98e /llvm/test/MC/RISCV/compress-debug-info.s | |
| parent | 19f73f0d1b8d4f4a7b7451fea33a35015fe0942d (diff) | |
| download | bcm5719-llvm-a0f43b0043581b37b10d105a85f0653704d3657b.tar.gz bcm5719-llvm-a0f43b0043581b37b10d105a85f0653704d3657b.zip | |
[RISCV] Move DebugLoc Copy into CompressInstEmitter
Summary:
This copy ensures that debug location information is kept for
compressed instructions. There are places where both compressInstruction and
uncompressInstruction are called that were not doing this copy, discarding some
debug info.
This change merely moves the copy into the generated file, so you cannot forget
to copy the location over when compressing or uncompressing.
Reviewers: asb, luismarques
Reviewed By: luismarques
Subscribers: sameer.abuasal, aprantl, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67493
Diffstat (limited to 'llvm/test/MC/RISCV/compress-debug-info.s')
| -rw-r--r-- | llvm/test/MC/RISCV/compress-debug-info.s | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/MC/RISCV/compress-debug-info.s b/llvm/test/MC/RISCV/compress-debug-info.s new file mode 100644 index 00000000000..b7ad2ff3e2a --- /dev/null +++ b/llvm/test/MC/RISCV/compress-debug-info.s @@ -0,0 +1,20 @@ +# RUN: llvm-mc -triple riscv32 -mattr=+c %s -g -o - -riscv-no-aliases \ +# RUN: | FileCheck %s -check-prefixes=COMPRESS,BOTH +# RUN: llvm-mc -triple riscv32 %s -g -o - -riscv-no-aliases \ +# RUN: | FileCheck %s -check-prefixes=UNCOMPRESS,BOTH + + +# This file ensures that compressing an instruction preserves its debug info. + + +# BOTH-LABEL: .text + +# BOTH: .file 1 +# BOTH-SAME: "compress-debug-info.s" + +# BOTH: .loc 1 [[# @LINE + 3 ]] 0 +# UNCOMPRESS-NEXT: addi a0, a1, 0 +# COMPRESS-NEXT: c.mv a0, a1 +addi a0, a1, 0 + +# BOTH-LABEL: .debug_info |

