summaryrefslogtreecommitdiffstats
path: root/tests/ui/instrument-xray
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
commit4f9fe856a25ab29345b90e7725509e9ee38a37be (patch)
treee4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /tests/ui/instrument-xray
parentAdding upstream version 1.68.2+dfsg1. (diff)
downloadrustc-upstream/1.69.0+dfsg1.tar.xz
rustc-upstream/1.69.0+dfsg1.zip
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/ui/instrument-xray/flags-always-never-1.rs7
-rw-r--r--tests/ui/instrument-xray/flags-always-never-1.stderr2
-rw-r--r--tests/ui/instrument-xray/flags-always-never-2.rs9
-rw-r--r--tests/ui/instrument-xray/flags-basic.rs9
-rw-r--r--tests/ui/instrument-xray/flags-dupe-always.rs7
-rw-r--r--tests/ui/instrument-xray/flags-dupe-always.stderr2
-rw-r--r--tests/ui/instrument-xray/flags-dupe-ignore-loops.rs7
-rw-r--r--tests/ui/instrument-xray/flags-dupe-ignore-loops.stderr2
-rw-r--r--tests/ui/instrument-xray/target-not-supported.rs9
-rw-r--r--tests/ui/instrument-xray/target-not-supported.stderr4
10 files changed, 58 insertions, 0 deletions
diff --git a/tests/ui/instrument-xray/flags-always-never-1.rs b/tests/ui/instrument-xray/flags-always-never-1.rs
new file mode 100644
index 000000000..4dd43439e
--- /dev/null
+++ b/tests/ui/instrument-xray/flags-always-never-1.rs
@@ -0,0 +1,7 @@
+// Checks that `-Z instrument-xray` does not allow `always` and `never` simultaneously.
+//
+// needs-xray
+// compile-flags: -Z instrument-xray=always,never
+// error-pattern: incorrect value `always,never` for unstable option `instrument-xray`
+
+fn main() {}
diff --git a/tests/ui/instrument-xray/flags-always-never-1.stderr b/tests/ui/instrument-xray/flags-always-never-1.stderr
new file mode 100644
index 000000000..e211c6f60
--- /dev/null
+++ b/tests/ui/instrument-xray/flags-always-never-1.stderr
@@ -0,0 +1,2 @@
+error: incorrect value `always,never` for unstable option `instrument-xray` - either a boolean (`yes`, `no`, `on`, `off`, etc), or a comma separated list of settings: `always` or `never` (mutually exclusive), `ignore-loops`, `instruction-threshold=N`, `skip-entry`, `skip-exit` was expected
+
diff --git a/tests/ui/instrument-xray/flags-always-never-2.rs b/tests/ui/instrument-xray/flags-always-never-2.rs
new file mode 100644
index 000000000..7310aa0a0
--- /dev/null
+++ b/tests/ui/instrument-xray/flags-always-never-2.rs
@@ -0,0 +1,9 @@
+// Checks that `-Z instrument-xray` allows `always` and `never` sequentially.
+// (The last specified setting wins, like `-Z instrument-xray=no` as well.)
+//
+// needs-xray
+// compile-flags: -Z instrument-xray=always
+// compile-flags: -Z instrument-xray=never
+// check-pass
+
+fn main() {}
diff --git a/tests/ui/instrument-xray/flags-basic.rs b/tests/ui/instrument-xray/flags-basic.rs
new file mode 100644
index 000000000..b97f0dd8a
--- /dev/null
+++ b/tests/ui/instrument-xray/flags-basic.rs
@@ -0,0 +1,9 @@
+// Verifies basic `-Z instrument-xray` flags.
+//
+// needs-xray
+// compile-flags: -Z instrument-xray
+// compile-flags: -Z instrument-xray=skip-exit
+// compile-flags: -Z instrument-xray=ignore-loops,instruction-threshold=300
+// check-pass
+
+fn main() {}
diff --git a/tests/ui/instrument-xray/flags-dupe-always.rs b/tests/ui/instrument-xray/flags-dupe-always.rs
new file mode 100644
index 000000000..407f3e2aa
--- /dev/null
+++ b/tests/ui/instrument-xray/flags-dupe-always.rs
@@ -0,0 +1,7 @@
+// Checks that `-Z instrument-xray` does not allow duplicates.
+//
+// needs-xray
+// compile-flags: -Z instrument-xray=always,always
+// error-pattern: incorrect value `always,always` for unstable option `instrument-xray`
+
+fn main() {}
diff --git a/tests/ui/instrument-xray/flags-dupe-always.stderr b/tests/ui/instrument-xray/flags-dupe-always.stderr
new file mode 100644
index 000000000..d1ac113fa
--- /dev/null
+++ b/tests/ui/instrument-xray/flags-dupe-always.stderr
@@ -0,0 +1,2 @@
+error: incorrect value `always,always` for unstable option `instrument-xray` - either a boolean (`yes`, `no`, `on`, `off`, etc), or a comma separated list of settings: `always` or `never` (mutually exclusive), `ignore-loops`, `instruction-threshold=N`, `skip-entry`, `skip-exit` was expected
+
diff --git a/tests/ui/instrument-xray/flags-dupe-ignore-loops.rs b/tests/ui/instrument-xray/flags-dupe-ignore-loops.rs
new file mode 100644
index 000000000..75b210a65
--- /dev/null
+++ b/tests/ui/instrument-xray/flags-dupe-ignore-loops.rs
@@ -0,0 +1,7 @@
+// Checks that `-Z instrument-xray` does not allow duplicates.
+//
+// needs-xray
+// compile-flags: -Z instrument-xray=ignore-loops,ignore-loops
+// error-pattern: incorrect value `ignore-loops,ignore-loops` for unstable option `instrument-xray`
+
+fn main() {}
diff --git a/tests/ui/instrument-xray/flags-dupe-ignore-loops.stderr b/tests/ui/instrument-xray/flags-dupe-ignore-loops.stderr
new file mode 100644
index 000000000..52f6b3307
--- /dev/null
+++ b/tests/ui/instrument-xray/flags-dupe-ignore-loops.stderr
@@ -0,0 +1,2 @@
+error: incorrect value `ignore-loops,ignore-loops` for unstable option `instrument-xray` - either a boolean (`yes`, `no`, `on`, `off`, etc), or a comma separated list of settings: `always` or `never` (mutually exclusive), `ignore-loops`, `instruction-threshold=N`, `skip-entry`, `skip-exit` was expected
+
diff --git a/tests/ui/instrument-xray/target-not-supported.rs b/tests/ui/instrument-xray/target-not-supported.rs
new file mode 100644
index 000000000..e6bdd23e8
--- /dev/null
+++ b/tests/ui/instrument-xray/target-not-supported.rs
@@ -0,0 +1,9 @@
+// Verifies that `-Z instrument-xray` cannot be used with unsupported targets,
+//
+// needs-llvm-components: x86
+// compile-flags: -Z instrument-xray --target x86_64-apple-darwin
+// error-pattern: error: XRay instrumentation is not supported for this target
+
+#![feature(no_core)]
+#![no_core]
+#![no_main]
diff --git a/tests/ui/instrument-xray/target-not-supported.stderr b/tests/ui/instrument-xray/target-not-supported.stderr
new file mode 100644
index 000000000..6e3b0c8a3
--- /dev/null
+++ b/tests/ui/instrument-xray/target-not-supported.stderr
@@ -0,0 +1,4 @@
+error: XRay instrumentation is not supported for this target
+
+error: aborting due to previous error
+