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