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