tree: e946fa1890f8ebc13776d0c0be5eb183358f4405 [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. emcripten-catch-unwind.rs
  123. enable-lto-unit-splitting.rs
  124. export-no-mangle.rs
  125. external-no-mangle-fns.rs
  126. external-no-mangle-statics.rs
  127. fastcall-inreg.rs
  128. fatptr.rs
  129. fewer-names.rs
  130. float_math.rs
  131. fn-impl-trait-self.rs
  132. foo.s
  133. force-frame-pointers.rs
  134. force-no-unwind-tables.rs
  135. force-unwind-tables.rs
  136. frame-pointer.rs
  137. function-arguments-noopt.rs
  138. function-arguments.rs
  139. function-return.rs
  140. gdb_debug_script_load.rs
  141. generic-debug.rs
  142. global_asm.rs
  143. global_asm_include.rs
  144. global_asm_x2.rs
  145. i128-x86-align.rs
  146. infallible-unwrap-in-opt-z.rs
  147. inherit_overflow.rs
  148. inline-always-works-always.rs
  149. inline-debuginfo.rs
  150. inline-function-args-debug-info.rs
  151. inline-hint.rs
  152. instrument-mcount.rs
  153. integer-cmp.rs
  154. integer-overflow.rs
  155. internalize-closures.rs
  156. intrinsic-no-unnamed-attr.rs
  157. is_val_statically_known.rs
  158. issue-97217.rs
  159. iter-repeat-n-trivial-drop.rs
  160. layout-size-checks.rs
  161. lifetime_start_end.rs
  162. link-dead-code.rs
  163. link_section.rs
  164. llvm-ident.rs
  165. llvm_module_flags.rs
  166. loads.rs
  167. local-generics-in-exe-internalized.rs
  168. lto-removes-invokes.rs
  169. mainsubprogram.rs
  170. mainsubprogramstart.rs
  171. match-optimized.rs
  172. match-optimizes-away.rs
  173. match-unoptimized.rs
  174. maybeuninit-rvo.rs
  175. mem-replace-big-type.rs
  176. mem-replace-simple-type.rs
  177. merge-functions.rs
  178. method-declaration.rs
  179. mir-inlined-line-numbers.rs
  180. mir_zst_stores.rs
  181. move-before-nocapture-ref-arg.rs
  182. move-operands.rs
  183. no-assumes-on-casts.rs
  184. no-dllimport-w-cross-lang-lto.rs
  185. no-jump-tables.rs
  186. no-plt.rs
  187. no-redundant-item-monomorphization.rs
  188. no_builtins-at-crate.rs
  189. noalias-box-off.rs
  190. noalias-box.rs
  191. noalias-flag.rs
  192. noalias-refcell.rs
  193. noalias-rwlockreadguard.rs
  194. noalias-unpin.rs
  195. noreturn-uninhabited.rs
  196. noreturnflag.rs
  197. nounwind.rs
  198. nrvo.rs
  199. optimize-attr-1.rs
  200. option-as-slice.rs
  201. option-niche-eq.rs
  202. overaligned-constant.rs
  203. packed.rs
  204. panic-abort-windows.rs
  205. panic-in-drop-abort.rs
  206. panic-unwind-default-uwtable.rs
  207. pattern_type_symbols.rs
  208. personality_lifetimes.rs
  209. pgo-counter-bias.rs
  210. pgo-instrumentation.rs
  211. pic-relocation-model.rs
  212. pie-relocation-model.rs
  213. powerpc64le-struct-align-128.rs
  214. precondition-checks.rs
  215. ptr-arithmetic.rs
  216. ptr-read-metadata.rs
  217. README.md
  218. refs.rs
  219. repeat-trusted-len.rs
  220. riscv-target-abi.rs
  221. scalar-pair-bool.rs
  222. set-discriminant-invalid.rs
  223. skip-mono-inside-if-false.rs
  224. slice-as_chunks.rs
  225. slice-indexing.rs
  226. slice-init.rs
  227. slice-iter-fold.rs
  228. slice-iter-len-eq-zero.rs
  229. slice-iter-nonnull.rs
  230. slice-position-bounds-check.rs
  231. slice-ref-equality.rs
  232. slice-reverse.rs
  233. slice-windows-no-bounds-check.rs
  234. slice_as_from_ptr_range.rs
  235. some-abis-do-extend-params-to-32-bits.rs
  236. some-global-nonnull.rs
  237. sparc-struct-abi.rs
  238. split-lto-unit.rs
  239. sroa-fragment-debuginfo.rs
  240. sse42-implies-crc32.rs
  241. stack-probes-inline.rs
  242. stack-protector.rs
  243. static-relocation-model-msvc.rs
  244. staticlib-external-inline-fns.rs
  245. step_by-overflow-checks.rs
  246. stores.rs
  247. swap-large-types.rs
  248. swap-small-types.rs
  249. target-cpu-on-functions.rs
  250. target-feature-inline-closure.rs
  251. target-feature-overrides.rs
  252. thin-lto.rs
  253. thread-local.rs
  254. tied-features-strength.rs
  255. to_vec.rs
  256. trailing_zeros.rs
  257. transmute-optimized.rs
  258. transmute-scalar.rs
  259. try_identity.rs
  260. try_question_mark_nop.rs
  261. tune-cpu-on-functions.rs
  262. tuple-layout-opt.rs
  263. ub-checks.rs
  264. unchecked-float-casts.rs
  265. unchecked_shifts.rs
  266. uninit-consts.rs
  267. union-abi.rs
  268. unwind-and-panic-abort.rs
  269. unwind-extern-exports.rs
  270. unwind-extern-imports.rs
  271. unwind-landingpad-cold.rs
  272. unwind-landingpad-inline.rs
  273. used_with_arg.rs
  274. var-names.rs
  275. vec-as-ptr.rs
  276. vec-calloc.rs
  277. vec-in-place.rs
  278. vec-iter-collect-len.rs
  279. vec-iter.rs
  280. vec-len-invariant.rs
  281. vec-optimizes-away.rs
  282. vec-reserve-extend.rs
  283. vec-shrink-panik.rs
  284. vec-with-capacity.rs
  285. vec_pop_push_noop.rs
  286. vecdeque-drain.rs
  287. vecdeque-nonempty-get-no-panic.rs
  288. vecdeque_no_panic.rs
  289. vecdeque_pop_push.rs
  290. virtual-function-elimination-32bit.rs
  291. virtual-function-elimination.rs
  292. vtable-upcast.rs
  293. wasm_casts_trapping.rs
  294. wasm_exceptions.rs
  295. zip.rs
  296. 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