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