diff options
| author | Konrad Borowski <konrad@borowski.pw> | 2018-12-23 16:47:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-23 16:47:11 +0100 |
| commit | 8ac5380ea0204dbdcbc8108d259928b67d5f8ebb (patch) | |
| tree | 174d912756fc2678af50d46ff457f7504750a975 /src/test/debuginfo | |
| parent | b4a306c1e648c84f289c63e984941b7faad10af1 (diff) | |
| parent | ddab10a692aab2e2984b5c826ed9d78a57e94851 (diff) | |
| download | rust-8ac5380ea0204dbdcbc8108d259928b67d5f8ebb.tar.gz rust-8ac5380ea0204dbdcbc8108d259928b67d5f8ebb.zip | |
Merge branch 'master' into copied
Diffstat (limited to 'src/test/debuginfo')
| -rw-r--r-- | src/test/debuginfo/function-call.rs | 52 | ||||
| -rw-r--r-- | src/test/debuginfo/nil-enum.rs | 55 | ||||
| -rw-r--r-- | src/test/debuginfo/pretty-std-collections.rs | 6 | ||||
| -rw-r--r-- | src/test/debuginfo/type-names.rs | 2 |
4 files changed, 58 insertions, 57 deletions
diff --git a/src/test/debuginfo/function-call.rs b/src/test/debuginfo/function-call.rs new file mode 100644 index 00000000000..266e536e8f2 --- /dev/null +++ b/src/test/debuginfo/function-call.rs @@ -0,0 +1,52 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// This test does not passed with gdb < 8.0. See #53497. +// min-gdb-version 8.0 + +// compile-flags:-g + +// === GDB TESTS =================================================================================== + +// gdb-command:run + +// gdb-command:print fun(45, true) +// gdb-check:$1 = true +// gdb-command:print fun(444, false) +// gdb-check:$2 = false + +// gdb-command:print r.get_x() +// gdb-check:$3 = 4 + +#![allow(dead_code, unused_variables)] + +struct RegularStruct { + x: i32 +} + +impl RegularStruct { + fn get_x(&self) -> i32 { + self.x + } +} + +fn main() { + let _ = fun(4, true); + let r = RegularStruct{x: 4}; + let _ = r.get_x(); + + zzz(); // #break +} + +fn fun(x: isize, y: bool) -> bool { + y +} + +fn zzz() { () } diff --git a/src/test/debuginfo/nil-enum.rs b/src/test/debuginfo/nil-enum.rs deleted file mode 100644 index ab42b2eff99..00000000000 --- a/src/test/debuginfo/nil-enum.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// NOTE Instantiating an empty enum is UB. This test may break in the future. - -// LLDB can't handle zero-sized values -// ignore-lldb - - -// Require LLVM with DW_TAG_variant_part and a gdb that can read it. -// gdb 8.2.0 crashes on this test case, see -// https://sourceware.org/bugzilla/show_bug.cgi?id=23626 -// This will be fixed in the next release, which will be >= 8.2.1. -// min-system-llvm-version: 7.0 -// min-gdb-version: 8.2.1 - -// compile-flags:-g -// gdb-command:run - -// gdb-command:print first -// gdbr-check:$1 = nil_enum::ANilEnum {<No data fields>} - -// gdb-command:print second -// gdbr-check:$2 = nil_enum::AnotherNilEnum {<No data fields>} - -#![allow(unused_variables)] -#![feature(omit_gdb_pretty_printer_section)] -#![feature(maybe_uninit)] -#![omit_gdb_pretty_printer_section] - -use std::mem::MaybeUninit; - -enum ANilEnum {} -enum AnotherNilEnum {} - -// This test relies on gdbg printing the string "{<No data fields>}" for empty -// structs (which may change some time) -// The error from gdbr is expected since nil enums are not supposed to exist. -fn main() { - unsafe { - let first: ANilEnum = MaybeUninit::uninitialized().into_inner(); - let second: AnotherNilEnum = MaybeUninit::uninitialized().into_inner(); - - zzz(); // #break - } -} - -fn zzz() {()} diff --git a/src/test/debuginfo/pretty-std-collections.rs b/src/test/debuginfo/pretty-std-collections.rs index a51be370aa4..350b30d2cc1 100644 --- a/src/test/debuginfo/pretty-std-collections.rs +++ b/src/test/debuginfo/pretty-std-collections.rs @@ -13,7 +13,11 @@ // ignore-freebsd: gdb package too new // ignore-android: FIXME(#10381) // compile-flags:-g -// min-gdb-version 7.7 + +// The pretty printers being tested here require the patch from +// https://sourceware.org/bugzilla/show_bug.cgi?id=21763 +// min-gdb-version 8.1 + // min-lldb-version: 310 // === GDB TESTS =================================================================================== diff --git a/src/test/debuginfo/type-names.rs b/src/test/debuginfo/type-names.rs index 3ec8b048b12..8b4b10ad23c 100644 --- a/src/test/debuginfo/type-names.rs +++ b/src/test/debuginfo/type-names.rs @@ -280,7 +280,7 @@ extern { } // In many of the cases below, the type that is actually under test is wrapped -// in a tuple, e.g. Box<T>, references, raw pointers, fixed-size vectors, ... +// in a tuple, e.g., Box<T>, references, raw pointers, fixed-size vectors, ... // This is because GDB will not print the type name from DWARF debuginfo for // some kinds of types (pointers, arrays, functions, ...) // Since tuples are structs as far as GDB is concerned, their name will be |
