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