Skip to content

Commit

Permalink
Rollup merge of #59377 - smaeul:patch/system-llvm, r=nikic
Browse files Browse the repository at this point in the history
Correct minimum system LLVM version in tests

Since commit 9452a8d, the new debug info format is only generated
for LLVM 8 and newer versions. However, the tests still assume that LLVM
7 will use the new debug info format. Fix the tests (and a comment in
the code) to match the actual version check.
  • Loading branch information
kennytm committed Mar 24, 2019
2 parents 70cf325 + 8d3dd39 commit 00478a0
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 15 deletions.
8 changes: 5 additions & 3 deletions src/librustc_codegen_llvm/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1156,12 +1156,14 @@ fn prepare_union_metadata(
// Enums
//=-----------------------------------------------------------------------------

// DWARF variant support is only available starting in LLVM 7.
// DWARF variant support is only available starting in LLVM 8.
// Although the earlier enum debug info output did not work properly
// in all situations, it is better for the time being to continue to
// sometimes emit the old style rather than emit something completely
// useless when rust is compiled against LLVM 6 or older. This
// function decides which representation will be emitted.
// useless when rust is compiled against LLVM 6 or older. LLVM 7
// contains an early version of the DWARF variant support, and will
// crash when handling the new debug info format. This function
// decides which representation will be emitted.
fn use_enum_fallback(cx: &CodegenCx<'_, '_>) -> bool {
// On MSVC we have to use the fallback mode, because LLVM doesn't
// lower variant parts to PDB.
Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/enum-debug-clike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// ignore-tidy-linelength
// ignore-windows
// min-system-llvm-version 7.0
// min-system-llvm-version 8.0

// compile-flags: -g -C no-prepopulate-passes

Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/enum-debug-niche-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// ignore-tidy-linelength
// ignore-windows
// min-system-llvm-version 7.0
// min-system-llvm-version 8.0

// compile-flags: -g -C no-prepopulate-passes

Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/enum-debug-niche.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// ignore-tidy-linelength
// ignore-windows
// min-system-llvm-version 7.0
// min-system-llvm-version 8.0

// compile-flags: -g -C no-prepopulate-passes

Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/enum-debug-tagged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// ignore-tidy-linelength
// ignore-windows
// min-system-llvm-version 7.0
// min-system-llvm-version 8.0

// compile-flags: -g -C no-prepopulate-passes

Expand Down
2 changes: 1 addition & 1 deletion src/test/debuginfo/borrowed-enum.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ignore-tidy-linelength

// Require LLVM with DW_TAG_variant_part and a gdb or lldb that can read it.
// min-system-llvm-version: 7.0
// min-system-llvm-version: 8.0
// min-gdb-version: 8.2
// rust-lldb

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// min-lldb-version: 310

// Require LLVM with DW_TAG_variant_part and a gdb that can read it.
// min-system-llvm-version: 7.0
// min-system-llvm-version: 8.0
// min-gdb-version: 8.2

// compile-flags:-g
Expand Down
2 changes: 1 addition & 1 deletion src/test/debuginfo/generic-struct-style-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// min-lldb-version: 310

// Require LLVM with DW_TAG_variant_part and a gdb that can read it.
// min-system-llvm-version: 7.0
// min-system-llvm-version: 8.0
// min-gdb-version: 8.2

// compile-flags:-g
Expand Down
2 changes: 1 addition & 1 deletion src/test/debuginfo/generic-tuple-style-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
// read it.
// min-system-llvm-version: 7.0
// min-system-llvm-version: 8.0
// min-gdb-version: 8.2
// rust-lldb

Expand Down
2 changes: 1 addition & 1 deletion src/test/debuginfo/recursive-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ignore-lldb

// Require LLVM with DW_TAG_variant_part and a gdb that can read it.
// min-system-llvm-version: 7.0
// min-system-llvm-version: 8.0
// min-gdb-version: 8.2

// compile-flags:-g
Expand Down
2 changes: 1 addition & 1 deletion src/test/debuginfo/struct-style-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
// read it.
// min-system-llvm-version: 7.0
// min-system-llvm-version: 8.0
// min-gdb-version: 8.2
// rust-lldb

Expand Down
2 changes: 1 addition & 1 deletion src/test/debuginfo/tuple-style-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
// read it.
// min-system-llvm-version: 7.0
// min-system-llvm-version: 8.0
// min-gdb-version: 8.2
// rust-lldb

Expand Down
2 changes: 1 addition & 1 deletion src/test/debuginfo/unique-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
// read it.
// min-system-llvm-version: 7.0
// min-system-llvm-version: 8.0
// min-gdb-version: 8.2
// rust-lldb

Expand Down

0 comments on commit 00478a0

Please sign in to comment.