diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2014-04-24 11:35:48 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2014-05-07 19:58:07 +0200 |
| commit | 55a8bd56e5a89f98aa9d4ed998cb8c686d447805 (patch) | |
| tree | e49ddf2a659d8129ad336baff052daa881f6f505 /src/test/debuginfo/tuple-struct.rs | |
| parent | 445988b47811679144d0fa9b3a2ccf2348752850 (diff) | |
| download | rust-55a8bd56e5a89f98aa9d4ed998cb8c686d447805.tar.gz rust-55a8bd56e5a89f98aa9d4ed998cb8c686d447805.zip | |
debuginfo: Split debuginfo autotests into debuginfo-gdb and debuginfo-lldb
Diffstat (limited to 'src/test/debuginfo/tuple-struct.rs')
| -rw-r--r-- | src/test/debuginfo/tuple-struct.rs | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/test/debuginfo/tuple-struct.rs b/src/test/debuginfo/tuple-struct.rs new file mode 100644 index 00000000000..cea063820b8 --- /dev/null +++ b/src/test/debuginfo/tuple-struct.rs @@ -0,0 +1,61 @@ +// 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. + +// ignore-android: FIXME(#10381) + +// compile-flags:-g +// gdb-command:set print pretty off +// gdb-command:rbreak zzz +// gdb-command:run +// gdb-command:finish + +// gdb-command:print no_padding16 +// gdb-check:$1 = {10000, -10001} + +// gdb-command:print no_padding32 +// gdb-check:$2 = {-10002, -10003.5, 10004} + +// gdb-command:print no_padding64 +// gdb-check:$3 = {-10005.5, 10006, 10007} + +// gdb-command:print no_padding163264 +// gdb-check:$4 = {-10008, 10009, 10010, 10011} + +// gdb-command:print internal_padding +// gdb-check:$5 = {10012, -10013} + +// gdb-command:print padding_at_end +// gdb-check:$6 = {-10014, 10015} + + +// This test case mainly makes sure that no field names are generated for tuple structs (as opposed +// to all fields having the name "<unnamed_field>"). Otherwise they are handled the same a normal +// structs. + +struct NoPadding16(u16, i16); +struct NoPadding32(i32, f32, u32); +struct NoPadding64(f64, i64, u64); +struct NoPadding163264(i16, u16, i32, u64); +struct InternalPadding(u16, i64); +struct PaddingAtEnd(i64, u16); + +fn main() { + let no_padding16 = NoPadding16(10000, -10001); + let no_padding32 = NoPadding32(-10002, -10003.5, 10004); + let no_padding64 = NoPadding64(-10005.5, 10006, 10007); + let no_padding163264 = NoPadding163264(-10008, 10009, 10010, 10011); + + let internal_padding = InternalPadding(10012, -10013); + let padding_at_end = PaddingAtEnd(-10014, 10015); + + zzz(); +} + +fn zzz() {()} |
