about summary refs log tree commit diff
path: root/src/test/run-make-fulldeps
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2021-12-03 14:24:05 +0000
committerDavid Wood <david.wood@huawei.com>2022-01-06 09:32:42 +0000
commit2dc1a8a779f158ed070ccbde4529a97d178c0334 (patch)
tree6ac3d7bdf718fbc73869d32ef2ccd450cf568f9e /src/test/run-make-fulldeps
parent08ed338f561b000ce5672b55c0545fa7f3f13591 (diff)
downloadrust-2dc1a8a779f158ed070ccbde4529a97d178c0334.tar.gz
rust-2dc1a8a779f158ed070ccbde4529a97d178c0334.zip
cg: use thorin instead of llvm-dwp
`thorin` is a Rust implementation of a DWARF packaging utility that
supports reading DWARF objects from archive files (i.e. rlibs) and
therefore is better suited for integration into rustc.

Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'src/test/run-make-fulldeps')
-rw-r--r--src/test/run-make-fulldeps/split-debuginfo/Makefile50
-rw-r--r--src/test/run-make-fulldeps/split-debuginfo/bar.rs13
-rw-r--r--src/test/run-make-fulldeps/split-debuginfo/foo.rs14
-rw-r--r--src/test/run-make-fulldeps/split-debuginfo/main.rs8
-rw-r--r--src/test/run-make-fulldeps/split-dwarf/Makefile17
-rw-r--r--src/test/run-make-fulldeps/split-dwarf/foo.rs1
6 files changed, 84 insertions, 19 deletions
diff --git a/src/test/run-make-fulldeps/split-debuginfo/Makefile b/src/test/run-make-fulldeps/split-debuginfo/Makefile
index 292fe5ae55b..e2dc64d8ce2 100644
--- a/src/test/run-make-fulldeps/split-debuginfo/Makefile
+++ b/src/test/run-make-fulldeps/split-debuginfo/Makefile
@@ -57,7 +57,45 @@ packed-single:
 	ls $(TMPDIR)/*.dwo && exit 1 || exit 0
 	rm -rf $(TMPDIR)/*.dwp
 
-unpacked: unpacked-split unpacked-single
+packed-remapped: packed-remapped-split packed-remapped-single
+
+packed-remapped-split:
+	$(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 \
+		-Z split-dwarf-kind=split --remap-path-prefix $(TMPDIR)=/a foo.rs -g
+	objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
+
+packed-remapped-single:
+	$(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 \
+		-Z split-dwarf-kind=single --remap-path-prefix $(TMPDIR)=/a foo.rs -g
+	objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
+
+packed-crosscrate: packed-crosscrate-split packed-crosscrate-single
+
+packed-crosscrate-split:
+	$(RUSTC) --crate-type lib -Z unstable-options -C split-debuginfo=packed \
+		-Zsplit-dwarf-kind=split -C debuginfo=2 -g bar.rs
+	ls $(TMPDIR)/*.rlib
+	ls $(TMPDIR)/*.dwo && exit 1 || exit 0
+	ls $(TMPDIR)/*.dwp && exit 1 || exit 0
+	$(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib -Z unstable-options -C split-debuginfo=packed \
+		-Zsplit-dwarf-kind=split -C debuginfo=2 -g main.rs
+	rm $(TMPDIR)/*.dwo
+	rm $(TMPDIR)/main.dwp
+	rm $(TMPDIR)/$(call BIN,main)
+
+packed-crosscrate-single:
+	$(RUSTC) --crate-type lib -Z unstable-options -C split-debuginfo=packed \
+		-Zsplit-dwarf-kind=single -C debuginfo=2 -g bar.rs
+	ls $(TMPDIR)/*.rlib
+	ls $(TMPDIR)/*.dwo && exit 1 || exit 0
+	ls $(TMPDIR)/*.dwp && exit 1 || exit 0
+	$(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib -Z unstable-options -C split-debuginfo=packed \
+		-Zsplit-dwarf-kind=single -C debuginfo=2 -g main.rs
+	ls $(TMPDIR)/*.dwo && exit 1 || exit 0
+	rm $(TMPDIR)/main.dwp
+	rm $(TMPDIR)/$(call BIN,main)
+
+unpacked: unpacked-split unpacked-single unpacked-remapped-split unpacked-remapped-single
 
 unpacked-split:
 	$(RUSTC) foo.rs -g -C split-debuginfo=unpacked -Z unstable-options -Zsplit-dwarf-kind=split
@@ -69,5 +107,15 @@ unpacked-single:
 	$(RUSTC) foo.rs -g -C split-debuginfo=unpacked -Z unstable-options -Zsplit-dwarf-kind=single
 	ls $(TMPDIR)/*.dwp && exit 1 || exit 0
 	ls $(TMPDIR)/*.dwo && exit 1 || exit 0
+
+unpacked-remapped-split:
+	$(RUSTC) -Z unstable-options -C split-debuginfo=unpacked -C debuginfo=2 \
+		-Z split-dwarf-kind=split --remap-path-prefix $(TMPDIR)=/a foo.rs -g
+	objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
+
+unpacked-remapped-single:
+	$(RUSTC) -Z unstable-options -C split-debuginfo=unpacked -C debuginfo=2 \
+		-Z split-dwarf-kind=single --remap-path-prefix $(TMPDIR)=/a foo.rs -g
+	objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
 endif
 endif
diff --git a/src/test/run-make-fulldeps/split-debuginfo/bar.rs b/src/test/run-make-fulldeps/split-debuginfo/bar.rs
new file mode 100644
index 00000000000..07dd0715252
--- /dev/null
+++ b/src/test/run-make-fulldeps/split-debuginfo/bar.rs
@@ -0,0 +1,13 @@
+pub struct Bar {
+    x: u32,
+}
+
+impl Bar {
+    pub fn print(&self) {
+        println!("{}", self.x);
+    }
+}
+
+pub fn make_bar(x: u32) -> Bar {
+    Bar { x }
+}
diff --git a/src/test/run-make-fulldeps/split-debuginfo/foo.rs b/src/test/run-make-fulldeps/split-debuginfo/foo.rs
index f328e4d9d04..b058e540862 100644
--- a/src/test/run-make-fulldeps/split-debuginfo/foo.rs
+++ b/src/test/run-make-fulldeps/split-debuginfo/foo.rs
@@ -1 +1,15 @@
+pub struct Foo {
+    x: u32,
+}
+
+impl Foo {
+    pub fn print(&self) {
+        println!("{}", self.x);
+    }
+}
+
+pub fn make_foo(x: u32) -> Foo {
+    Foo { x }
+}
+
 fn main() {}
diff --git a/src/test/run-make-fulldeps/split-debuginfo/main.rs b/src/test/run-make-fulldeps/split-debuginfo/main.rs
new file mode 100644
index 00000000000..21fa16e40a4
--- /dev/null
+++ b/src/test/run-make-fulldeps/split-debuginfo/main.rs
@@ -0,0 +1,8 @@
+extern crate bar;
+
+use bar::{Bar, make_bar};
+
+fn main() {
+    let b = make_bar(3);
+    b.print();
+}
diff --git a/src/test/run-make-fulldeps/split-dwarf/Makefile b/src/test/run-make-fulldeps/split-dwarf/Makefile
deleted file mode 100644
index eef04c767fb..00000000000
--- a/src/test/run-make-fulldeps/split-dwarf/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
--include ../tools.mk
-
-# only-linux
-
-all: packed remapped
-
-remapped:
-	$(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 --remap-path-prefix $(TMPDIR)=/a foo.rs -g
-	objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
-
-	$(RUSTC) -Z unstable-options -C split-debuginfo=unpacked -C debuginfo=2 --remap-path-prefix $(TMPDIR)=/a foo.rs -g
-	objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
-
-packed:
-	$(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 foo.rs -g
-	rm $(TMPDIR)/foo.dwp
-	rm $(TMPDIR)/$(call BIN,foo)
diff --git a/src/test/run-make-fulldeps/split-dwarf/foo.rs b/src/test/run-make-fulldeps/split-dwarf/foo.rs
deleted file mode 100644
index f328e4d9d04..00000000000
--- a/src/test/run-make-fulldeps/split-dwarf/foo.rs
+++ /dev/null
@@ -1 +0,0 @@
-fn main() {}