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