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