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