From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/mir-opt/README.md | 51 ---------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 src/test/mir-opt/README.md (limited to 'src/test/mir-opt/README.md') diff --git a/src/test/mir-opt/README.md b/src/test/mir-opt/README.md deleted file mode 100644 index 0721d9f70..000000000 --- a/src/test/mir-opt/README.md +++ /dev/null @@ -1,51 +0,0 @@ -This folder contains tests for MIR optimizations. - -The `mir-opt` test format emits MIR to extra files that you can automatically update by specifying -`--bless` on the command line (just like `ui` tests updating `.stderr` files). - -# `--bless`able test format - -By default 32 bit and 64 bit targets use the same dump files, which can be problematic in the -presence of pointers in constants or other bit width dependent things. In that case you can add - -``` -// EMIT_MIR_FOR_EACH_BIT_WIDTH -``` - -to your test, causing separate files to be generated for 32bit and 64bit systems. - -## Unit testing - -If you are only testing the behavior of a particular mir-opt pass on some specific input (as is -usually the case), you should add - -``` -// unit-test: PassName -``` - -to the top of the file. This makes sure that other passes don't run which means you'll get the input -you expected and your test won't break when other code changes. - -## Emit a diff of the mir for a specific optimization - -This is what you want most often when you want to see how an optimization changes the MIR. - -``` -// EMIT_MIR $file_name_of_some_mir_dump.diff -``` - -## Emit mir after a specific optimization - -Use this if you are just interested in the final state after an optimization. - -``` -// EMIT_MIR $file_name_of_some_mir_dump.after.mir -``` - -## Emit mir before a specific optimization - -This exists mainly for completeness and is rarely useful. - -``` -// EMIT_MIR $file_name_of_some_mir_dump.before.mir -``` -- cgit v1.2.3