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