tree: c5acd4d07be59904ee180cc8852cfa88d0ee1a9c [path history] [tgz]
  1. auxiliary/
  2. avr/
  3. dllimports/
  4. intrinsics/
  5. non-terminate/
  6. remap_path_prefix/
  7. riscv-abi/
  8. simd-intrinsic/
  9. src-hash-algorithm/
  10. unwind-abis/
  11. abi-efiapi.rs
  12. abi-main-signature-16bit-c-int.rs
  13. abi-main-signature-32bit-c-int.rs
  14. abi-repr-ext.rs
  15. abi-sysv64.rs
  16. abi-x86-interrupt.rs
  17. abi-x86_64_sysv.rs
  18. adjustments.rs
  19. align-enum.rs
  20. align-fn.rs
  21. align-struct.rs
  22. alloc-optimisation.rs
  23. array-clone.rs
  24. array-equality.rs
  25. asm-clobber_abi.rs
  26. asm-clobbers.rs
  27. asm-may_unwind.rs
  28. asm-multiple-options.rs
  29. asm-options.rs
  30. asm-powerpc-clobbers.rs
  31. asm-sanitize-llvm.rs
  32. asm-target-clobbers.rs
  33. async-fn-debug-awaitee-field.rs
  34. async-fn-debug-msvc.rs
  35. async-fn-debug.rs
  36. atomic-operations.rs
  37. autovectorize-f32x4.rs
  38. binary-search-index-no-bound-check.rs
  39. bool-cmp.rs
  40. box-maybe-uninit-llvm14.rs
  41. box-maybe-uninit.rs
  42. bpf-alu32.rs
  43. branch-protection.rs
  44. c-variadic-copy.rs
  45. c-variadic-opt.rs
  46. c-variadic.rs
  47. call-llvm-intrinsics.rs
  48. call-metadata.rs
  49. catch-unwind.rs
  50. cdylib-external-inline-fns.rs
  51. cf-protection.rs
  52. cfguard-checks.rs
  53. cfguard-disabled.rs
  54. cfguard-nochecks.rs
  55. cfguard-non-msvc.rs
  56. codemodels.rs
  57. coercions.rs
  58. cold-call-declare-and-call.rs
  59. comparison-operators-newtype.rs
  60. consts.rs
  61. dealloc-no-unwind.rs
  62. debug-alignment.rs
  63. debug-column-msvc.rs
  64. debug-column.rs
  65. debug-compile-unit-path.rs
  66. debug-linkage-name.rs
  67. debug-vtable.rs
  68. debuginfo-generic-closure-env-names.rs
  69. deduced-param-attrs.rs
  70. default-requires-uwtable.rs
  71. drop.rs
  72. dst-vtable-align-nonzero.rs
  73. dst-vtable-size-range.rs
  74. enum-bounds-check-derived-idx.rs
  75. enum-bounds-check-issue-13926.rs
  76. enum-bounds-check-issue-82871.rs
  77. enum-bounds-check.rs
  78. enum-debug-clike.rs
  79. enum-debug-niche-2.rs
  80. enum-debug-niche.rs
  81. enum-debug-tagged.rs
  82. enum-discriminant-value.rs
  83. enum-match.rs
  84. export-no-mangle.rs
  85. external-no-mangle-fns.rs
  86. external-no-mangle-statics.rs
  87. fastcall-inreg.rs
  88. fatptr.rs
  89. fewer-names.rs
  90. ffi-const.rs
  91. ffi-out-of-bounds-loads.rs
  92. ffi-pure.rs
  93. ffi-returns-twice.rs
  94. float_math.rs
  95. fn-impl-trait-self.rs
  96. foo.s
  97. force-frame-pointers.rs
  98. force-no-unwind-tables.rs
  99. force-unwind-tables.rs
  100. frame-pointer.rs
  101. function-arguments-noopt.rs
  102. function-arguments.rs
  103. gdb_debug_script_load.rs
  104. generator-debug-msvc.rs
  105. generator-debug.rs
  106. generic-debug.rs
  107. global_asm.rs
  108. global_asm_include.rs
  109. global_asm_x2.rs
  110. i686-macosx-deployment-target.rs
  111. i686-no-macosx-deployment-target.rs
  112. inline-always-works-always.rs
  113. inline-debuginfo.rs
  114. inline-hint.rs
  115. instrument-coverage.rs
  116. instrument-mcount.rs
  117. integer-cmp.rs
  118. integer-overflow.rs
  119. internalize-closures.rs
  120. intrinsic-no-unnamed-attr.rs
  121. issue-103285-ptr-addr-overflow-check.rs
  122. issue-103840.rs
  123. issue-105386-ub-in-debuginfo.rs
  124. issue-13018.rs
  125. issue-15953.rs
  126. issue-27130.rs
  127. issue-32031.rs
  128. issue-32364.rs
  129. issue-34634.rs
  130. issue-34947-pow-i32.rs
  131. issue-37945.rs
  132. issue-44056-macos-tls-align.rs
  133. issue-45222.rs
  134. issue-45466.rs
  135. issue-45964-bounds-check-slice-pos.rs
  136. issue-47278.rs
  137. issue-47442.rs
  138. issue-56267-2.rs
  139. issue-56267.rs
  140. issue-56927.rs
  141. issue-58881.rs
  142. issue-59352.rs
  143. issue-69101-bounds-check.rs
  144. issue-73031.rs
  145. issue-73338-effecient-cmp.rs
  146. issue-73396-bounds-check-after-position.rs
  147. issue-73827-bounds-check-index-in-subexpr.rs
  148. issue-75525-bounds-checks.rs
  149. issue-75546.rs
  150. issue-75659.rs
  151. issue-77812.rs
  152. issue-81408-dllimport-thinlto-windows.rs
  153. issue-84268.rs
  154. issue-85872-multiple-reverse.rs
  155. issue-86106.rs
  156. issue-96274.rs
  157. issue-96497-slice-size-nowrap.rs
  158. issue-98156-const-arg-temp-lifetime.rs
  159. issue-98294-get-mut-copy-from-slice-opt.rs
  160. iter-repeat-n-trivial-drop.rs
  161. layout-size-checks.rs
  162. lifetime_start_end.rs
  163. link-dead-code.rs
  164. link_section.rs
  165. loads.rs
  166. local-generics-in-exe-internalized.rs
  167. lto-removes-invokes.rs
  168. mainsubprogram.rs
  169. mainsubprogramstart.rs
  170. match-optimized.rs
  171. match-optimizes-away.rs
  172. match-unoptimized.rs
  173. mem-replace-direct-memcpy.rs
  174. merge-functions.rs
  175. mir-inlined-line-numbers.rs
  176. mir_zst_stores.rs
  177. move-operands.rs
  178. naked-functions.rs
  179. naked-nocoverage.rs
  180. naked-noinline.rs
  181. no-assumes-on-casts.rs
  182. no-dllimport-w-cross-lang-lto.rs
  183. no-jump-tables.rs
  184. no-plt.rs
  185. noalias-box-off.rs
  186. noalias-box.rs
  187. noalias-flag.rs
  188. noalias-refcell.rs
  189. noalias-rwlockreadguard.rs
  190. noalias-unpin.rs
  191. noreturn-uninhabited.rs
  192. noreturnflag.rs
  193. nounwind.rs
  194. nrvo.rs
  195. optimize-attr-1.rs
  196. option-nonzero-eq.rs
  197. packed.rs
  198. panic-abort-windows.rs
  199. panic-in-drop-abort.rs
  200. panic-unwind-default-uwtable.rs
  201. personality_lifetimes.rs
  202. pgo-counter-bias.rs
  203. pgo-instrumentation.rs
  204. pic-relocation-model.rs
  205. pie-relocation-model.rs
  206. README.md
  207. refs.rs
  208. repeat-trusted-len.rs
  209. repr-transparent-aggregates-1.rs
  210. repr-transparent-aggregates-2.rs
  211. repr-transparent-aggregates-3.rs
  212. repr-transparent-sysv64.rs
  213. repr-transparent.rs
  214. sanitizer-cfi-add-canonical-jump-tables-flag.rs
  215. sanitizer-cfi-emit-type-checks.rs
  216. sanitizer-cfi-emit-type-metadata-id-itanium-cxx-abi.rs
  217. sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs
  218. sanitizer-kcfi-add-kcfi-flag.rs
  219. sanitizer-kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi.rs
  220. sanitizer-memory-track-orgins.rs
  221. sanitizer-no-sanitize-inlining.rs
  222. sanitizer-no-sanitize.rs
  223. sanitizer-recover.rs
  224. sanitizer_memtag_attr_check.rs
  225. sanitizer_scs_attr_check.rs
  226. scalar-pair-bool.rs
  227. set-discriminant-invalid.rs
  228. simd-wide-sum.rs
  229. simd_arith_offset.rs
  230. slice-as_chunks.rs
  231. slice-init.rs
  232. slice-iter-len-eq-zero.rs
  233. slice-position-bounds-check.rs
  234. slice-ref-equality.rs
  235. slice-reverse.rs
  236. slice-windows-no-bounds-check.rs
  237. slice_as_from_ptr_range.rs
  238. some-abis-do-extend-params-to-32-bits.rs
  239. some-global-nonnull.rs
  240. sparc-struct-abi.rs
  241. sse42-implies-crc32.rs
  242. stack-probes-call.rs
  243. stack-probes-inline.rs
  244. stack-protector.rs
  245. static-relocation-model-msvc.rs
  246. staticlib-external-inline-fns.rs
  247. stores.rs
  248. swap-large-types.rs
  249. swap-simd-types.rs
  250. swap-small-types.rs
  251. target-cpu-on-functions.rs
  252. target-feature-overrides.rs
  253. thread-local.rs
  254. to_vec.rs
  255. transmute-scalar.rs
  256. try_identity.rs
  257. try_question_mark_nop.rs
  258. tune-cpu-on-functions.rs
  259. tuple-layout-opt.rs
  260. unchecked-float-casts.rs
  261. unchecked_shifts.rs
  262. uninit-consts.rs
  263. union-abi.rs
  264. unpadded-simd.rs
  265. unwind-and-panic-abort.rs
  266. unwind-extern-exports.rs
  267. unwind-extern-imports.rs
  268. used_with_arg.rs
  269. var-names.rs
  270. vec-calloc-llvm14.rs
  271. vec-calloc.rs
  272. vec-in-place.rs
  273. vec-iter-collect-len.rs
  274. vec-optimizes-away.rs
  275. vec-shrink-panik.rs
  276. vecdeque_no_panic.rs
  277. virtual-function-elimination-32bit.rs
  278. virtual-function-elimination.rs
  279. wasm_casts_trapping.rs
  280. x86_64-macosx-deployment-target.rs
  281. x86_64-no-macosx-deployment-target.rs
  282. zip.rs
  283. 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