diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-16 11:18:48 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-16 11:18:48 -0700 |
| commit | 5d5455bf3da2722749cf3361b42eac16e27d42cc (patch) | |
| tree | 236b53482f49eaab264e6cbb413588cead110b1b | |
| parent | 6ef0dfa42f8fa559f98c51dcd7c926fbf410a367 (diff) | |
| parent | 9f91a9540d5058eb7b384d1a58e81a4672fea7b4 (diff) | |
| download | rust-5d5455bf3da2722749cf3361b42eac16e27d42cc.tar.gz rust-5d5455bf3da2722749cf3361b42eac16e27d42cc.zip | |
Rollup merge of #74171 - ehuss:44056-debug-macos, r=nikomatsakis
Fix 44056 test with debug on macos.
The test `codegen/issue-44056-macos-tls-align.rs` fails on macos if `debug-assertions` is enabled in `config.toml`. It has the following error:
```
/Users/eric/Proj/rust/rust/src/test/codegen/issue-44056-macos-tls-align.rs:9:11: error: CHECK: expected string not found in input
// CHECK: @STATIC_VAR_1 = thread_local local_unnamed_addr global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4
^
/Users/eric/Proj/rust/rust/build/x86_64-apple-darwin/test/codegen/issue-44056-macos-tls-align/issue-44056-macos-tls-align.ll:1:1: note: scanning from here
; ModuleID = 'issue_44056_macos_tls_align.3a1fbbbh-cgu.0'
^
/Users/eric/Proj/rust/rust/build/x86_64-apple-darwin/test/codegen/issue-44056-macos-tls-align/issue-44056-macos-tls-align.ll:9:1: note: possible intended match here
@STATIC_VAR_1 = thread_local global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4
^
```
Comparing the output, the actual output is missing the text "`local_unnamed_addr`".
The fix here is to ignore `local_unnamed_addr`, as it doesn't seem relevant to the test.
| -rw-r--r-- | src/test/codegen/issue-44056-macos-tls-align.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/codegen/issue-44056-macos-tls-align.rs b/src/test/codegen/issue-44056-macos-tls-align.rs index eee59be629b..2270eca5014 100644 --- a/src/test/codegen/issue-44056-macos-tls-align.rs +++ b/src/test/codegen/issue-44056-macos-tls-align.rs @@ -6,12 +6,13 @@ #![crate_type = "rlib"] #![feature(thread_local)] -// CHECK: @STATIC_VAR_1 = thread_local local_unnamed_addr global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4 +// local_unnamed_addr does not appear when std is built with debug assertions. +// CHECK: @STATIC_VAR_1 = thread_local {{(local_unnamed_addr )?}}global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4 #[no_mangle] #[thread_local] static mut STATIC_VAR_1: [u32; 8] = [0; 8]; -// CHECK: @STATIC_VAR_2 = thread_local local_unnamed_addr global <{ [32 x i8] }> <{{[^>]*}}>, section "__DATA,__thread_data", align 4 +// CHECK: @STATIC_VAR_2 = thread_local {{(local_unnamed_addr )?}}global <{ [32 x i8] }> <{{[^>]*}}>, section "__DATA,__thread_data", align 4 #[no_mangle] #[thread_local] static mut STATIC_VAR_2: [u32; 8] = [4; 8]; |
