tree: 66febe4822fcfbc9842e27b871187778b2bb005e [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-maybe-uninit.rs
  47. asm-multiple-options.rs
  48. asm-options.rs
  49. asm-powerpc-clobbers.rs
  50. asm-sanitize-llvm.rs
  51. asm-target-clobbers.rs
  52. async-fn-debug-awaitee-field.rs
  53. async-fn-debug-msvc.rs
  54. async-fn-debug.rs
  55. atomic-operations.rs
  56. autovectorize-f32x4.rs
  57. binary-search-index-no-bound-check.rs
  58. bool-cmp.rs
  59. box-uninit-bytes.rs
  60. bpf-alu32.rs
  61. branch-protection.rs
  62. call-llvm-intrinsics.rs
  63. call-metadata.rs
  64. catch-unwind.rs
  65. cdylib-external-inline-fns.rs
  66. cf-protection.rs
  67. cfguard-checks.rs
  68. cfguard-disabled.rs
  69. cfguard-nochecks.rs
  70. cfguard-non-msvc.rs
  71. codemodels.rs
  72. coercions.rs
  73. cold-call-declare-and-call.rs
  74. comparison-operators-2-tuple.rs
  75. comparison-operators-newtype.rs
  76. const_scalar_pair.rs
  77. consts.rs
  78. dealloc-no-unwind.rs
  79. debug-alignment.rs
  80. debug-column-msvc.rs
  81. debug-column.rs
  82. debug-compile-unit-path.rs
  83. debug-limited.rs
  84. debug-line-directives-only.rs
  85. debug-line-tables-only.rs
  86. debug-linkage-name.rs
  87. debug-vtable.rs
  88. debuginfo-constant-locals.rs
  89. debuginfo-generic-closure-env-names.rs
  90. deduced-param-attrs.rs
  91. default-requires-uwtable.rs
  92. drop-in-place-noalias.rs
  93. drop.rs
  94. dst-vtable-align-nonzero.rs
  95. dst-vtable-size-range.rs
  96. enable-lto-unit-splitting.rs
  97. export-no-mangle.rs
  98. external-no-mangle-fns.rs
  99. external-no-mangle-statics.rs
  100. fastcall-inreg.rs
  101. fatptr.rs
  102. fewer-names.rs
  103. float_math.rs
  104. fn-impl-trait-self.rs
  105. foo.s
  106. force-frame-pointers.rs
  107. force-no-unwind-tables.rs
  108. force-unwind-tables.rs
  109. frame-pointer.rs
  110. function-arguments-noopt.rs
  111. function-arguments.rs
  112. gdb_debug_script_load.rs
  113. generator-debug-msvc.rs
  114. generator-debug.rs
  115. generic-debug.rs
  116. global_asm.rs
  117. global_asm_include.rs
  118. global_asm_x2.rs
  119. inherit_overflow.rs
  120. inline-always-works-always.rs
  121. inline-debuginfo.rs
  122. inline-function-args-debug-info.rs
  123. inline-hint.rs
  124. instrument-coverage.rs
  125. instrument-mcount.rs
  126. integer-cmp.rs
  127. integer-overflow.rs
  128. internalize-closures.rs
  129. intrinsic-no-unnamed-attr.rs
  130. iter-repeat-n-trivial-drop.rs
  131. layout-size-checks.rs
  132. lifetime_start_end.rs
  133. link-dead-code.rs
  134. link_section.rs
  135. llvm-ident.rs
  136. loads.rs
  137. local-generics-in-exe-internalized.rs
  138. lto-removes-invokes.rs
  139. mainsubprogram.rs
  140. mainsubprogramstart.rs
  141. match-optimized.rs
  142. match-optimizes-away.rs
  143. match-unoptimized.rs
  144. mem-replace-big-type.rs
  145. mem-replace-simple-type.rs
  146. merge-functions.rs
  147. method-declaration.rs
  148. mir-inlined-line-numbers.rs
  149. mir_zst_stores.rs
  150. move-operands.rs
  151. no-assumes-on-casts.rs
  152. no-dllimport-w-cross-lang-lto.rs
  153. no-jump-tables.rs
  154. no-plt.rs
  155. no_builtins-at-crate.rs
  156. noalias-box-off.rs
  157. noalias-box.rs
  158. noalias-flag.rs
  159. noalias-refcell.rs
  160. noalias-rwlockreadguard.rs
  161. noalias-unpin.rs
  162. noreturn-uninhabited.rs
  163. noreturnflag.rs
  164. nounwind.rs
  165. nrvo.rs
  166. optimize-attr-1.rs
  167. option-as-slice.rs
  168. option-nonzero-eq.rs
  169. packed.rs
  170. panic-abort-windows.rs
  171. panic-in-drop-abort.rs
  172. panic-unwind-default-uwtable.rs
  173. personality_lifetimes.rs
  174. pgo-counter-bias.rs
  175. pgo-instrumentation.rs
  176. pic-relocation-model.rs
  177. pie-relocation-model.rs
  178. ptr-arithmetic.rs
  179. ptr-read-metadata.rs
  180. README.md
  181. refs.rs
  182. repeat-trusted-len.rs
  183. scalar-pair-bool.rs
  184. set-discriminant-invalid.rs
  185. slice-as_chunks.rs
  186. slice-indexing.rs
  187. slice-init.rs
  188. slice-iter-fold.rs
  189. slice-iter-len-eq-zero.rs
  190. slice-iter-nonnull.rs
  191. slice-position-bounds-check.rs
  192. slice-ref-equality.rs
  193. slice-reverse.rs
  194. slice-windows-no-bounds-check.rs
  195. slice_as_from_ptr_range.rs
  196. some-abis-do-extend-params-to-32-bits.rs
  197. some-global-nonnull.rs
  198. sparc-struct-abi.rs
  199. split-lto-unit.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