bors 0b24479638 Auto merge of #116555 - paulmenage:llvm-module-flag, r=wesleywiser
Add -Z llvm_module_flag

Allow adding values to the `!llvm.module.flags` metadata for a generated module.  The syntax is

`-Z llvm_module_flag=<name>:<type>:<value>:<behavior>`

Currently only u32 values are supported but the type is required to be specified for forward compatibility.  The `behavior` element must match one of the named LLVM metadata behaviors.viors.

This flag is expected to be perma-unstable.
2023-11-15 16:54:31 +00:00
..
2023-07-27 14:44:13 -07:00
2023-07-29 18:34:41 -07:00
2023-09-02 13:42:58 +02:00
2023-07-27 14:44:13 -07:00
2023-11-09 10:40:55 -05:00
2023-08-07 14:11:03 +02: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-07-27 14:44:13 -07:00
2023-07-08 15:38:40 +02: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-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-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

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