Skip to content

Commit 11a999e

Browse files
committed
Duplicate tests for incremental spans mode.
1 parent 2e37ed8 commit 11a999e

30 files changed

+2532
-1096
lines changed

src/test/incremental/change_symbol_export_status.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
// revisions: rpass1 rpass2
1+
// revisions: rpass1 rpass2 rpass3 rpass4
22
// compile-flags: -Zquery-dep-graph
3+
// [rpass1]compile-flags: -Zincremental-ignore-spans
4+
// [rpass2]compile-flags: -Zincremental-ignore-spans
5+
// [rpass3]compile-flags: -Zincremental-relative-spans
6+
// [rpass4]compile-flags: -Zincremental-relative-spans
37

48
#![feature(rustc_attrs)]
5-
#![rustc_partition_codegened(module = "change_symbol_export_status-mod1", cfg = "rpass2")]
9+
#![rustc_partition_reused(module = "change_symbol_export_status-mod1", cfg = "rpass2")]
610
#![rustc_partition_reused(module = "change_symbol_export_status-mod2", cfg = "rpass2")]
11+
#![rustc_partition_reused(module = "change_symbol_export_status-mod1", cfg = "rpass4")]
12+
#![rustc_partition_reused(module = "change_symbol_export_status-mod2", cfg = "rpass4")]
713

814
// This test case makes sure that a change in symbol visibility is detected by
915
// our dependency tracking. We do this by changing a module's visibility to
@@ -13,13 +19,13 @@
1319
// even from an executable. Plain Rust functions are only exported from Rust
1420
// libraries, which our test infrastructure does not support.
1521

16-
#[cfg(rpass1)]
22+
#[cfg(any(rpass1,rpass3))]
1723
pub mod mod1 {
1824
#[no_mangle]
1925
pub fn foo() {}
2026
}
2127

22-
#[cfg(rpass2)]
28+
#[cfg(any(rpass2,rpass4))]
2329
mod mod1 {
2430
#[no_mangle]
2531
pub fn foo() {}

src/test/incremental/hashes/call_expressions.rs

+46-24
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66
// rev3 and make sure that the hash has not changed.
77

88
// build-pass (FIXME(62277): could be check-pass?)
9-
// revisions: cfail1 cfail2 cfail3
10-
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
9+
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
10+
// compile-flags: -Z query-dep-graph
11+
// [cfail1]compile-flags: -Zincremental-ignore-spans
12+
// [cfail2]compile-flags: -Zincremental-ignore-spans
13+
// [cfail3]compile-flags: -Zincremental-ignore-spans
14+
// [cfail4]compile-flags: -Zincremental-relative-spans
15+
// [cfail5]compile-flags: -Zincremental-relative-spans
16+
// [cfail6]compile-flags: -Zincremental-relative-spans
1117

1218

1319
#![allow(warnings)]
@@ -19,29 +25,33 @@ fn callee2(_x: u32, _y: i64) {}
1925

2026

2127
// Change Callee (Function)
22-
#[cfg(cfail1)]
28+
#[cfg(any(cfail1,cfail4))]
2329
pub fn change_callee_function() {
2430
callee1(1, 2)
2531
}
2632

27-
#[cfg(not(cfail1))]
33+
#[cfg(not(any(cfail1,cfail4)))]
2834
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
2935
#[rustc_clean(cfg="cfail3")]
36+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
37+
#[rustc_clean(cfg="cfail6")]
3038
pub fn change_callee_function() {
3139
callee2(1, 2)
3240
}
3341

3442

3543

3644
// Change Argument (Function)
37-
#[cfg(cfail1)]
45+
#[cfg(any(cfail1,cfail4))]
3846
pub fn change_argument_function() {
3947
callee1(1, 2)
4048
}
4149

42-
#[cfg(not(cfail1))]
50+
#[cfg(not(any(cfail1,cfail4)))]
4351
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
4452
#[rustc_clean(cfg="cfail3")]
53+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
54+
#[rustc_clean(cfg="cfail6")]
4555
pub fn change_argument_function() {
4656
callee1(1, 3)
4757
}
@@ -50,13 +60,15 @@ pub fn change_argument_function() {
5060

5161
// Change Callee Indirectly (Function)
5262
mod change_callee_indirectly_function {
53-
#[cfg(cfail1)]
63+
#[cfg(any(cfail1,cfail4))]
5464
use super::callee1 as callee;
55-
#[cfg(not(cfail1))]
65+
#[cfg(not(any(cfail1,cfail4)))]
5666
use super::callee2 as callee;
5767

5868
#[rustc_clean(except="hir_owner_nodes,typeck", cfg="cfail2")]
5969
#[rustc_clean(cfg="cfail3")]
70+
#[rustc_clean(except="hir_owner_nodes,typeck", cfg="cfail5")]
71+
#[rustc_clean(cfg="cfail6")]
6072
pub fn change_callee_indirectly_function() {
6173
callee(1, 2)
6274
}
@@ -70,15 +82,17 @@ impl Struct {
7082
}
7183

7284
// Change Callee (Method)
73-
#[cfg(cfail1)]
85+
#[cfg(any(cfail1,cfail4))]
7486
pub fn change_callee_method() {
7587
let s = Struct;
7688
s.method1('x', true);
7789
}
7890

79-
#[cfg(not(cfail1))]
91+
#[cfg(not(any(cfail1,cfail4)))]
8092
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
8193
#[rustc_clean(cfg="cfail3")]
94+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
95+
#[rustc_clean(cfg="cfail6")]
8296
pub fn change_callee_method() {
8397
let s = Struct;
8498
s.method2('x', true);
@@ -87,15 +101,17 @@ pub fn change_callee_method() {
87101

88102

89103
// Change Argument (Method)
90-
#[cfg(cfail1)]
104+
#[cfg(any(cfail1,cfail4))]
91105
pub fn change_argument_method() {
92106
let s = Struct;
93107
s.method1('x', true);
94108
}
95109

96-
#[cfg(not(cfail1))]
110+
#[cfg(not(any(cfail1,cfail4)))]
97111
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
98112
#[rustc_clean(cfg="cfail3")]
113+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
114+
#[rustc_clean(cfg="cfail6")]
99115
pub fn change_argument_method() {
100116
let s = Struct;
101117
s.method1('y', true);
@@ -104,15 +120,17 @@ pub fn change_argument_method() {
104120

105121

106122
// Change Callee (Method, UFCS)
107-
#[cfg(cfail1)]
123+
#[cfg(any(cfail1,cfail4))]
108124
pub fn change_ufcs_callee_method() {
109125
let s = Struct;
110126
Struct::method1(&s, 'x', true);
111127
}
112128

113-
#[cfg(not(cfail1))]
129+
#[cfg(not(any(cfail1,cfail4)))]
114130
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
115131
#[rustc_clean(cfg="cfail3")]
132+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
133+
#[rustc_clean(cfg="cfail6")]
116134
pub fn change_ufcs_callee_method() {
117135
let s = Struct;
118136
Struct::method2(&s, 'x', true);
@@ -121,32 +139,36 @@ pub fn change_ufcs_callee_method() {
121139

122140

123141
// Change Argument (Method, UFCS)
124-
#[cfg(cfail1)]
142+
#[cfg(any(cfail1,cfail4))]
125143
pub fn change_argument_method_ufcs() {
126144
let s = Struct;
127145
Struct::method1(&s, 'x', true);
128146
}
129147

130-
#[cfg(not(cfail1))]
148+
#[cfg(not(any(cfail1,cfail4)))]
131149
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
132150
#[rustc_clean(cfg="cfail3")]
151+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
152+
#[rustc_clean(cfg="cfail6")]
133153
pub fn change_argument_method_ufcs() {
134154
let s = Struct;
135-
Struct::method1(&s, 'x', false);
155+
Struct::method1(&s, 'x',false);
136156
}
137157

138158

139159

140160
// Change To UFCS
141-
#[cfg(cfail1)]
161+
#[cfg(any(cfail1,cfail4))]
142162
pub fn change_to_ufcs() {
143163
let s = Struct;
144-
s.method1('x', true);
164+
s.method1('x', true); // ------
145165
}
146166

147-
#[cfg(not(cfail1))]
167+
#[cfg(not(any(cfail1,cfail4)))]
148168
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
149169
#[rustc_clean(cfg="cfail3")]
170+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
171+
#[rustc_clean(cfg="cfail6")]
150172
// One might think this would be expanded in the hir_owner_nodes/Mir, but it actually
151173
// results in slightly different hir_owner/Mir.
152174
pub fn change_to_ufcs() {
@@ -162,15 +184,15 @@ impl Struct2 {
162184

163185
// Change UFCS Callee Indirectly
164186
pub mod change_ufcs_callee_indirectly {
165-
#[cfg(cfail1)]
187+
#[cfg(any(cfail1,cfail4))]
166188
use super::Struct as Struct;
167-
#[cfg(not(cfail1))]
189+
#[cfg(not(any(cfail1,cfail4)))]
168190
use super::Struct2 as Struct;
169191

170192
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
171193
#[rustc_clean(cfg="cfail3")]
172-
173-
194+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
195+
#[rustc_clean(cfg="cfail6")]
174196
pub fn change_ufcs_callee_indirectly() {
175197
let s = Struct;
176198
Struct::method1(&s, 'q', false)

src/test/incremental/hashes/closure_expressions.rs

+36-18
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,49 @@
66
// rev3 and make sure that the hash has not changed.
77

88
// build-pass (FIXME(62277): could be check-pass?)
9-
// revisions: cfail1 cfail2 cfail3
10-
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans -Zmir-opt-level=0
9+
// revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
10+
// compile-flags: -Z query-dep-graph -Zmir-opt-level=0
11+
// [cfail1]compile-flags: -Zincremental-ignore-spans
12+
// [cfail2]compile-flags: -Zincremental-ignore-spans
13+
// [cfail3]compile-flags: -Zincremental-ignore-spans
14+
// [cfail4]compile-flags: -Zincremental-relative-spans
15+
// [cfail5]compile-flags: -Zincremental-relative-spans
16+
// [cfail6]compile-flags: -Zincremental-relative-spans
1117

1218
#![allow(warnings)]
1319
#![feature(rustc_attrs)]
1420
#![crate_type="rlib"]
1521

1622

1723
// Change closure body
18-
#[cfg(cfail1)]
24+
#[cfg(any(cfail1,cfail4))]
1925
pub fn change_closure_body() {
2026
let _ = || 1u32;
2127
}
2228

23-
#[cfg(not(cfail1))]
29+
#[cfg(not(any(cfail1,cfail4)))]
2430
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
2531
#[rustc_clean(cfg="cfail3")]
32+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
33+
#[rustc_clean(cfg="cfail6")]
2634
pub fn change_closure_body() {
2735
let _ = || 3u32;
2836
}
2937

3038

3139

3240
// Add parameter
33-
#[cfg(cfail1)]
41+
#[cfg(any(cfail1,cfail4))]
3442
pub fn add_parameter() {
3543
let x = 0u32;
36-
let _ = || x + 1;
44+
let _ = | | x + 1;
3745
}
3846

39-
#[cfg(not(cfail1))]
47+
#[cfg(not(any(cfail1,cfail4)))]
4048
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir, typeck")]
4149
#[rustc_clean(cfg="cfail3")]
50+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir, typeck")]
51+
#[rustc_clean(cfg="cfail6")]
4252
pub fn add_parameter() {
4353
let x = 0u32;
4454
let _ = |x: u32| x + 1;
@@ -47,45 +57,51 @@ pub fn add_parameter() {
4757

4858

4959
// Change parameter pattern
50-
#[cfg(cfail1)]
60+
#[cfg(any(cfail1,cfail4))]
5161
pub fn change_parameter_pattern() {
52-
let _ = |x: (u32,)| x;
62+
let _ = | x : (u32,)| x;
5363
}
5464

55-
#[cfg(not(cfail1))]
65+
#[cfg(not(any(cfail1,cfail4)))]
5666
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, typeck, optimized_mir")]
5767
#[rustc_clean(cfg="cfail3")]
68+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes, typeck, optimized_mir")]
69+
#[rustc_clean(cfg="cfail6")]
5870
pub fn change_parameter_pattern() {
5971
let _ = |(x,): (u32,)| x;
6072
}
6173

6274

6375

6476
// Add `move` to closure
65-
#[cfg(cfail1)]
77+
#[cfg(any(cfail1,cfail4))]
6678
pub fn add_move() {
67-
let _ = || 1;
79+
let _ = || 1;
6880
}
6981

70-
#[cfg(not(cfail1))]
82+
#[cfg(not(any(cfail1,cfail4)))]
7183
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
7284
#[rustc_clean(cfg="cfail3")]
85+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
86+
#[rustc_clean(cfg="cfail6")]
7387
pub fn add_move() {
7488
let _ = move || 1;
7589
}
7690

7791

7892

7993
// Add type ascription to parameter
80-
#[cfg(cfail1)]
94+
#[cfg(any(cfail1,cfail4))]
8195
pub fn add_type_ascription_to_parameter() {
82-
let closure = |x| x + 1u32;
96+
let closure = |x | x + 1u32;
8397
let _: u32 = closure(1);
8498
}
8599

86-
#[cfg(not(cfail1))]
100+
#[cfg(not(any(cfail1,cfail4)))]
87101
#[rustc_clean(cfg = "cfail2", except = "hir_owner_nodes, typeck")]
88102
#[rustc_clean(cfg = "cfail3")]
103+
#[rustc_clean(cfg = "cfail5", except = "hir_owner_nodes, typeck")]
104+
#[rustc_clean(cfg = "cfail6")]
89105
pub fn add_type_ascription_to_parameter() {
90106
let closure = |x: u32| x + 1u32;
91107
let _: u32 = closure(1);
@@ -94,15 +110,17 @@ pub fn add_type_ascription_to_parameter() {
94110

95111

96112
// Change parameter type
97-
#[cfg(cfail1)]
113+
#[cfg(any(cfail1,cfail4))]
98114
pub fn change_parameter_type() {
99115
let closure = |x: u32| (x as u64) + 1;
100116
let _ = closure(1);
101117
}
102118

103-
#[cfg(not(cfail1))]
119+
#[cfg(not(any(cfail1,cfail4)))]
104120
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir, typeck")]
105121
#[rustc_clean(cfg="cfail3")]
122+
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir, typeck")]
123+
#[rustc_clean(cfg="cfail6")]
106124
pub fn change_parameter_type() {
107125
let closure = |x: u16| (x as u64) + 1;
108126
let _ = closure(1);

src/test/incremental/hashes/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// build-pass (FIXME(62277): could be check-pass?)
99
// revisions: cfail1 cfail2 cfail3
10-
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
10+
// compile-flags: -Z query-dep-graph
1111

1212
#![allow(warnings)]
1313
#![feature(rustc_attrs)]

0 commit comments

Comments
 (0)