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