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