diff options
Diffstat (limited to 'tests/mir-opt/pre-codegen/spans.rs')
-rw-r--r-- | tests/mir-opt/pre-codegen/spans.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/mir-opt/pre-codegen/spans.rs b/tests/mir-opt/pre-codegen/spans.rs new file mode 100644 index 000000000..aa36648ce --- /dev/null +++ b/tests/mir-opt/pre-codegen/spans.rs @@ -0,0 +1,16 @@ +// skip-filecheck +// Test that the comments we emit in MIR opts are accurate. +// +// EMIT_MIR_FOR_EACH_PANIC_STRATEGY +// compile-flags: -Zmir-include-spans + +#![crate_type = "lib"] + +// EMIT_MIR spans.outer.PreCodegen.after.mir +pub fn outer(v: u8) -> u8 { + inner(&v) +} + +pub fn inner(x: &u8) -> u8 { + *x +} |