|
9 | 9 | // Debugger tests need debuginfo |
10 | 10 | //@ compile-flags: -g |
11 | 11 |
|
12 | | -// FIXME(#128945): SingleUseConsts shouldn't need to be disabled. |
13 | | -//@ revisions: default-mir-passes no-SingleUseConsts-mir-pass |
14 | | -//@ [no-SingleUseConsts-mir-pass] compile-flags: -Zmir-enable-passes=-SingleUseConsts |
| 12 | +// Some optimization passes _improve_ compile times [1]. So we want to run some |
| 13 | +// passes even with `-Copt-level=0`. That means that some of the lines below can |
| 14 | +// be optimized away. To make regression testing more robust, we also want to |
| 15 | +// run this test with such passes disabled. The solution is to use two |
| 16 | +// revisions. One with default `-Copt-level=0` passes, and one "even less |
| 17 | +// optimized", with enough optimization passes disabled to keep the maximum |
| 18 | +// number of lines steppable. |
| 19 | +// |
| 20 | +// If `-Zmir-enable-passes=-...` ends up being annoying to maintain, we can try |
| 21 | +// switching to `-Zmir-opt-level=0` instead. |
| 22 | +// |
| 23 | +// [1]: https://github.com/rust-lang/compiler-team/issues/319 |
| 24 | +//@ revisions: opt-level-0 maximally-steppable |
| 25 | +//@ [maximally-steppable] compile-flags: -Zmir-enable-passes=-SingleUseConsts |
15 | 26 |
|
16 | 27 | // === GDB TESTS =================================================================================== |
17 | 28 |
|
|
20 | 31 | //@ gdb-command: next |
21 | 32 | //@ gdb-check: let d = c = 99; |
22 | 33 | //@ gdb-command: next |
23 | | -//@ [no-SingleUseConsts-mir-pass] gdb-check: let e = "hi bob"; |
24 | | -//@ [no-SingleUseConsts-mir-pass] gdb-command: next |
25 | | -//@ [no-SingleUseConsts-mir-pass] gdb-check: let f = b"hi bob"; |
26 | | -//@ [no-SingleUseConsts-mir-pass] gdb-command: next |
27 | | -//@ [no-SingleUseConsts-mir-pass] gdb-check: let g = b'9'; |
28 | | -//@ [no-SingleUseConsts-mir-pass] gdb-command: next |
| 34 | +//@ [maximally-steppable] gdb-check: let e = "hi bob"; |
| 35 | +//@ [maximally-steppable] gdb-command: next |
| 36 | +//@ [maximally-steppable] gdb-check: let f = b"hi bob"; |
| 37 | +//@ [maximally-steppable] gdb-command: next |
| 38 | +//@ [maximally-steppable] gdb-check: let g = b'9'; |
| 39 | +//@ [maximally-steppable] gdb-command: next |
29 | 40 | //@ gdb-check: let h = ["whatever"; 8]; |
30 | 41 | //@ gdb-command: next |
31 | 42 | //@ gdb-check: let i = [1,2,3,4]; |
|
61 | 72 | //@ lldb-check: [...]let d = c = 99;[...] |
62 | 73 | //@ lldb-command: next |
63 | 74 | //@ lldb-command: frame select |
64 | | -//@ [no-SingleUseConsts-mir-pass] lldb-check: [...]let e = "hi bob";[...] |
65 | | -//@ [no-SingleUseConsts-mir-pass] lldb-command: next |
66 | | -//@ [no-SingleUseConsts-mir-pass] lldb-command: frame select |
67 | | -//@ [no-SingleUseConsts-mir-pass] lldb-check: [...]let f = b"hi bob";[...] |
68 | | -//@ [no-SingleUseConsts-mir-pass] lldb-command: next |
69 | | -//@ [no-SingleUseConsts-mir-pass] lldb-command: frame select |
70 | | -//@ [no-SingleUseConsts-mir-pass] lldb-check: [...]let g = b'9';[...] |
71 | | -//@ [no-SingleUseConsts-mir-pass] lldb-command: next |
72 | | -//@ [no-SingleUseConsts-mir-pass] lldb-command: frame select |
| 75 | +//@ [maximally-steppable] lldb-check: [...]let e = "hi bob";[...] |
| 76 | +//@ [maximally-steppable] lldb-command: next |
| 77 | +//@ [maximally-steppable] lldb-command: frame select |
| 78 | +//@ [maximally-steppable] lldb-check: [...]let f = b"hi bob";[...] |
| 79 | +//@ [maximally-steppable] lldb-command: next |
| 80 | +//@ [maximally-steppable] lldb-command: frame select |
| 81 | +//@ [maximally-steppable] lldb-check: [...]let g = b'9';[...] |
| 82 | +//@ [maximally-steppable] lldb-command: next |
| 83 | +//@ [maximally-steppable] lldb-command: frame select |
73 | 84 | //@ lldb-check: [...]let h = ["whatever"; 8];[...] |
74 | 85 | //@ lldb-command: next |
75 | 86 | //@ lldb-command: frame select |
|
107 | 118 | //@ cdb-check: [...]: let mut c = 27; |
108 | 119 | //@ cdb-command: p |
109 | 120 | //@ cdb-check: [...]: let d = c = 99; |
110 | | -//@ [no-SingleUseConsts-mir-pass] cdb-command: p |
111 | | -//@ [no-SingleUseConsts-mir-pass] cdb-check: [...]: let e = "hi bob"; |
112 | | -//@ [no-SingleUseConsts-mir-pass] cdb-command: p |
113 | | -//@ [no-SingleUseConsts-mir-pass] cdb-check: [...]: let f = b"hi bob"; |
114 | | -//@ [no-SingleUseConsts-mir-pass] cdb-command: p |
115 | | -//@ [no-SingleUseConsts-mir-pass] cdb-check: [...]: let g = b'9'; |
| 121 | +//@ [maximally-steppable] cdb-command: p |
| 122 | +//@ [maximally-steppable] cdb-check: [...]: let e = "hi bob"; |
| 123 | +//@ [maximally-steppable] cdb-command: p |
| 124 | +//@ [maximally-steppable] cdb-check: [...]: let f = b"hi bob"; |
| 125 | +//@ [maximally-steppable] cdb-command: p |
| 126 | +//@ [maximally-steppable] cdb-check: [...]: let g = b'9'; |
116 | 127 | //@ cdb-command: p |
117 | 128 | //@ cdb-check: [...]: let h = ["whatever"; 8]; |
118 | 129 | //@ cdb-command: p |
|
0 commit comments