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