From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/codegen/README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/codegen/README.md (limited to 'tests/codegen/README.md') diff --git a/tests/codegen/README.md b/tests/codegen/README.md new file mode 100644 index 000000000..8f2daaafc --- /dev/null +++ b/tests/codegen/README.md @@ -0,0 +1,24 @@ +The files here use the LLVM FileCheck framework, documented at +. + +One extension worth noting is the use of revisions as custom prefixes for +FileCheck. If your codegen test has different behavior based on the chosen +target or different compiler flags that you want to exercise, you can use a +revisions annotation, like so: + +```rust +// revisions: aaa bbb +// [bbb] compile-flags: --flags-for-bbb +``` + +After specifying those variations, you can write different expected, or +explicitly *unexpected* output by using `-SAME:` and `-NOT:`, +like so: + +```rust +// CHECK: expected code +// aaa-SAME: emitted-only-for-aaa +// aaa-NOT: emitted-only-for-bbb +// bbb-NOT: emitted-only-for-aaa +// bbb-SAME: emitted-only-for-bbb +``` -- cgit v1.2.3