neq.carbon 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/bool/neq.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/bool/neq.carbon
  10. // --- builtin_call.carbon
  11. library "[[@TEST_NAME]]";
  12. fn Neq(a: bool, b: bool) -> bool = "bool.neq";
  13. class C(B:! bool) {}
  14. fn True() -> C(true);
  15. fn False() -> C(false);
  16. var a: C(Neq(true, true)) = False();
  17. var b: C(Neq(true, false)) = True();
  18. var c: C(Neq(false, true)) = True();
  19. var d: C(Neq(false, false)) = False();
  20. // --- prelude.carbon
  21. library "[[@TEST_NAME]]";
  22. class C(B:! bool) {}
  23. fn True() -> C(true);
  24. fn False() -> C(false);
  25. var a: C(true != true) = False();
  26. var b: C(true != false) = True();
  27. var c: C(false != true) = True();
  28. var d: C(false != false) = False();
  29. // CHECK:STDOUT: --- builtin_call.carbon
  30. // CHECK:STDOUT:
  31. // CHECK:STDOUT: constants {
  32. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  33. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  34. // CHECK:STDOUT: %Neq.type: type = fn_type @Neq [template]
  35. // CHECK:STDOUT: %Neq: %Neq.type = struct_value () [template]
  36. // CHECK:STDOUT: %B: bool = bind_symbolic_name B, 0 [symbolic]
  37. // CHECK:STDOUT: %B.patt: bool = symbolic_binding_pattern B, 0 [symbolic]
  38. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  39. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  40. // CHECK:STDOUT: %C.342: type = class_type @C, @C(%B) [symbolic]
  41. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  42. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  43. // CHECK:STDOUT: %true: bool = bool_literal true [template]
  44. // CHECK:STDOUT: %C.a14: type = class_type @C, @C(%true) [template]
  45. // CHECK:STDOUT: %True.type: type = fn_type @True [template]
  46. // CHECK:STDOUT: %True: %True.type = struct_value () [template]
  47. // CHECK:STDOUT: %false: bool = bool_literal false [template]
  48. // CHECK:STDOUT: %C.2ba: type = class_type @C, @C(%false) [template]
  49. // CHECK:STDOUT: %False.type: type = fn_type @False [template]
  50. // CHECK:STDOUT: %False: %False.type = struct_value () [template]
  51. // CHECK:STDOUT: }
  52. // CHECK:STDOUT:
  53. // CHECK:STDOUT: imports {
  54. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  55. // CHECK:STDOUT: .Bool = %import_ref
  56. // CHECK:STDOUT: import Core//prelude
  57. // CHECK:STDOUT: import Core//prelude/...
  58. // CHECK:STDOUT: }
  59. // CHECK:STDOUT: }
  60. // CHECK:STDOUT:
  61. // CHECK:STDOUT: file {
  62. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  63. // CHECK:STDOUT: .Core = imports.%Core
  64. // CHECK:STDOUT: .Neq = %Neq.decl
  65. // CHECK:STDOUT: .C = %C.decl
  66. // CHECK:STDOUT: .True = %True.decl
  67. // CHECK:STDOUT: .False = %False.decl
  68. // CHECK:STDOUT: .a = %a
  69. // CHECK:STDOUT: .b = %b
  70. // CHECK:STDOUT: .c = %c
  71. // CHECK:STDOUT: .d = %d
  72. // CHECK:STDOUT: }
  73. // CHECK:STDOUT: %Core.import = import Core
  74. // CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] {
  75. // CHECK:STDOUT: %a.patt: bool = binding_pattern a
  76. // CHECK:STDOUT: %a.param_patt: bool = value_param_pattern %a.patt, runtime_param0
  77. // CHECK:STDOUT: %b.patt: bool = binding_pattern b
  78. // CHECK:STDOUT: %b.param_patt: bool = value_param_pattern %b.patt, runtime_param1
  79. // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
  80. // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2
  81. // CHECK:STDOUT: } {
  82. // CHECK:STDOUT: %bool.make_type.loc4_29: init type = call constants.%Bool() [template = bool]
  83. // CHECK:STDOUT: %.loc4_29.1: type = value_of_initializer %bool.make_type.loc4_29 [template = bool]
  84. // CHECK:STDOUT: %.loc4_29.2: type = converted %bool.make_type.loc4_29, %.loc4_29.1 [template = bool]
  85. // CHECK:STDOUT: %a.param: bool = value_param runtime_param0
  86. // CHECK:STDOUT: %.loc4_11.1: type = splice_block %.loc4_11.3 [template = bool] {
  87. // CHECK:STDOUT: %bool.make_type.loc4_11: init type = call constants.%Bool() [template = bool]
  88. // CHECK:STDOUT: %.loc4_11.2: type = value_of_initializer %bool.make_type.loc4_11 [template = bool]
  89. // CHECK:STDOUT: %.loc4_11.3: type = converted %bool.make_type.loc4_11, %.loc4_11.2 [template = bool]
  90. // CHECK:STDOUT: }
  91. // CHECK:STDOUT: %a: bool = bind_name a, %a.param
  92. // CHECK:STDOUT: %b.param: bool = value_param runtime_param1
  93. // CHECK:STDOUT: %.loc4_20.1: type = splice_block %.loc4_20.3 [template = bool] {
  94. // CHECK:STDOUT: %bool.make_type.loc4_20: init type = call constants.%Bool() [template = bool]
  95. // CHECK:STDOUT: %.loc4_20.2: type = value_of_initializer %bool.make_type.loc4_20 [template = bool]
  96. // CHECK:STDOUT: %.loc4_20.3: type = converted %bool.make_type.loc4_20, %.loc4_20.2 [template = bool]
  97. // CHECK:STDOUT: }
  98. // CHECK:STDOUT: %b: bool = bind_name b, %b.param
  99. // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2
  100. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  101. // CHECK:STDOUT: }
  102. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  103. // CHECK:STDOUT: %B.patt.loc6_9.1: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)]
  104. // CHECK:STDOUT: %B.param_patt: bool = value_param_pattern %B.patt.loc6_9.1, runtime_param<invalid> [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)]
  105. // CHECK:STDOUT: } {
  106. // CHECK:STDOUT: %B.param: bool = value_param runtime_param<invalid>
  107. // CHECK:STDOUT: %.loc6_13.1: type = splice_block %.loc6_13.3 [template = bool] {
  108. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  109. // CHECK:STDOUT: %.loc6_13.2: type = value_of_initializer %bool.make_type [template = bool]
  110. // CHECK:STDOUT: %.loc6_13.3: type = converted %bool.make_type, %.loc6_13.2 [template = bool]
  111. // CHECK:STDOUT: }
  112. // CHECK:STDOUT: %B.loc6_9.1: bool = bind_symbolic_name B, 0, %B.param [symbolic = %B.loc6_9.2 (constants.%B)]
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT: %True.decl: %True.type = fn_decl @True [template = constants.%True] {
  115. // CHECK:STDOUT: %return.patt: %C.a14 = return_slot_pattern
  116. // CHECK:STDOUT: %return.param_patt: %C.a14 = out_param_pattern %return.patt, runtime_param0
  117. // CHECK:STDOUT: } {
  118. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  119. // CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true]
  120. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%true) [template = constants.%C.a14]
  121. // CHECK:STDOUT: %return.param: ref %C.a14 = out_param runtime_param0
  122. // CHECK:STDOUT: %return: ref %C.a14 = return_slot %return.param
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT: %False.decl: %False.type = fn_decl @False [template = constants.%False] {
  125. // CHECK:STDOUT: %return.patt: %C.2ba = return_slot_pattern
  126. // CHECK:STDOUT: %return.param_patt: %C.2ba = out_param_pattern %return.patt, runtime_param0
  127. // CHECK:STDOUT: } {
  128. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  129. // CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false]
  130. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%false) [template = constants.%C.2ba]
  131. // CHECK:STDOUT: %return.param: ref %C.2ba = out_param runtime_param0
  132. // CHECK:STDOUT: %return: ref %C.2ba = return_slot %return.param
  133. // CHECK:STDOUT: }
  134. // CHECK:STDOUT: %a.var: ref %C.2ba = var a
  135. // CHECK:STDOUT: %a: ref %C.2ba = bind_name a, %a.var
  136. // CHECK:STDOUT: %b.var: ref %C.a14 = var b
  137. // CHECK:STDOUT: %b: ref %C.a14 = bind_name b, %b.var
  138. // CHECK:STDOUT: %c.var: ref %C.a14 = var c
  139. // CHECK:STDOUT: %c: ref %C.a14 = bind_name c, %c.var
  140. // CHECK:STDOUT: %d.var: ref %C.2ba = var d
  141. // CHECK:STDOUT: %d: ref %C.2ba = bind_name d, %d.var
  142. // CHECK:STDOUT: }
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: generic class @C(%B.loc6_9.1: bool) {
  145. // CHECK:STDOUT: %B.loc6_9.2: bool = bind_symbolic_name B, 0 [symbolic = %B.loc6_9.2 (constants.%B)]
  146. // CHECK:STDOUT: %B.patt.loc6_9.2: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc6_9.2 (constants.%B.patt)]
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: !definition:
  149. // CHECK:STDOUT:
  150. // CHECK:STDOUT: class {
  151. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  152. // CHECK:STDOUT: complete_type_witness = %complete_type
  153. // CHECK:STDOUT:
  154. // CHECK:STDOUT: !members:
  155. // CHECK:STDOUT: .Self = constants.%C.342
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: fn @Neq(%a.param_patt: bool, %b.param_patt: bool) -> bool = "bool.neq";
  160. // CHECK:STDOUT:
  161. // CHECK:STDOUT: fn @True() -> %C.a14;
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: fn @False() -> %C.2ba;
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: fn @__global_init() {
  166. // CHECK:STDOUT: !entry:
  167. // CHECK:STDOUT: %False.ref.loc11: %False.type = name_ref False, file.%False.decl [template = constants.%False]
  168. // CHECK:STDOUT: %.loc11: ref %C.2ba = splice_block file.%a.var {}
  169. // CHECK:STDOUT: %False.call.loc11: init %C.2ba = call %False.ref.loc11() to %.loc11
  170. // CHECK:STDOUT: assign file.%a.var, %False.call.loc11
  171. // CHECK:STDOUT: %True.ref.loc12: %True.type = name_ref True, file.%True.decl [template = constants.%True]
  172. // CHECK:STDOUT: %.loc12: ref %C.a14 = splice_block file.%b.var {}
  173. // CHECK:STDOUT: %True.call.loc12: init %C.a14 = call %True.ref.loc12() to %.loc12
  174. // CHECK:STDOUT: assign file.%b.var, %True.call.loc12
  175. // CHECK:STDOUT: %True.ref.loc13: %True.type = name_ref True, file.%True.decl [template = constants.%True]
  176. // CHECK:STDOUT: %.loc13: ref %C.a14 = splice_block file.%c.var {}
  177. // CHECK:STDOUT: %True.call.loc13: init %C.a14 = call %True.ref.loc13() to %.loc13
  178. // CHECK:STDOUT: assign file.%c.var, %True.call.loc13
  179. // CHECK:STDOUT: %False.ref.loc14: %False.type = name_ref False, file.%False.decl [template = constants.%False]
  180. // CHECK:STDOUT: %.loc14: ref %C.2ba = splice_block file.%d.var {}
  181. // CHECK:STDOUT: %False.call.loc14: init %C.2ba = call %False.ref.loc14() to %.loc14
  182. // CHECK:STDOUT: assign file.%d.var, %False.call.loc14
  183. // CHECK:STDOUT: return
  184. // CHECK:STDOUT: }
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: specific @C(constants.%B) {
  187. // CHECK:STDOUT: %B.loc6_9.2 => constants.%B
  188. // CHECK:STDOUT: %B.patt.loc6_9.2 => constants.%B
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT:
  191. // CHECK:STDOUT: specific @C(constants.%true) {
  192. // CHECK:STDOUT: %B.loc6_9.2 => constants.%true
  193. // CHECK:STDOUT: %B.patt.loc6_9.2 => constants.%true
  194. // CHECK:STDOUT:
  195. // CHECK:STDOUT: !definition:
  196. // CHECK:STDOUT: }
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: specific @C(constants.%false) {
  199. // CHECK:STDOUT: %B.loc6_9.2 => constants.%false
  200. // CHECK:STDOUT: %B.patt.loc6_9.2 => constants.%false
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: !definition:
  203. // CHECK:STDOUT: }
  204. // CHECK:STDOUT:
  205. // CHECK:STDOUT: --- prelude.carbon
  206. // CHECK:STDOUT:
  207. // CHECK:STDOUT: constants {
  208. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  209. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  210. // CHECK:STDOUT: %B: bool = bind_symbolic_name B, 0 [symbolic]
  211. // CHECK:STDOUT: %B.patt: bool = symbolic_binding_pattern B, 0 [symbolic]
  212. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  213. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  214. // CHECK:STDOUT: %C.342: type = class_type @C, @C(%B) [symbolic]
  215. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  216. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  217. // CHECK:STDOUT: %true: bool = bool_literal true [template]
  218. // CHECK:STDOUT: %C.a14: type = class_type @C, @C(%true) [template]
  219. // CHECK:STDOUT: %True.type: type = fn_type @True [template]
  220. // CHECK:STDOUT: %True: %True.type = struct_value () [template]
  221. // CHECK:STDOUT: %false: bool = bool_literal false [template]
  222. // CHECK:STDOUT: %C.2ba: type = class_type @C, @C(%false) [template]
  223. // CHECK:STDOUT: %False.type: type = fn_type @False [template]
  224. // CHECK:STDOUT: %False: %False.type = struct_value () [template]
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: imports {
  228. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  229. // CHECK:STDOUT: .Bool = %import_ref.783
  230. // CHECK:STDOUT: .Eq = %import_ref.822
  231. // CHECK:STDOUT: import Core//prelude
  232. // CHECK:STDOUT: import Core//prelude/...
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT: }
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: file {
  237. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  238. // CHECK:STDOUT: .Core = imports.%Core
  239. // CHECK:STDOUT: .C = %C.decl
  240. // CHECK:STDOUT: .True = %True.decl
  241. // CHECK:STDOUT: .False = %False.decl
  242. // CHECK:STDOUT: .a = %a
  243. // CHECK:STDOUT: .b = %b
  244. // CHECK:STDOUT: .c = %c
  245. // CHECK:STDOUT: .d = %d
  246. // CHECK:STDOUT: }
  247. // CHECK:STDOUT: %Core.import = import Core
  248. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  249. // CHECK:STDOUT: %B.patt.loc4_9.1: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)]
  250. // CHECK:STDOUT: %B.param_patt: bool = value_param_pattern %B.patt.loc4_9.1, runtime_param<invalid> [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)]
  251. // CHECK:STDOUT: } {
  252. // CHECK:STDOUT: %B.param: bool = value_param runtime_param<invalid>
  253. // CHECK:STDOUT: %.loc4_13.1: type = splice_block %.loc4_13.3 [template = bool] {
  254. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  255. // CHECK:STDOUT: %.loc4_13.2: type = value_of_initializer %bool.make_type [template = bool]
  256. // CHECK:STDOUT: %.loc4_13.3: type = converted %bool.make_type, %.loc4_13.2 [template = bool]
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT: %B.loc4_9.1: bool = bind_symbolic_name B, 0, %B.param [symbolic = %B.loc4_9.2 (constants.%B)]
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT: %True.decl: %True.type = fn_decl @True [template = constants.%True] {
  261. // CHECK:STDOUT: %return.patt: %C.a14 = return_slot_pattern
  262. // CHECK:STDOUT: %return.param_patt: %C.a14 = out_param_pattern %return.patt, runtime_param0
  263. // CHECK:STDOUT: } {
  264. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  265. // CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true]
  266. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%true) [template = constants.%C.a14]
  267. // CHECK:STDOUT: %return.param: ref %C.a14 = out_param runtime_param0
  268. // CHECK:STDOUT: %return: ref %C.a14 = return_slot %return.param
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT: %False.decl: %False.type = fn_decl @False [template = constants.%False] {
  271. // CHECK:STDOUT: %return.patt: %C.2ba = return_slot_pattern
  272. // CHECK:STDOUT: %return.param_patt: %C.2ba = out_param_pattern %return.patt, runtime_param0
  273. // CHECK:STDOUT: } {
  274. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  275. // CHECK:STDOUT: %false: bool = bool_literal false [template = constants.%false]
  276. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%false) [template = constants.%C.2ba]
  277. // CHECK:STDOUT: %return.param: ref %C.2ba = out_param runtime_param0
  278. // CHECK:STDOUT: %return: ref %C.2ba = return_slot %return.param
  279. // CHECK:STDOUT: }
  280. // CHECK:STDOUT: %a.var: ref %C.2ba = var a
  281. // CHECK:STDOUT: %a: ref %C.2ba = bind_name a, %a.var
  282. // CHECK:STDOUT: %b.var: ref %C.a14 = var b
  283. // CHECK:STDOUT: %b: ref %C.a14 = bind_name b, %b.var
  284. // CHECK:STDOUT: %c.var: ref %C.a14 = var c
  285. // CHECK:STDOUT: %c: ref %C.a14 = bind_name c, %c.var
  286. // CHECK:STDOUT: %d.var: ref %C.2ba = var d
  287. // CHECK:STDOUT: %d: ref %C.2ba = bind_name d, %d.var
  288. // CHECK:STDOUT: }
  289. // CHECK:STDOUT:
  290. // CHECK:STDOUT: generic class @C(%B.loc4_9.1: bool) {
  291. // CHECK:STDOUT: %B.loc4_9.2: bool = bind_symbolic_name B, 0 [symbolic = %B.loc4_9.2 (constants.%B)]
  292. // CHECK:STDOUT: %B.patt.loc4_9.2: bool = symbolic_binding_pattern B, 0 [symbolic = %B.patt.loc4_9.2 (constants.%B.patt)]
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: !definition:
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: class {
  297. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  298. // CHECK:STDOUT: complete_type_witness = %complete_type
  299. // CHECK:STDOUT:
  300. // CHECK:STDOUT: !members:
  301. // CHECK:STDOUT: .Self = constants.%C.342
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: fn @True() -> %C.a14;
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: fn @False() -> %C.2ba;
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: fn @__global_init() {
  310. // CHECK:STDOUT: !entry:
  311. // CHECK:STDOUT: %False.ref.loc9: %False.type = name_ref False, file.%False.decl [template = constants.%False]
  312. // CHECK:STDOUT: %.loc9: ref %C.2ba = splice_block file.%a.var {}
  313. // CHECK:STDOUT: %False.call.loc9: init %C.2ba = call %False.ref.loc9() to %.loc9
  314. // CHECK:STDOUT: assign file.%a.var, %False.call.loc9
  315. // CHECK:STDOUT: %True.ref.loc10: %True.type = name_ref True, file.%True.decl [template = constants.%True]
  316. // CHECK:STDOUT: %.loc10: ref %C.a14 = splice_block file.%b.var {}
  317. // CHECK:STDOUT: %True.call.loc10: init %C.a14 = call %True.ref.loc10() to %.loc10
  318. // CHECK:STDOUT: assign file.%b.var, %True.call.loc10
  319. // CHECK:STDOUT: %True.ref.loc11: %True.type = name_ref True, file.%True.decl [template = constants.%True]
  320. // CHECK:STDOUT: %.loc11: ref %C.a14 = splice_block file.%c.var {}
  321. // CHECK:STDOUT: %True.call.loc11: init %C.a14 = call %True.ref.loc11() to %.loc11
  322. // CHECK:STDOUT: assign file.%c.var, %True.call.loc11
  323. // CHECK:STDOUT: %False.ref.loc12: %False.type = name_ref False, file.%False.decl [template = constants.%False]
  324. // CHECK:STDOUT: %.loc12: ref %C.2ba = splice_block file.%d.var {}
  325. // CHECK:STDOUT: %False.call.loc12: init %C.2ba = call %False.ref.loc12() to %.loc12
  326. // CHECK:STDOUT: assign file.%d.var, %False.call.loc12
  327. // CHECK:STDOUT: return
  328. // CHECK:STDOUT: }
  329. // CHECK:STDOUT:
  330. // CHECK:STDOUT: specific @C(constants.%B) {
  331. // CHECK:STDOUT: %B.loc4_9.2 => constants.%B
  332. // CHECK:STDOUT: %B.patt.loc4_9.2 => constants.%B
  333. // CHECK:STDOUT: }
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: specific @C(constants.%true) {
  336. // CHECK:STDOUT: %B.loc4_9.2 => constants.%true
  337. // CHECK:STDOUT: %B.patt.loc4_9.2 => constants.%true
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: !definition:
  340. // CHECK:STDOUT: }
  341. // CHECK:STDOUT:
  342. // CHECK:STDOUT: specific @C(constants.%false) {
  343. // CHECK:STDOUT: %B.loc4_9.2 => constants.%false
  344. // CHECK:STDOUT: %B.patt.loc4_9.2 => constants.%false
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: !definition:
  347. // CHECK:STDOUT: }
  348. // CHECK:STDOUT: