Matthias Krüger c505d760a6
Rollup merge of #119555 - Kobzol:maybeuninit-rvo-codegen-test, r=nikic
Add codegen test for RVO on MaybeUninit

Codegen test for https://github.com/rust-lang/rust/issues/90595. Currently, this only works with `-Cpanic=abort`, but hopefully in the [future](https://www.npopov.com/2024/01/01/This-year-in-LLVM-2023.html#writable-and-dead_on_unwind) it should also work in the presence of panics.

r? ``@nikic``
2024-01-04 08:33:26 +01:00
..
2023-03-20 10:25:29 +00:00
2023-07-27 14:44:13 -07:00
2023-01-17 16:23:22 +01:00
2023-07-29 18:34:41 -07:00
2023-12-24 20:08:58 +00:00
2023-09-02 13:42:58 +02:00
2023-07-27 14:44:13 -07:00
2023-08-07 14:11:03 +02:00
2023-01-11 20:42:13 -05:00
2023-01-17 16:23:22 +01:00
2023-01-17 16:23:22 +01:00
2023-07-27 14:44:13 -07:00
2023-07-27 14:44:13 -07:00
2023-07-27 14:44:13 -07:00
2023-07-27 14:44:13 -07:00
2023-10-20 21:14:01 +00:00
2023-07-27 14:44:13 -07:00
2023-10-08 16:45:45 +00:00
2023-05-11 14:35:10 +00:00
2023-07-27 14:44:13 -07:00
2023-07-08 15:38:40 +02:00
2023-01-17 16:23:22 +01:00
2023-11-11 19:48:47 -08:00
2023-07-27 14:44:13 -07:00
2023-07-27 14:44:13 -07:00
2023-07-27 14:44:13 -07:00
2023-05-08 03:55:41 -07:00
2023-04-17 09:16:07 +02:00
2023-07-27 14:44:13 -07:00
2023-07-27 14:44:13 -07:00
2023-01-17 16:23:22 +01:00
2023-01-17 16:23:22 +01:00
2023-07-27 14:44:13 -07:00
2023-07-27 14:44:13 -07:00
2023-08-17 18:28:33 +00:00
2023-07-27 14:44:13 -07:00
2023-07-27 14:44:13 -07:00
2023-07-27 14:44:13 -07:00
2023-07-08 15:38:40 +02:00
2023-07-27 14:44:13 -07:00
2023-01-17 16:23:22 +01: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