about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-07-09 11:28:03 +0530
committerGitHub <noreply@github.com>2022-07-09 11:28:03 +0530
commitfd4f11dd768e7de5015b57eef6b18c1f4d31e1e6 (patch)
treef9466045a56d765104b6f6d1d70f0bd77c0b26a2 /src/test
parentdb78ab70a88a0a5e89031d7ee4eccec835dcdbde (diff)
parent1e0ad0c1d4fdca7a37221e05fd5e39739d9084f5 (diff)
Rollup merge of #98350 - pcwalton:dwarf5, r=michaelwoerister
Implement support for DWARF version 5.

DWARF version 5 brings a number of improvements over version 4. Quoting from
the announcement [1]:

> Version 5 incorporates improvements in many areas: better data compression,
> separation of debugging data from executable files, improved description of
> macros and source files, faster searching for symbols, improved debugging
> optimized code, as well as numerous improvements in functionality and
> performance.

On platforms where DWARF version 5 is supported (Linux, primarily), this commit
adds support for it behind a new `-Z dwarf-version=5` flag.

[1]: https://dwarfstd.org/Public_Review.php

r? ``@michaelwoerister``
Diffstat (limited to 'src/test')
-rw-r--r--src/test/assembly/dwarf5.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/assembly/dwarf5.rs b/src/test/assembly/dwarf5.rs
new file mode 100644
index 00000000000..f41e6bd55be
--- /dev/null
+++ b/src/test/assembly/dwarf5.rs
@@ -0,0 +1,20 @@
+// Makes sure that `-Z dwarf-version=5` causes `rustc` to emit DWARF version 5.
+// assembly-output: emit-asm
+// compile-flags: -g --target x86_64-unknown-linux-gnu -Z dwarf-version=5
+// needs-llvm-components: x86
+
+#![feature(no_core, lang_items)]
+#![crate_type = "rlib"]
+#![no_core]
+
+#[lang = "sized"]
+trait Sized {}
+#[lang = "copy"]
+trait Copy {}
+
+pub fn wibble() {}
+
+// CHECK: .section .debug_info
+// CHECK-NOT: .short 2
+// CHECK-NOT: .short 4
+// CHECK: .short 5