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