mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 17:18:32 +03:00
Codegen tests for -Z instrument-xray
Let's add at least some tests to verify that this option is accepted and produces expected LLVM attributes. More tests can be added later with attribute support.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// Checks that `-Z instrument-xray` produces expected instrumentation.
|
||||
//
|
||||
// compile-flags: -Z instrument-xray=always
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// CHECK: attributes #{{.*}} "function-instrument"="xray-always"
|
||||
pub fn function() {}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Checks that `-Z instrument-xray` options can be specified multiple times.
|
||||
//
|
||||
// compile-flags: -Z instrument-xray=skip-exit
|
||||
// compile-flags: -Z instrument-xray=instruction-threshold=123
|
||||
// compile-flags: -Z instrument-xray=instruction-threshold=456
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// CHECK: attributes #{{.*}} "xray-instruction-threshold"="456" "xray-skip-exit"
|
||||
// CHECK-NOT: attributes #{{.*}} "xray-instruction-threshold"="123"
|
||||
pub fn function() {}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Checks that the last `-Z instrument-xray` option wins.
|
||||
//
|
||||
// compile-flags: -Z instrument-xray=always
|
||||
// compile-flags: -Z instrument-xray=never
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// CHECK: attributes #{{.*}} "function-instrument"="xray-never"
|
||||
// CHECK-NOT: attributes #{{.*}} "function-instrument"="xray-always"
|
||||
pub fn function() {}
|
||||
Reference in New Issue
Block a user