diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2023-06-25 23:39:02 +0200 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2023-07-02 13:41:36 +0200 |
| commit | 62728c7aaff0441b12057de8f1be620feb96652c (patch) | |
| tree | 30125a7c79dfd995b475e7fe6a411cfbc1eb713e /tests | |
| parent | 8882507bc7dbad0cc0548204eb8777e51ac92332 (diff) | |
| download | rust-62728c7aaff0441b12057de8f1be620feb96652c.tar.gz rust-62728c7aaff0441b12057de8f1be620feb96652c.zip | |
Add `rustc` option to output LLVM optimization remarks to YAML files
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run-make/optimization-remarks-dir/Makefile | 12 | ||||
| -rw-r--r-- | tests/run-make/optimization-remarks-dir/foo.rs | 6 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/run-make/optimization-remarks-dir/Makefile b/tests/run-make/optimization-remarks-dir/Makefile new file mode 100644 index 00000000000..a8342c8ad14 --- /dev/null +++ b/tests/run-make/optimization-remarks-dir/Makefile @@ -0,0 +1,12 @@ +include ../tools.mk + +PROFILE_DIR=$(TMPDIR)/profiles + +all: check_inline check_filter + +check_inline: + $(RUSTC) -O foo.rs --crate-type=lib -Cremark=all -Zremark-dir=$(PROFILE_DIR) + cat $(PROFILE_DIR)/*.opt.yaml | $(CGREP) -e "inline" +check_filter: + $(RUSTC) -O foo.rs --crate-type=lib -Cremark=foo -Zremark-dir=$(PROFILE_DIR) + cat $(PROFILE_DIR)/*.opt.yaml | $(CGREP) -e -v "inline" diff --git a/tests/run-make/optimization-remarks-dir/foo.rs b/tests/run-make/optimization-remarks-dir/foo.rs new file mode 100644 index 00000000000..6ac3af0dcad --- /dev/null +++ b/tests/run-make/optimization-remarks-dir/foo.rs @@ -0,0 +1,6 @@ +#[inline(never)] +pub fn bar() {} + +pub fn foo() { + bar(); +} |
