about summary refs log tree commit diff
path: root/src/test/codegen/sanitizer-recover.rs
diff options
context:
space:
mode:
authorSimonas Kazlauskas <git@kazlauskas.me>2021-03-28 00:11:24 +0200
committerSimonas Kazlauskas <git@kazlauskas.me>2021-04-03 00:00:29 +0300
commit2f000a78bf615b35c4837f920fb6adcad4848351 (patch)
tree3d0cd52de9151067789edfa6f2e6729712dd0256 /src/test/codegen/sanitizer-recover.rs
parent9b0edb7fddacd6a60a380c1ce59159de597ab270 (diff)
downloadrust-2f000a78bf615b35c4837f920fb6adcad4848351.tar.gz
rust-2f000a78bf615b35c4837f920fb6adcad4848351.zip
Manually set dso_local when its valid to do so
This should have no real effect in most cases, as e.g. `hidden`
visibility already implies `dso_local` (or at least LLVM IR does not
preserve the `dso_local` setting if the item is already `hidden`), but
it should fix `-Crelocation-model=static` and improve codegen in
executables.

Note that this PR does not exhaustively port the logic in [clang]. Only
the obviously correct portion and what is necessary to fix a regression
from LLVM 12 that relates to `-Crelocation_model=static`.

Fixes #83335

[clang]: https://github.com/llvm/llvm-project/blob/3001d080c813da20b329303bf8f45451480e5905/clang/lib/CodeGen/CodeGenModule.cpp#L945-L1039
Diffstat (limited to 'src/test/codegen/sanitizer-recover.rs')
-rw-r--r--src/test/codegen/sanitizer-recover.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/codegen/sanitizer-recover.rs b/src/test/codegen/sanitizer-recover.rs
index 433d32abd37..7ce0fa0a20f 100644
--- a/src/test/codegen/sanitizer-recover.rs
+++ b/src/test/codegen/sanitizer-recover.rs
@@ -16,27 +16,27 @@
 // MSAN-RECOVER:     @__msan_keep_going = weak_odr {{.*}}constant i32 1
 // MSAN-RECOVER-LTO: @__msan_keep_going = weak_odr {{.*}}constant i32 1
 
-// ASAN-LABEL: define i32 @penguin(
+// ASAN-LABEL: define dso_local i32 @penguin(
 // ASAN:         call void @__asan_report_load4(i64 %0)
 // ASAN:         unreachable
 // ASAN:       }
 //
-// ASAN-RECOVER-LABEL: define i32 @penguin(
+// ASAN-RECOVER-LABEL: define dso_local i32 @penguin(
 // ASAN-RECOVER:         call void @__asan_report_load4_noabort(
 // ASAN-RECOVER-NOT:     unreachable
 // ASAN:               }
 //
-// MSAN-LABEL: define i32 @penguin(
+// MSAN-LABEL: define dso_local i32 @penguin(
 // MSAN:         call void @__msan_warning{{(_with_origin_noreturn\(i32 0\)|_noreturn\(\))}}
 // MSAN:         unreachable
 // MSAN:       }
 //
-// MSAN-RECOVER-LABEL: define i32 @penguin(
+// MSAN-RECOVER-LABEL: define dso_local i32 @penguin(
 // MSAN-RECOVER:         call void @__msan_warning{{(_with_origin\(i32 0\)|\(\))}}
 // MSAN-RECOVER-NOT:     unreachable
 // MSAN-RECOVER:       }
 //
-// MSAN-RECOVER-LTO-LABEL: define i32 @penguin(
+// MSAN-RECOVER-LTO-LABEL: define dso_local i32 @penguin(
 // MSAN-RECOVER-LTO:          call void @__msan_warning{{(_with_origin\(i32 0\)|\(\))}}
 // MSAN-RECOVER-LTO-NOT:      unreachable
 // MSAN-RECOVER-LTO:       }