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