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