tree: 032d35d7b0d84aebac259d82933c09e90bf34281 [path history] [tgz]
  1. address-of/
  2. array-index-is-temporary/
  3. basic_assignment/
  4. box_expr/
  5. byte_slice/
  6. combine_array_len/
  7. const-promotion-extern-static/
  8. const_allocation/
  9. const_allocation2/
  10. const_allocation3/
  11. const_prop/
  12. const_prop_miscompile/
  13. copy_propagation/
  14. copy_propagation_arg/
  15. deaggregator_test/
  16. deaggregator_test_enum/
  17. deaggregator_test_enum_2/
  18. deaggregator_test_multiple/
  19. exponential-or/
  20. fn-ptr-shim/
  21. generator-drop-cleanup/
  22. generator-storage-dead-unwind/
  23. generator-tiny/
  24. graphviz/
  25. inline/
  26. instrument_coverage/
  27. issue-38669/
  28. issue-41110/
  29. issue-41697/
  30. issue-41888/
  31. issue-49232/
  32. issue-62289/
  33. issue-72181/
  34. issue-72181-1/
  35. issue-73223/
  36. loop_test/
  37. match-arm-scopes/
  38. match_false_edges/
  39. match_test/
  40. nll/
  41. no-drop-for-inactive-variant/
  42. no-spurious-drop-after-call/
  43. nrvo-simple/
  44. packed-struct-drop-aligned/
  45. remove-never-const/
  46. remove_fake_borrows/
  47. retag/
  48. simple-match/
  49. simplify-arm/
  50. simplify-arm-identity/
  51. simplify-locals-fixedpoint/
  52. simplify-locals-removes-unused-consts/
  53. simplify-locals-removes-unused-discriminant-reads/
  54. simplify_cfg/
  55. simplify_if/
  56. simplify_match/
  57. simplify_try/
  58. simplify_try_if_let/
  59. slice-drop-shim/
  60. storage_live_dead_in_statics/
  61. storage_ranges/
  62. tls-access/
  63. uniform_array_move_out/
  64. uninhabited-enum/
  65. uninhabited_enum_branching/
  66. unreachable/
  67. unreachable_asm/
  68. unreachable_asm_2/
  69. unreachable_diverging/
  70. unusual-item-types/
  71. while-storage/
  72. address-of.rs
  73. array-index-is-temporary.rs
  74. basic_assignment.rs
  75. box_expr.rs
  76. byte_slice.rs
  77. combine_array_len.rs
  78. const-promotion-extern-static.rs
  79. const_allocation.rs
  80. const_allocation2.rs
  81. const_allocation3.rs
  82. const_prop_miscompile.rs
  83. copy_propagation.rs
  84. copy_propagation_arg.rs
  85. deaggregator_test.rs
  86. deaggregator_test_enum.rs
  87. deaggregator_test_enum_2.rs
  88. deaggregator_test_multiple.rs
  89. exponential-or.rs
  90. fn-ptr-shim.rs
  91. generator-drop-cleanup.rs
  92. generator-storage-dead-unwind.rs
  93. generator-tiny.rs
  94. graphviz.rs
  95. instrument_coverage.rs
  96. issue-38669.rs
  97. issue-41110.rs
  98. issue-41697.rs
  99. issue-41888.rs
  100. issue-49232.rs
  101. issue-62289.rs
  102. issue-72181-1.rs
  103. issue-72181.rs
  104. issue-73223.rs
  105. loop_test.rs
  106. match-arm-scopes.rs
  107. match_false_edges.rs
  108. match_test.rs
  109. no-drop-for-inactive-variant.rs
  110. no-spurious-drop-after-call.rs
  111. nrvo-simple.rs
  112. packed-struct-drop-aligned.rs
  113. README.md
  114. remove-never-const.rs
  115. remove_fake_borrows.rs
  116. retag.rs
  117. return_an_array.rs
  118. simple-match.rs
  119. simplify-arm-identity.rs
  120. simplify-arm.rs
  121. simplify-locals-fixedpoint.rs
  122. simplify-locals-removes-unused-consts.rs
  123. simplify-locals-removes-unused-discriminant-reads.rs
  124. simplify_cfg.rs
  125. simplify_if.rs
  126. simplify_match.rs
  127. simplify_try.rs
  128. simplify_try_if_let.rs
  129. slice-drop-shim.rs
  130. storage_live_dead_in_statics.rs
  131. storage_ranges.rs
  132. tls-access.rs
  133. uniform_array_move_out.rs
  134. uninhabited-enum.rs
  135. uninhabited_enum_branching.rs
  136. unreachable.rs
  137. unreachable_asm.rs
  138. unreachable_asm_2.rs
  139. unreachable_diverging.rs
  140. unusual-item-types.rs
  141. while-storage.rs
src/test/mir-opt/README.md

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.

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