Files
rust/src/test/codegen
Yuki Okushi 785237d392 Rollup merge of #104435 - scottmcm:iter-repeat-n, r=thomcc
`VecDeque::resize` should re-use the buffer in the passed-in element

Today it always copies it for *every* appended element, but one of those clones is avoidable.

This adds `iter::repeat_n` (https://github.com/rust-lang/rust/issues/104434) as the primitive needed to do this.  If this PR is acceptable, I'll also use this in `Vec` rather than its custom `ExtendElement` type & infrastructure that is harder to share between multiple different containers:

https://github.com/rust-lang/rust/blob/101e1822c3e54e63996c8aaa014d55716f3937eb/library/alloc/src/vec/mod.rs#L2479-L2492
2022-11-20 13:15:59 +09:00
..
2022-11-03 11:17:42 -04:00
2022-11-05 18:05:45 +00:00
2022-07-01 17:45:13 +02:00
2022-08-31 18:24:55 +08:00
2022-05-17 07:11:29 -04:00
2021-12-12 11:20:03 +00:00
2021-12-12 11:20:03 +00:00
2021-03-14 01:46:00 +09:00
2022-02-19 17:29:56 +00:00
2022-09-13 19:18:24 +02:00
2022-09-13 19:18:24 +02:00
2021-12-12 11:20:03 +00:00
2022-08-31 18:24:55 +08:00
2022-07-01 17:45:13 +02:00
2022-06-15 18:38:26 -07:00
2021-08-03 07:59:59 -07:00
2022-05-13 12:08:54 -07:00
2022-04-20 09:25:47 +02:00
2022-07-01 17:45:13 +02:00
2022-07-01 17:45:13 +02:00
2022-08-31 18:24:55 +08:00
2022-10-14 12:57:56 +08:00

The files here use the LLVM FileCheck framework, documented at https://llvm.org/docs/CommandGuide/FileCheck.html.

One extension worth noting is the use of revisions as custom prefixes for FileCheck. If your codegen test has different behavior based on the chosen target or different compiler flags that you want to exercise, you can use a revisions annotation, like so:

// revisions: aaa bbb
// [bbb] compile-flags: --flags-for-bbb

After specifying those variations, you can write different expected, or explicitly unexpected output by using <prefix>-SAME: and <prefix>-NOT:, like so:

// CHECK: expected code
// aaa-SAME: emitted-only-for-aaa
// aaa-NOT:                        emitted-only-for-bbb
// bbb-NOT:  emitted-only-for-aaa
// bbb-SAME:                       emitted-only-for-bbb