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

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

If multiple test revisions want to share some annotations, you can use a setup like this:

// revisions: aaa bbb ccc
// [bbb] filecheck-flags: --check-prefix=both
// [ccc] filecheck-flags: --check-prefix=both

Now aaa:, bbb:, ccc: annotations are only checked for those specific revisions, and both: annotations are checked for revisions bbb and ccc.