Skip to content

Commit

Permalink
Correct minimum system LLVM version in tests
Browse files Browse the repository at this point in the history
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
smaeul committed Mar 23, 2019
1 parent 52e8856 commit 8d3dd39
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
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
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
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
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
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
@@ -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
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
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
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
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
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
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
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 8d3dd39

Please sign in to comment.