mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
2e6b57541d
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.
8 lines
210 B
Rust
8 lines
210 B
Rust
// Test for -Z llvm_module_flags
|
|
// compile-flags: -Z llvm_module_flag=foo:u32:123:error -Z llvm_module_flag=bar:u32:42:max
|
|
|
|
fn main() {}
|
|
|
|
// CHECK: !{i32 1, !"foo", i32 123}
|
|
// CHECK: !{i32 7, !"bar", i32 42}
|