about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@fb.com>2022-06-20 16:26:51 -0700
committerPatrick Walton <pcwalton@fb.com>2022-07-08 11:31:08 -0700
commit1e0ad0c1d4fdca7a37221e05fd5e39739d9084f5 (patch)
tree14b27ca538f026f36bd50438734954f68071b2c2 /src/test
parent45263fc66d253f762b3880764ae48611a25bf887 (diff)
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
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