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