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