-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit 80e0448
authored
Rollup merge of #133736 - jieyouxu:needs-target-has-atomic, r=compiler-errors
Add `needs-target-has-atomic` directive
Before this PR, the test writer has to specify platforms and architectures by hand for targets that have differing atomic width support. `#[cfg(target_has_atomic="...")]` is not quite the same because (1) you may have to specify additional matchers manually which has to be maintained individually, and (2) the `#[cfg]` blocks does not communicate to compiletest that a test would be ignored for a given target.
This PR implements a `//@ needs-target-has-atomic` directive which admits a comma-separated list of required atomic widths that the target must satisfy in order for the test to run.
```
//@ needs-target-has-atomic: 8, 16, ptr
```
See <#87377>.
This PR supersedes #133095 and is co-authored by `@kei519,` because it was somewhat subtle, and it turned out easier to implement than to review.
rustc-dev-guide docs PR: rust-lang/rustc-dev-guide#2154 File tree
4 files changed
+106
-5
lines changed- src/tools/compiletest/src
- header
4 files changed
+106
-5
lines changedLines changed: 21 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | - | ||
1 | + | ||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
486 | 486 |
| |
487 | 487 |
| |
488 | 488 |
| |
489 | + | ||
490 | + | ||
491 | + | ||
489 | 492 |
| |
490 | 493 |
| |
491 | 494 |
| |
| |||
611 | 614 |
| |
612 | 615 |
| |
613 | 616 |
| |
617 | + | ||
618 | + | ||
619 | + | ||
620 | + | ||
621 | + | ||
622 | + | ||
623 | + | ||
624 | + | ||
625 | + | ||
626 | + | ||
627 | + | ||
614 | 628 |
| |
615 | 629 |
| |
616 | 630 |
| |
| |||
645 | 659 |
| |
646 | 660 |
| |
647 | 661 |
| |
662 | + | ||
663 | + | ||
664 | + | ||
665 | + | ||
666 | + | ||
667 | + | ||
648 | 668 |
| |
649 | 669 |
| |
650 | 670 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
153 | 153 |
| |
154 | 154 |
| |
155 | 155 |
| |
156 | + | ||
156 | 157 |
| |
157 | 158 |
| |
158 | 159 |
| |
|
Lines changed: 47 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | - | ||
1 | + | ||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
174 | - | ||
175 | - | ||
174 | + | ||
175 | + | ||
176 | 176 |
| |
177 | 177 |
| |
178 | 178 |
| |
179 | + | ||
180 | + | ||
181 | + | ||
182 | + | ||
183 | + | ||
184 | + | ||
185 | + | ||
186 | + | ||
187 | + | ||
188 | + | ||
189 | + | ||
190 | + | ||
191 | + | ||
192 | + | ||
193 | + | ||
194 | + | ||
195 | + | ||
196 | + | ||
197 | + | ||
198 | + | ||
199 | + | ||
200 | + | ||
201 | + | ||
202 | + | ||
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | ||
207 | + | ||
208 | + | ||
209 | + | ||
210 | + | ||
211 | + | ||
212 | + | ||
213 | + | ||
214 | + | ||
215 | + | ||
216 | + | ||
217 | + | ||
218 | + | ||
219 | + | ||
220 | + | ||
221 | + | ||
179 | 222 |
| |
180 | 223 |
| |
181 | 224 |
| |
| |||
193 | 236 |
| |
194 | 237 |
| |
195 | 238 |
| |
196 | - | ||
239 | + | ||
197 | 240 |
| |
198 | 241 |
| |
199 | 242 |
| |
|
Lines changed: 37 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
787 | 787 |
| |
788 | 788 |
| |
789 | 789 |
| |
790 | + | ||
791 | + | ||
792 | + | ||
793 | + | ||
794 | + | ||
795 | + | ||
796 | + | ||
797 | + | ||
798 | + | ||
799 | + | ||
800 | + | ||
801 | + | ||
802 | + | ||
803 | + | ||
804 | + | ||
805 | + | ||
806 | + | ||
807 | + | ||
808 | + | ||
809 | + | ||
810 | + | ||
811 | + | ||
812 | + | ||
813 | + | ||
814 | + | ||
815 | + | ||
816 | + | ||
817 | + | ||
818 | + | ||
819 | + | ||
820 | + | ||
821 | + | ||
822 | + | ||
823 | + | ||
824 | + | ||
825 | + | ||
826 | + |
0 commit comments