Dylan DPC dbd090c655
Rollup merge of #110694 - est31:builtin, r=petrochenkov
Implement builtin # syntax and use it for offset_of!(...)

Add `builtin #` syntax to the parser, as well as a generic infrastructure to support both item and expression position builtin syntaxes. The PR also uses this infrastructure for the implementation of the `offset_of!` macro, added by #106934.

cc `@petrochenkov` `@DrMeepster`

cc #110680 `builtin #` tracking issue
cc #106655 `offset_of!` tracking issue
2023-05-09 12:33:45 +05:30
..
2023-04-06 10:08:07 +01:00
2023-04-06 09:34:17 +01:00
2023-04-06 10:08:07 +01:00
2023-05-08 03:55:41 -07:00
2023-04-22 23:41:48 +02:00
2023-04-25 19:53:09 +00:00
2023-05-08 03:55:41 -07:00
2023-04-24 16:16:14 +02:00
2023-03-03 16:33:12 +01:00
2023-05-06 23:22:32 -04:00
2023-01-27 18:22:44 +00:00
2023-02-08 02:04:07 +00:00
2023-04-06 10:08:07 +01:00
2023-04-06 10:08:07 +01:00
2023-04-06 09:34:17 +01:00
2023-04-06 09:34:17 +01:00
2023-04-06 10:08:07 +01:00
2023-04-06 10:08:07 +01:00
2023-04-06 10:08:07 +01:00
2023-05-08 03:55:41 -07:00
2023-04-06 10:08:07 +01:00
2023-04-06 10:08:07 +01:00
2023-04-06 10:08:07 +01:00
2023-01-27 18:22:45 +00:00
2023-04-25 19:53:09 +00:00
2023-04-06 10:08:07 +01:00
2023-04-06 10:08:07 +01:00

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).

--blessable 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