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