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