tree: f64e36ae15687f5c908a5da197a5b6f7993c7f4b [path history] [tgz]
  1. asm/
  2. auxiliary/
  3. avr/
  4. bounds-checking/
  5. cffi/
  6. compiletest-self-test/
  7. cross-crate-inlining/
  8. debug-accessibility/
  9. debuginfo-proc-macro/
  10. dllimports/
  11. enum/
  12. float/
  13. instrument-coverage/
  14. instrument-xray/
  15. intrinsics/
  16. issues/
  17. lib-optimizations/
  18. loongarch-abi/
  19. macos/
  20. meta-filecheck/
  21. naked-fn/
  22. non-terminate/
  23. patchable-function-entry/
  24. remap_path_prefix/
  25. repr/
  26. riscv-abi/
  27. sanitizer/
  28. simd/
  29. simd-intrinsic/
  30. src-hash-algorithm/
  31. unwind-abis/
  32. aarch64-softfloat.rs
  33. aarch64-struct-align-128.rs
  34. abi-efiapi.rs
  35. abi-main-signature-16bit-c-int.rs
  36. abi-main-signature-32bit-c-int.rs
  37. abi-repr-ext.rs
  38. abi-sysv64.rs
  39. abi-x86-interrupt.rs
  40. abi-x86_64_sysv.rs
  41. addr-of-mutate.rs
  42. adjustments.rs
  43. align-byval-alignment-mismatch.rs
  44. align-byval-vector.rs
  45. align-byval.rs
  46. align-enum.rs
  47. align-fn.rs
  48. align-offset.rs
  49. align-struct.rs
  50. alloc-optimisation.rs
  51. array-clone.rs
  52. array-cmp.rs
  53. array-codegen.rs
  54. array-equality.rs
  55. array-from_fn.rs
  56. array-map.rs
  57. array-optimized.rs
  58. array-repeat.rs
  59. ascii-char.rs
  60. async-closure-debug.rs
  61. async-fn-debug-awaitee-field.rs
  62. async-fn-debug-msvc.rs
  63. async-fn-debug.rs
  64. atomic-operations.rs
  65. atomicptr.rs
  66. autovectorize-f32x4.rs
  67. binary-heap-peek-mut-pop-no-panic.rs
  68. binary-search-index-no-bound-check.rs
  69. bool-cmp.rs
  70. box-uninit-bytes.rs
  71. bpf-alu32.rs
  72. branch-protection-old-llvm.rs
  73. branch-protection.rs
  74. call-llvm-intrinsics.rs
  75. call-metadata.rs
  76. cast-optimized.rs
  77. cast-target-abi.rs
  78. catch-unwind.rs
  79. cdylib-external-inline-fns.rs
  80. cf-protection.rs
  81. cfguard-checks.rs
  82. cfguard-disabled.rs
  83. cfguard-nochecks.rs
  84. cfguard-non-msvc.rs
  85. char-ascii-branchless.rs
  86. checked_ilog.rs
  87. checked_math.rs
  88. clone-shims.rs
  89. clone_as_copy.rs
  90. codemodels.rs
  91. coercions.rs
  92. cold-call-declare-and-call.rs
  93. common_prim_int_ptr.rs
  94. comparison-operators-2-tuple.rs
  95. comparison-operators-newtype.rs
  96. const-array.rs
  97. const-vector.rs
  98. const_scalar_pair.rs
  99. constant-branch.rs
  100. consts.rs
  101. coroutine-debug-msvc.rs
  102. coroutine-debug.rs
  103. dealloc-no-unwind.rs
  104. debug-alignment.rs
  105. debug-column-msvc.rs
  106. debug-column.rs
  107. debug-compile-unit-path.rs
  108. debug-fndef-size.rs
  109. debug-limited.rs
  110. debug-line-directives-only.rs
  111. debug-line-tables-only.rs
  112. debug-linkage-name.rs
  113. debug-vtable.rs
  114. debuginfo-constant-locals.rs
  115. debuginfo-generic-closure-env-names.rs
  116. debuginfo-inline-callsite-location.rs
  117. deduced-param-attrs.rs
  118. default-requires-uwtable.rs
  119. default-visibility.rs
  120. direct-access-external-data.rs
  121. dont_codegen_private_const_fn_only_used_in_const_eval.rs
  122. drop-in-place-noalias.rs
  123. drop.rs
  124. dst-offset.rs
  125. dst-vtable-align-nonzero.rs
  126. dst-vtable-size-range.rs
  127. ehcontguard_disabled.rs
  128. ehcontguard_enabled.rs
  129. emcripten-catch-unwind.rs
  130. enable-lto-unit-splitting.rs
  131. error-provide.rs
  132. export-no-mangle.rs
  133. external-no-mangle-fns.rs
  134. external-no-mangle-statics.rs
  135. fastcall-inreg.rs
  136. fatptr.rs
  137. fewer-names.rs
  138. fixed-x18.rs
  139. float_math.rs
  140. fn-impl-trait-self.rs
  141. force-frame-pointers.rs
  142. force-no-unwind-tables.rs
  143. force-unwind-tables.rs
  144. frame-pointer.rs
  145. function-arguments-noopt.rs
  146. function-arguments.rs
  147. function-return.rs
  148. gdb_debug_script_load.rs
  149. generic-debug.rs
  150. gep-index.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. naked-asan.rs
  191. no-alloca-inside-if-false.rs
  192. no-assumes-on-casts.rs
  193. no-dllimport-w-cross-lang-lto.rs
  194. no-jump-tables.rs
  195. no-plt.rs
  196. no-redundant-item-monomorphization.rs
  197. no_builtins-at-crate.rs
  198. noalias-box-off.rs
  199. noalias-box.rs
  200. noalias-flag.rs
  201. noalias-freeze.rs
  202. noalias-refcell.rs
  203. noalias-rwlockreadguard.rs
  204. noalias-unpin.rs
  205. noreturn-uninhabited.rs
  206. noreturnflag.rs
  207. nounwind.rs
  208. nrvo.rs
  209. optimize-attr-1.rs
  210. option-as-slice.rs
  211. option-niche-eq.rs
  212. overaligned-constant.rs
  213. packed.rs
  214. panic-abort-windows.rs
  215. panic-in-drop-abort.rs
  216. panic-unwind-default-uwtable.rs
  217. pattern_type_symbols.rs
  218. personality_lifetimes.rs
  219. pgo-counter-bias.rs
  220. pgo-instrumentation.rs
  221. pic-relocation-model.rs
  222. pie-relocation-model.rs
  223. placement-new.rs
  224. powerpc64le-struct-align-128.rs
  225. precondition-checks.rs
  226. ptr-arithmetic.rs
  227. ptr-read-metadata.rs
  228. range-attribute.rs
  229. range_to_inclusive.rs
  230. README.md
  231. refs.rs
  232. reg-struct-return.rs
  233. regparm-inreg.rs
  234. repeat-trusted-len.rs
  235. riscv-target-abi.rs
  236. rust-abi-arch-specific-adjustment.rs
  237. scalar-pair-bool.rs
  238. set-discriminant-invalid.rs
  239. skip-mono-inside-if-false.rs
  240. slice-as_chunks.rs
  241. slice-indexing.rs
  242. slice-init.rs
  243. slice-is-ascii.rs
  244. slice-iter-fold.rs
  245. slice-iter-len-eq-zero.rs
  246. slice-iter-nonnull.rs
  247. slice-pointer-nonnull-unwrap.rs
  248. slice-position-bounds-check.rs
  249. slice-ref-equality.rs
  250. slice-reverse.rs
  251. slice-windows-no-bounds-check.rs
  252. slice_as_from_ptr_range.rs
  253. some-abis-do-extend-params-to-32-bits.rs
  254. some-global-nonnull.rs
  255. sparc-struct-abi.rs
  256. split-lto-unit.rs
  257. sroa-fragment-debuginfo.rs
  258. sse42-implies-crc32.rs
  259. stack-probes-inline.rs
  260. stack-protector.rs
  261. static-relocation-model-msvc.rs
  262. staticlib-external-inline-fns.rs
  263. step_by-overflow-checks.rs
  264. stores.rs
  265. swap-large-types.rs
  266. swap-small-types.rs
  267. target-cpu-on-functions.rs
  268. target-feature-inline-closure.rs
  269. target-feature-overrides.rs
  270. thread-local.rs
  271. tied-features-strength.rs
  272. to_vec.rs
  273. trailing_zeros.rs
  274. transmute-optimized.rs
  275. transmute-scalar.rs
  276. try_question_mark_nop.rs
  277. tune-cpu-on-functions.rs
  278. tuple-layout-opt.rs
  279. ub-checks.rs
  280. unchecked-float-casts.rs
  281. unchecked_shifts.rs
  282. uninit-consts.rs
  283. union-abi.rs
  284. unwind-and-panic-abort.rs
  285. unwind-extern-exports.rs
  286. unwind-extern-imports.rs
  287. unwind-landingpad-cold.rs
  288. unwind-landingpad-inline.rs
  289. used_with_arg.rs
  290. var-names.rs
  291. vec-as-ptr.rs
  292. vec-calloc.rs
  293. vec-in-place.rs
  294. vec-iter-collect-len.rs
  295. vec-iter.rs
  296. vec-len-invariant.rs
  297. vec-optimizes-away.rs
  298. vec-reserve-extend.rs
  299. vec-shrink-panik.rs
  300. vec-with-capacity.rs
  301. vec_pop_push_noop.rs
  302. vecdeque-drain.rs
  303. vecdeque-nonempty-get-no-panic.rs
  304. vecdeque_no_panic.rs
  305. vecdeque_pop_push.rs
  306. virtual-function-elimination-32bit.rs
  307. virtual-function-elimination.rs
  308. vtable-loads.rs
  309. vtable-upcast.rs
  310. wasm_casts_trapping.rs
  311. wasm_exceptions.rs
  312. zip.rs
  313. 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