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