missing_prelude.carbon 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/missing_prelude.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/missing_prelude.carbon
  13. // --- fail_missing_prelude.carbon
  14. library "[[@TEST_NAME]]";
  15. // CHECK:STDERR: fail_missing_prelude.carbon:[[@LINE+4]]:8: error: `Core.Int` implicitly referenced here, but package `Core` not found [CoreNotFound]
  16. // CHECK:STDERR: var n: i32;
  17. // CHECK:STDERR: ^~~
  18. // CHECK:STDERR:
  19. var n: i32;
  20. // --- prelude_empty.carbon
  21. package Core library "[[@TEST_NAME]]";
  22. // --- fail_missing_prelude_member.carbon
  23. library "[[@TEST_NAME]]";
  24. import Core library "prelude_empty";
  25. // CHECK:STDERR: fail_missing_prelude_member.carbon:[[@LINE+4]]:8: error: name `Core.Int` implicitly referenced here, but not found [CoreNameNotFound]
  26. // CHECK:STDERR: var n: i32;
  27. // CHECK:STDERR: ^~~
  28. // CHECK:STDERR:
  29. var n: i32;
  30. // --- prelude_fake_int.carbon
  31. package Core library "[[@TEST_NAME]]";
  32. fn Int[T:! type](N:! T) -> {} { return {}; }
  33. // --- use_fake_int.carbon
  34. library "[[@TEST_NAME]]";
  35. import Core library "prelude_fake_int";
  36. var n: {} = i32;
  37. // --- prelude_use_in_prelude.carbon
  38. package Core library "[[@TEST_NAME]]";
  39. // Core is not an imported package here.
  40. // Note that we are intentionally using a different type here from other cases
  41. // to test that this function is called, not the one from prelude_fake_int.
  42. fn Int[T:! type](N:! T) -> () { return (); }
  43. var n: () = i32;
  44. // --- fail_prelude_as_namespace.carbon
  45. library "[[@TEST_NAME]]";
  46. // CHECK:STDERR: fail_prelude_as_namespace.carbon:[[@LINE+8]]:11: error: `namespace` introducer should be followed by a name [ExpectedDeclName]
  47. // CHECK:STDERR: namespace Core;
  48. // CHECK:STDERR: ^~~~
  49. // CHECK:STDERR:
  50. // CHECK:STDERR: fail_prelude_as_namespace.carbon:[[@LINE+4]]:11: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
  51. // CHECK:STDERR: namespace Core;
  52. // CHECK:STDERR: ^~~~
  53. // CHECK:STDERR:
  54. namespace Core;
  55. // CHECK:STDERR: fail_prelude_as_namespace.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName]
  56. // CHECK:STDERR: fn Core.Int[T:! type](N:! T) -> {} { return {}; }
  57. // CHECK:STDERR: ^~~~
  58. // CHECK:STDERR:
  59. fn Core.Int[T:! type](N:! T) -> {} { return {}; }
  60. var n: {} = i32;
  61. // --- fail_prelude_as_class.carbon
  62. library "[[@TEST_NAME]]";
  63. // CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+8]]:7: error: `class` introducer should be followed by a name [ExpectedDeclName]
  64. // CHECK:STDERR: class Core {
  65. // CHECK:STDERR: ^~~~
  66. // CHECK:STDERR:
  67. // CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+4]]:7: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
  68. // CHECK:STDERR: class Core {
  69. // CHECK:STDERR: ^~~~
  70. // CHECK:STDERR:
  71. class Core {
  72. fn Int[T:! type](N:! T) -> {} { return {}; }
  73. }
  74. var n: {} = i32;
  75. // CHECK:STDOUT: --- fail_missing_prelude.carbon
  76. // CHECK:STDOUT:
  77. // CHECK:STDOUT: constants {
  78. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  79. // CHECK:STDOUT: }
  80. // CHECK:STDOUT:
  81. // CHECK:STDOUT: file {
  82. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  83. // CHECK:STDOUT: .n = %n
  84. // CHECK:STDOUT: }
  85. // CHECK:STDOUT: name_binding_decl {
  86. // CHECK:STDOUT: %n.patt: <error> = binding_pattern n [concrete]
  87. // CHECK:STDOUT: %n.var_patt: <error> = var_pattern %n.patt [concrete]
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT: %n.var: ref <error> = var %n.var_patt [concrete = <error>]
  90. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  91. // CHECK:STDOUT: %n: <error> = bind_name n, <error> [concrete = <error>]
  92. // CHECK:STDOUT: }
  93. // CHECK:STDOUT:
  94. // CHECK:STDOUT: --- prelude_empty.carbon
  95. // CHECK:STDOUT:
  96. // CHECK:STDOUT: file {
  97. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
  98. // CHECK:STDOUT: }
  99. // CHECK:STDOUT:
  100. // CHECK:STDOUT: --- fail_missing_prelude_member.carbon
  101. // CHECK:STDOUT:
  102. // CHECK:STDOUT: constants {
  103. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  104. // CHECK:STDOUT: }
  105. // CHECK:STDOUT:
  106. // CHECK:STDOUT: imports {
  107. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  108. // CHECK:STDOUT: .Int = <poisoned>
  109. // CHECK:STDOUT: import Core//prelude_empty
  110. // CHECK:STDOUT: }
  111. // CHECK:STDOUT: }
  112. // CHECK:STDOUT:
  113. // CHECK:STDOUT: file {
  114. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  115. // CHECK:STDOUT: .Core = imports.%Core
  116. // CHECK:STDOUT: .n = %n
  117. // CHECK:STDOUT: }
  118. // CHECK:STDOUT: %Core.import = import Core
  119. // CHECK:STDOUT: name_binding_decl {
  120. // CHECK:STDOUT: %n.patt: <error> = binding_pattern n [concrete]
  121. // CHECK:STDOUT: %n.var_patt: <error> = var_pattern %n.patt [concrete]
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT: %n.var: ref <error> = var %n.var_patt [concrete = <error>]
  124. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  125. // CHECK:STDOUT: %n: <error> = bind_name n, <error> [concrete = <error>]
  126. // CHECK:STDOUT: }
  127. // CHECK:STDOUT:
  128. // CHECK:STDOUT: --- prelude_fake_int.carbon
  129. // CHECK:STDOUT:
  130. // CHECK:STDOUT: constants {
  131. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  132. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  133. // CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic]
  134. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  135. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  136. // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
  137. // CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
  138. // CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
  139. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  140. // CHECK:STDOUT: }
  141. // CHECK:STDOUT:
  142. // CHECK:STDOUT: file {
  143. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  144. // CHECK:STDOUT: .Int = %Int.decl
  145. // CHECK:STDOUT: }
  146. // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] {
  147. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  148. // CHECK:STDOUT: %N.patt: @Int.%pattern_type (%pattern_type.7dc) = symbolic_binding_pattern N, 1 [concrete]
  149. // CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern [concrete]
  150. // CHECK:STDOUT: %return.param_patt: %pattern_type.a96 = out_param_pattern %return.patt, call_param0 [concrete]
  151. // CHECK:STDOUT: } {
  152. // CHECK:STDOUT: %.loc4_29.1: %empty_struct_type = struct_literal ()
  153. // CHECK:STDOUT: %.loc4_29.2: type = converted %.loc4_29.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  154. // CHECK:STDOUT: %T.loc4_8.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_8.2 (constants.%T)]
  155. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_8.1 [symbolic = %T.loc4_8.2 (constants.%T)]
  156. // CHECK:STDOUT: %N.loc4_18.1: @Int.%T.loc4_8.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc4_18.2 (constants.%N)]
  157. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
  158. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  159. // CHECK:STDOUT: }
  160. // CHECK:STDOUT: }
  161. // CHECK:STDOUT:
  162. // CHECK:STDOUT: generic fn @Int(%T.loc4_8.1: type, %N.loc4_18.1: @Int.%T.loc4_8.2 (%T)) {
  163. // CHECK:STDOUT: %T.loc4_8.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_8.2 (constants.%T)]
  164. // CHECK:STDOUT: %N.loc4_18.2: @Int.%T.loc4_8.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc4_18.2 (constants.%N)]
  165. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_8.2 [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: !definition:
  168. // CHECK:STDOUT:
  169. // CHECK:STDOUT: fn() -> %empty_struct_type {
  170. // CHECK:STDOUT: !entry:
  171. // CHECK:STDOUT: %.loc4_41: %empty_struct_type = struct_literal ()
  172. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  173. // CHECK:STDOUT: %.loc4_42: %empty_struct_type = converted %.loc4_41, %empty_struct [concrete = constants.%empty_struct]
  174. // CHECK:STDOUT: return %.loc4_42
  175. // CHECK:STDOUT: }
  176. // CHECK:STDOUT: }
  177. // CHECK:STDOUT:
  178. // CHECK:STDOUT: specific @Int(constants.%T, constants.%N) {
  179. // CHECK:STDOUT: %T.loc4_8.2 => constants.%T
  180. // CHECK:STDOUT: %N.loc4_18.2 => constants.%N
  181. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT:
  184. // CHECK:STDOUT: --- use_fake_int.carbon
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: constants {
  187. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  188. // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
  189. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  190. // CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
  191. // CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
  192. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  193. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  194. // CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic]
  195. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  196. // CHECK:STDOUT: %Int.specific_fn: <specific function> = specific_function %Int, @Int(Core.IntLiteral, %int_32) [concrete]
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: imports {
  200. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  201. // CHECK:STDOUT: .Int = %Core.Int
  202. // CHECK:STDOUT: import Core//prelude_fake_int
  203. // CHECK:STDOUT: }
  204. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude_fake_int, Int, loaded [concrete = constants.%Int]
  205. // CHECK:STDOUT: %Core.import_ref.5ab: type = import_ref Core//prelude_fake_int, loc4_8, loaded [symbolic = @Int.%T (constants.%T)]
  206. // CHECK:STDOUT: %Core.import_ref.34c: @Int.%T (%T) = import_ref Core//prelude_fake_int, loc4_18, loaded [symbolic = @Int.%N (constants.%N)]
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: file {
  210. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  211. // CHECK:STDOUT: .Core = imports.%Core
  212. // CHECK:STDOUT: .n = %n
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT: %Core.import = import Core
  215. // CHECK:STDOUT: name_binding_decl {
  216. // CHECK:STDOUT: %n.patt: %pattern_type.a96 = binding_pattern n [concrete]
  217. // CHECK:STDOUT: %n.var_patt: %pattern_type.a96 = var_pattern %n.patt [concrete]
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT: %n.var: ref %empty_struct_type = var %n.var_patt [concrete]
  220. // CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [concrete = constants.%empty_struct_type] {
  221. // CHECK:STDOUT: %.loc6_9.2: %empty_struct_type = struct_literal ()
  222. // CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  223. // CHECK:STDOUT: }
  224. // CHECK:STDOUT: %n: ref %empty_struct_type = bind_name n, %n.var [concrete = %n.var]
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: generic fn @Int(imports.%Core.import_ref.5ab: type, imports.%Core.import_ref.34c: @Int.%T (%T)) [from "prelude_fake_int.carbon"] {
  228. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  229. // CHECK:STDOUT: %N: @Int.%T (%T) = bind_symbolic_name N, 1 [symbolic = %N (constants.%N)]
  230. // CHECK:STDOUT: %pattern_type: type = pattern_type %T [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: !definition:
  233. // CHECK:STDOUT:
  234. // CHECK:STDOUT: fn;
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: fn @__global_init() {
  238. // CHECK:STDOUT: !entry:
  239. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  240. // CHECK:STDOUT: %Int.specific_fn: <specific function> = specific_function constants.%Int, @Int(Core.IntLiteral, constants.%int_32) [concrete = constants.%Int.specific_fn]
  241. // CHECK:STDOUT: %Int.call: init %empty_struct_type = call %Int.specific_fn()
  242. // CHECK:STDOUT: assign file.%n.var, %Int.call
  243. // CHECK:STDOUT: return
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: specific @Int(constants.%T, constants.%N) {
  247. // CHECK:STDOUT: %T => constants.%T
  248. // CHECK:STDOUT: %N => constants.%N
  249. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: specific @Int(Core.IntLiteral, constants.%int_32) {
  253. // CHECK:STDOUT: %T => Core.IntLiteral
  254. // CHECK:STDOUT: %N => constants.%int_32
  255. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc0
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: !definition:
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: --- prelude_use_in_prelude.carbon
  261. // CHECK:STDOUT:
  262. // CHECK:STDOUT: constants {
  263. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  264. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  265. // CHECK:STDOUT: %N: %T = bind_symbolic_name N, 1 [symbolic]
  266. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  267. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  268. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  269. // CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
  270. // CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
  271. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  272. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  273. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  274. // CHECK:STDOUT: %Int.specific_fn: <specific function> = specific_function %Int, @Int(Core.IntLiteral, %int_32) [concrete]
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: file {
  278. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  279. // CHECK:STDOUT: .Int = %Int.decl
  280. // CHECK:STDOUT: .n = %n
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] {
  283. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  284. // CHECK:STDOUT: %N.patt: @Int.%pattern_type (%pattern_type.7dc) = symbolic_binding_pattern N, 1 [concrete]
  285. // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete]
  286. // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param0 [concrete]
  287. // CHECK:STDOUT: } {
  288. // CHECK:STDOUT: %.loc8_29.1: %empty_tuple.type = tuple_literal ()
  289. // CHECK:STDOUT: %.loc8_29.2: type = converted %.loc8_29.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  290. // CHECK:STDOUT: %T.loc8_8.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_8.2 (constants.%T)]
  291. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_8.1 [symbolic = %T.loc8_8.2 (constants.%T)]
  292. // CHECK:STDOUT: %N.loc8_18.1: @Int.%T.loc8_8.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc8_18.2 (constants.%N)]
  293. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
  294. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  295. // CHECK:STDOUT: }
  296. // CHECK:STDOUT: name_binding_decl {
  297. // CHECK:STDOUT: %n.patt: %pattern_type.cb1 = binding_pattern n [concrete]
  298. // CHECK:STDOUT: %n.var_patt: %pattern_type.cb1 = var_pattern %n.patt [concrete]
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT: %n.var: ref %empty_tuple.type = var %n.var_patt [concrete]
  301. // CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [concrete = constants.%empty_tuple.type] {
  302. // CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal ()
  303. // CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  304. // CHECK:STDOUT: }
  305. // CHECK:STDOUT: %n: ref %empty_tuple.type = bind_name n, %n.var [concrete = %n.var]
  306. // CHECK:STDOUT: }
  307. // CHECK:STDOUT:
  308. // CHECK:STDOUT: generic fn @Int(%T.loc8_8.1: type, %N.loc8_18.1: @Int.%T.loc8_8.2 (%T)) {
  309. // CHECK:STDOUT: %T.loc8_8.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_8.2 (constants.%T)]
  310. // CHECK:STDOUT: %N.loc8_18.2: @Int.%T.loc8_8.2 (%T) = bind_symbolic_name N, 1 [symbolic = %N.loc8_18.2 (constants.%N)]
  311. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc8_8.2 [symbolic = %pattern_type (constants.%pattern_type.7dc)]
  312. // CHECK:STDOUT:
  313. // CHECK:STDOUT: !definition:
  314. // CHECK:STDOUT:
  315. // CHECK:STDOUT: fn() -> %empty_tuple.type {
  316. // CHECK:STDOUT: !entry:
  317. // CHECK:STDOUT: %.loc8_41: %empty_tuple.type = tuple_literal ()
  318. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  319. // CHECK:STDOUT: %.loc8_42: %empty_tuple.type = converted %.loc8_41, %empty_tuple [concrete = constants.%empty_tuple]
  320. // CHECK:STDOUT: return %.loc8_42
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT: }
  323. // CHECK:STDOUT:
  324. // CHECK:STDOUT: fn @__global_init() {
  325. // CHECK:STDOUT: !entry:
  326. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  327. // CHECK:STDOUT: %Int.specific_fn: <specific function> = specific_function constants.%Int, @Int(Core.IntLiteral, constants.%int_32) [concrete = constants.%Int.specific_fn]
  328. // CHECK:STDOUT: %Int.call: init %empty_tuple.type = call %Int.specific_fn()
  329. // CHECK:STDOUT: assign file.%n.var, %Int.call
  330. // CHECK:STDOUT: return
  331. // CHECK:STDOUT: }
  332. // CHECK:STDOUT:
  333. // CHECK:STDOUT: specific @Int(constants.%T, constants.%N) {
  334. // CHECK:STDOUT: %T.loc8_8.2 => constants.%T
  335. // CHECK:STDOUT: %N.loc8_18.2 => constants.%N
  336. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dc
  337. // CHECK:STDOUT: }
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: specific @Int(Core.IntLiteral, constants.%int_32) {
  340. // CHECK:STDOUT: %T.loc8_8.2 => Core.IntLiteral
  341. // CHECK:STDOUT: %N.loc8_18.2 => constants.%int_32
  342. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc0
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: !definition:
  345. // CHECK:STDOUT: }
  346. // CHECK:STDOUT:
  347. // CHECK:STDOUT: --- fail_prelude_as_namespace.carbon
  348. // CHECK:STDOUT:
  349. // CHECK:STDOUT: --- fail_prelude_as_class.carbon
  350. // CHECK:STDOUT: