about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorDianQK <dianqk@dianqk.net>2023-11-18 20:01:01 +0800
committerDianQK <dianqk@dianqk.net>2023-11-30 18:48:03 +0800
commitc41bf9603972362ee2936247d81b21d495081470 (patch)
tree326b1c6bbbcab86b8dae378b3dbf2b692aaac497 /tests
parente1e60b6976ed51e9464d15a2888d90c577dda223 (diff)
downloadrust-c41bf9603972362ee2936247d81b21d495081470.tar.gz
rust-c41bf9603972362ee2936247d81b21d495081470.zip
Add thinlto support to codegen, assembly and coverage tests
Diffstat (limited to 'tests')
-rw-r--r--tests/assembly/thin-lto.rs8
-rw-r--r--tests/codegen/thin-lto.rs7
-rw-r--r--tests/coverage/thin-lto.cov-map8
-rw-r--r--tests/coverage/thin-lto.coverage5
-rw-r--r--tests/coverage/thin-lto.rs4
5 files changed, 32 insertions, 0 deletions
diff --git a/tests/assembly/thin-lto.rs b/tests/assembly/thin-lto.rs
new file mode 100644
index 00000000000..deb8fd21d14
--- /dev/null
+++ b/tests/assembly/thin-lto.rs
@@ -0,0 +1,8 @@
+// compile-flags: -O -C lto=thin -C prefer-dynamic=no
+// only-x86_64-unknown-linux-gnu
+// assembly-output: emit-asm
+
+// CHECK: main
+
+pub fn main() {
+}
diff --git a/tests/codegen/thin-lto.rs b/tests/codegen/thin-lto.rs
new file mode 100644
index 00000000000..7991cad7a0c
--- /dev/null
+++ b/tests/codegen/thin-lto.rs
@@ -0,0 +1,7 @@
+// compile-flags: -O -C lto=thin -C prefer-dynamic=no
+// only-x86_64-unknown-linux-gnu
+
+// CHECK: main
+
+pub fn main() {
+}
diff --git a/tests/coverage/thin-lto.cov-map b/tests/coverage/thin-lto.cov-map
new file mode 100644
index 00000000000..7e84e398f84
--- /dev/null
+++ b/tests/coverage/thin-lto.cov-map
@@ -0,0 +1,8 @@
+Function name: thin_lto::main
+Raw bytes (9): 0x[01, 01, 00, 01, 01, 03, 01, 01, 02]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 0
+Number of file 0 mappings: 1
+- Code(Counter(0)) at (prev + 3, 1) to (start + 1, 2)
+
diff --git a/tests/coverage/thin-lto.coverage b/tests/coverage/thin-lto.coverage
new file mode 100644
index 00000000000..21abb5dce04
--- /dev/null
+++ b/tests/coverage/thin-lto.coverage
@@ -0,0 +1,5 @@
+   LL|       |// compile-flags: -O -C lto=thin -C prefer-dynamic=no
+   LL|       |
+   LL|      1|pub fn main() {
+   LL|      1|}
+
diff --git a/tests/coverage/thin-lto.rs b/tests/coverage/thin-lto.rs
new file mode 100644
index 00000000000..050aac26319
--- /dev/null
+++ b/tests/coverage/thin-lto.rs
@@ -0,0 +1,4 @@
+// compile-flags: -O -C lto=thin -C prefer-dynamic=no
+
+pub fn main() {
+}