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