1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // min-lldb-version: 310
12 // ignore-lldb FIXME #48807
14 // compile-flags:-g -Zdebug-macros
16 // === GDB TESTS ===================================================================================
20 // gdb-command:print a
22 // gdb-command:print b
24 // gdb-command:continue
26 // gdb-command:print a
27 // gdb-check:$3 = 890242
28 // gdb-command:print b
30 // gdb-command:continue
32 // gdb-command:print a
34 // gdb-command:print b
36 // gdb-command:continue
38 // gdb-command:print a
40 // gdb-command:print b
42 // gdb-command:continue
44 // gdb-command:print a
46 // gdb-command:print b
48 // gdb-command:continue
50 // gdb-command:print a
52 // gdb-command:print b
54 // gdb-command:continue
56 // gdb-command:print a
58 // gdb-command:print b
60 // gdb-command:print c
61 // gdb-check:$15 = 400
62 // gdb-command:continue
65 // === LLDB TESTS ==================================================================================
69 // lldb-command:print a
70 // lldbg-check:[...]$0 = 10
71 // lldbr-check:(i32) a = 10
72 // lldb-command:print b
73 // lldbg-check:[...]$1 = 34
74 // lldbr-check:(i32) b = 34
75 // lldb-command:continue
77 // lldb-command:print a
78 // lldbg-check:[...]$2 = 890242
79 // lldbr-check:(i32) a = 10
80 // lldb-command:print b
81 // lldbg-check:[...]$3 = 34
82 // lldbr-check:(i32) b = 34
83 // lldb-command:continue
85 // lldb-command:print a
86 // lldbg-check:[...]$4 = 10
87 // lldbr-check:(i32) a = 10
88 // lldb-command:print b
89 // lldbg-check:[...]$5 = 34
90 // lldbr-check:(i32) b = 34
91 // lldb-command:continue
93 // lldb-command:print a
94 // lldbg-check:[...]$6 = 102
95 // lldbr-check:(i32) a = 10
96 // lldb-command:print b
97 // lldbg-check:[...]$7 = 34
98 // lldbr-check:(i32) b = 34
99 // lldb-command:continue
101 // Don't test this with rust-enabled lldb for now; see issue #48807
102 // lldbg-command:print a
103 // lldbg-check:[...]$8 = 110
104 // lldbg-command:print b
105 // lldbg-check:[...]$9 = 34
106 // lldbg-command:continue
108 // lldbg-command:print a
109 // lldbg-check:[...]$10 = 10
110 // lldbg-command:print b
111 // lldbg-check:[...]$11 = 34
112 // lldbg-command:continue
114 // lldbg-command:print a
115 // lldbg-check:[...]$12 = 10
116 // lldbg-command:print b
117 // lldbg-check:[...]$13 = 34
118 // lldbg-command:print c
119 // lldbg-check:[...]$14 = 400
120 // lldbg-command:continue
123 #![feature(omit_gdb_pretty_printer_section)]
124 #![omit_gdb_pretty_printer_section]
126 macro_rules! trivial {
130 macro_rules! no_new_scope {
131 ($e1:expr) => (($e1 + 2) - 1)
134 macro_rules! new_scope {
142 macro_rules! shadow_within_macro {
157 macro_rules! dup_expr {
158 ($e1:expr) => (($e1) + ($e1))
164 let a = trivial!(10);
165 let b = no_new_scope!(33);
175 shadow_within_macro!(100);
180 let c = dup_expr!(10 * 20);