tree: de7b5beae9a85a135719d19faaea7b277138251a [path history] [tgz]
  1. auxiliary/
  2. avr/
  3. cffi/
  4. dllimports/
  5. enum/
  6. instrument-xray/
  7. intrinsics/
  8. issues/
  9. loongarch-abi/
  10. macos/
  11. naked-fn/
  12. non-terminate/
  13. remap_path_prefix/
  14. repr/
  15. riscv-abi/
  16. sanitizer/
  17. simd/
  18. simd-intrinsic/
  19. src-hash-algorithm/
  20. unwind-abis/
  21. aarch64-struct-align-128.rs
  22. abi-efiapi.rs
  23. abi-main-signature-16bit-c-int.rs
  24. abi-main-signature-32bit-c-int.rs
  25. abi-repr-ext.rs
  26. abi-sysv64.rs
  27. abi-x86-interrupt.rs
  28. abi-x86_64_sysv.rs
  29. addr-of-mutate.rs
  30. adjustments.rs
  31. align-byval-vector.rs
  32. align-byval.rs
  33. align-enum.rs
  34. align-fn.rs
  35. align-offset.rs
  36. align-struct.rs
  37. alloc-optimisation.rs
  38. array-clone.rs
  39. array-codegen.rs
  40. array-equality.rs
  41. array-map.rs
  42. ascii-char.rs
  43. asm-clobber_abi.rs
  44. asm-clobbers.rs
  45. asm-may_unwind.rs
  46. asm-multiple-options.rs
  47. asm-options.rs
  48. asm-powerpc-clobbers.rs
  49. asm-sanitize-llvm.rs
  50. asm-target-clobbers.rs
  51. async-fn-debug-awaitee-field.rs
  52. async-fn-debug-msvc.rs
  53. async-fn-debug.rs
  54. atomic-operations.rs
  55. autovectorize-f32x4.rs
  56. binary-search-index-no-bound-check.rs
  57. bool-cmp.rs
  58. box-maybe-uninit.rs
  59. bpf-alu32.rs
  60. branch-protection.rs
  61. call-llvm-intrinsics.rs
  62. call-metadata.rs
  63. catch-unwind.rs
  64. cdylib-external-inline-fns.rs
  65. cf-protection.rs
  66. cfguard-checks.rs
  67. cfguard-disabled.rs
  68. cfguard-nochecks.rs
  69. cfguard-non-msvc.rs
  70. codemodels.rs
  71. coercions.rs
  72. cold-call-declare-and-call.rs
  73. comparison-operators-2-tuple.rs
  74. comparison-operators-newtype.rs
  75. const_scalar_pair.rs
  76. consts.rs
  77. dealloc-no-unwind.rs
  78. debug-alignment.rs
  79. debug-column-msvc.rs
  80. debug-column.rs
  81. debug-compile-unit-path.rs
  82. debug-limited.rs
  83. debug-line-directives-only.rs
  84. debug-line-tables-only.rs
  85. debug-linkage-name.rs
  86. debug-vtable.rs
  87. debuginfo-constant-locals.rs
  88. debuginfo-generic-closure-env-names.rs
  89. deduced-param-attrs.rs
  90. default-requires-uwtable.rs
  91. drop-in-place-noalias.rs
  92. drop.rs
  93. dst-vtable-align-nonzero.rs
  94. dst-vtable-size-range.rs
  95. enable-lto-unit-splitting.rs
  96. export-no-mangle.rs
  97. external-no-mangle-fns.rs
  98. external-no-mangle-statics.rs
  99. fastcall-inreg.rs
  100. fatptr.rs
  101. fewer-names.rs
  102. float_math.rs
  103. fn-impl-trait-self.rs
  104. foo.s
  105. force-frame-pointers.rs
  106. force-no-unwind-tables.rs
  107. force-unwind-tables.rs
  108. frame-pointer.rs
  109. function-arguments-noopt.rs
  110. function-arguments.rs
  111. gdb_debug_script_load.rs
  112. generator-debug-msvc.rs
  113. generator-debug.rs
  114. generic-debug.rs
  115. global_asm.rs
  116. global_asm_include.rs
  117. global_asm_x2.rs
  118. inherit_overflow.rs
  119. inline-always-works-always.rs
  120. inline-debuginfo.rs
  121. inline-function-args-debug-info.rs
  122. inline-hint.rs
  123. instrument-coverage.rs
  124. instrument-mcount.rs
  125. integer-cmp.rs
  126. integer-overflow.rs
  127. internalize-closures.rs
  128. intrinsic-no-unnamed-attr.rs
  129. iter-repeat-n-trivial-drop.rs
  130. layout-size-checks.rs
  131. lifetime_start_end.rs
  132. link-dead-code.rs
  133. link_section.rs
  134. llvm-ident.rs
  135. loads.rs
  136. local-generics-in-exe-internalized.rs
  137. lto-removes-invokes.rs
  138. mainsubprogram.rs
  139. mainsubprogramstart.rs
  140. match-optimized.rs
  141. match-optimizes-away.rs
  142. match-unoptimized.rs
  143. mem-replace-big-type.rs
  144. mem-replace-simple-type.rs
  145. merge-functions.rs
  146. method-declaration.rs
  147. mir-inlined-line-numbers.rs
  148. mir_zst_stores.rs
  149. move-operands.rs
  150. no-assumes-on-casts.rs
  151. no-dllimport-w-cross-lang-lto.rs
  152. no-jump-tables.rs
  153. no-plt.rs
  154. no_builtins-at-crate.rs
  155. noalias-box-off.rs
  156. noalias-box.rs
  157. noalias-flag.rs
  158. noalias-refcell.rs
  159. noalias-rwlockreadguard.rs
  160. noalias-unpin.rs
  161. noreturn-uninhabited.rs
  162. noreturnflag.rs
  163. nounwind.rs
  164. nrvo.rs
  165. optimize-attr-1.rs
  166. option-as-slice.rs
  167. option-nonzero-eq.rs
  168. packed.rs
  169. panic-abort-windows.rs
  170. panic-in-drop-abort.rs
  171. panic-unwind-default-uwtable.rs
  172. personality_lifetimes.rs
  173. pgo-counter-bias.rs
  174. pgo-instrumentation.rs
  175. pic-relocation-model.rs
  176. pie-relocation-model.rs
  177. ptr-arithmetic.rs
  178. ptr-read-metadata.rs
  179. README.md
  180. refs.rs
  181. repeat-trusted-len.rs
  182. scalar-pair-bool.rs
  183. set-discriminant-invalid.rs
  184. slice-as_chunks.rs
  185. slice-indexing.rs
  186. slice-init.rs
  187. slice-iter-fold.rs
  188. slice-iter-len-eq-zero.rs
  189. slice-iter-nonnull.rs
  190. slice-position-bounds-check.rs
  191. slice-ref-equality.rs
  192. slice-reverse.rs
  193. slice-windows-no-bounds-check.rs
  194. slice_as_from_ptr_range.rs
  195. some-abis-do-extend-params-to-32-bits.rs
  196. some-global-nonnull.rs
  197. sparc-struct-abi.rs
  198. split-lto-unit.rs
  199. sroa-fragment-debuginfo.rs
  200. sse42-implies-crc32.rs
  201. stack-probes-call.rs
  202. stack-probes-inline.rs
  203. stack-protector.rs
  204. static-relocation-model-msvc.rs
  205. staticlib-external-inline-fns.rs
  206. stores.rs
  207. swap-large-types.rs
  208. swap-small-types.rs
  209. target-cpu-on-functions.rs
  210. target-feature-inline-closure.rs
  211. target-feature-overrides.rs
  212. thread-local.rs
  213. tied-features-strength.rs
  214. to_vec.rs
  215. trailing_zeros.rs
  216. transmute-optimized.rs
  217. transmute-scalar.rs
  218. try_identity.rs
  219. try_question_mark_nop.rs
  220. tune-cpu-on-functions.rs
  221. tuple-layout-opt.rs
  222. unchecked-float-casts.rs
  223. unchecked_shifts.rs
  224. uninit-consts.rs
  225. union-abi.rs
  226. unwind-and-panic-abort.rs
  227. unwind-extern-exports.rs
  228. unwind-extern-imports.rs
  229. used_with_arg.rs
  230. var-names.rs
  231. vec-as-ptr.rs
  232. vec-calloc.rs
  233. vec-in-place.rs
  234. vec-iter-collect-len.rs
  235. vec-optimizes-away.rs
  236. vec-shrink-panik.rs
  237. vecdeque_no_panic.rs
  238. virtual-function-elimination-32bit.rs
  239. virtual-function-elimination.rs
  240. wasm_casts_trapping.rs
  241. wasm_exceptions.rs
  242. zip.rs
  243. zst-offset.rs
tests/codegen/README.md

The files here use the LLVM FileCheck framework, documented at https://llvm.org/docs/CommandGuide/FileCheck.html.

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:

// revisions: aaa bbb
// [bbb] compile-flags: --flags-for-bbb

After specifying those variations, you can write different expected, or explicitly unexpected output by using <prefix>-SAME: and <prefix>-NOT:, like so:

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