about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-09 23:29:56 +0100
committerGitHub <noreply@github.com>2022-02-09 23:29:56 +0100
commit3f4aaf4f2e9fd49736e660475f446619e8734e09 (patch)
treeee6ff4aed191d3baab16454560fe605299af423c /src/test/codegen
parent9634559599537e334cbfa854446d048e6ebe5ee9 (diff)
parent170593313a6ac2206107ec52a0d3bb9cc873a97c (diff)
Rollup merge of #91504 - cynecx:used_retain, r=nikic
`#[used(linker)]` attribute

See https://github.com/dtolnay/linkme/issues/41#issuecomment-927255631.
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/used_with_arg.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/codegen/used_with_arg.rs b/src/test/codegen/used_with_arg.rs
new file mode 100644
index 00000000000..5bff50a40d4
--- /dev/null
+++ b/src/test/codegen/used_with_arg.rs
@@ -0,0 +1,10 @@
+#![crate_type = "lib"]
+#![feature(used_with_arg)]
+
+// CHECK: @llvm.used = appending global [1 x i8*]{{.*}}USED_LINKER
+#[used(linker)]
+static mut USED_LINKER: [usize; 1] = [0];
+
+// CHECK-NEXT: @llvm.compiler.used = appending global [1 x i8*]{{.*}}USED_COMPILER
+#[used(compiler)]
+static mut USED_COMPILER: [usize; 1] = [0];