cpp_interop.carbon 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
  6. // EXTRA-ARGS: --dump-raw-sem-ir --builtin-sem-ir
  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/basics/raw_sem_ir/cpp_interop.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/raw_sem_ir/cpp_interop.carbon
  13. // --- header.h
  14. struct X {
  15. X *p;
  16. };
  17. void f(X x = {}) {
  18. }
  19. // --- import.carbon
  20. import Cpp library "header.h";
  21. fn G(x: Cpp.X) {
  22. Cpp.f();
  23. Cpp.f(x);
  24. }
  25. // CHECK:STDOUT: ---
  26. // CHECK:STDOUT: filename: import.carbon
  27. // CHECK:STDOUT: sem_ir:
  28. // CHECK:STDOUT: import_irs:
  29. // CHECK:STDOUT: 'import_ir(ApiForImpl)': {decl_id: inst<none>, is_export: false}
  30. // CHECK:STDOUT: 'import_ir(Cpp)': {decl_id: inst<none>, is_export: false}
  31. // CHECK:STDOUT: import_ir_insts:
  32. // CHECK:STDOUT: import_ir_inst0: {ir_id: import_ir(Cpp), clang_source_loc_id: clang_source_loc0}
  33. // CHECK:STDOUT: import_ir_inst1: {ir_id: import_ir(Cpp), clang_source_loc_id: clang_source_loc1}
  34. // CHECK:STDOUT: import_ir_inst2: {ir_id: import_ir(Cpp), clang_source_loc_id: clang_source_loc2}
  35. // CHECK:STDOUT: clang_decls:
  36. // CHECK:STDOUT: clang_decl_id0: {key: "<translation unit>", inst_id: inst60000010}
  37. // CHECK:STDOUT: clang_decl_id1: {key: "struct X {}", inst_id: inst60000012}
  38. // CHECK:STDOUT: clang_decl_id2: {key: {decl: "void f(X x = {})", num_params: 0}, inst_id: inst60000029}
  39. // CHECK:STDOUT: clang_decl_id3: {key: {decl: "extern void f__carbon_thunk()", num_params: 0}, inst_id: inst6000002C}
  40. // CHECK:STDOUT: clang_decl_id4: {key: {decl: "void f(X x = {})", num_params: 1}, inst_id: inst60000037}
  41. // CHECK:STDOUT: clang_decl_id5: {key: {decl: "extern void f__carbon_thunk(X * _Nonnull x)", num_params: 1}, inst_id: inst60000040}
  42. // CHECK:STDOUT: name_scopes:
  43. // CHECK:STDOUT: name_scope0: {inst: inst0000000E, parent_scope: name_scope<none>, has_error: false, extended_scopes: [], names: {name0: inst60000010, name1: inst6000001B}}
  44. // CHECK:STDOUT: name_scope1: {inst: inst60000010, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name3: inst60000012, name4: inst60000026}}
  45. // CHECK:STDOUT: name_scope2: {inst: inst60000012, parent_scope: name_scope1, has_error: false, extended_scopes: [], names: {}}
  46. // CHECK:STDOUT: entity_names:
  47. // CHECK:STDOUT: entity_name0: {name: name2, parent_scope: name_scope<none>, index: -1, is_template: 0, clang_decl_id: clang_decl_id<none>}
  48. // CHECK:STDOUT: entity_name1: {name: name2, parent_scope: name_scope<none>, index: -1, is_template: 0, clang_decl_id: clang_decl_id<none>}
  49. // CHECK:STDOUT: entity_name2: {name: name2, parent_scope: name_scope<none>, index: -1, is_template: 0, clang_decl_id: clang_decl_id<none>}
  50. // CHECK:STDOUT: functions:
  51. // CHECK:STDOUT: function60000000: {name: name1, parent_scope: name_scope0, call_params_id: inst_block6, body: [inst_block9]}
  52. // CHECK:STDOUT: function60000001: {name: name4, parent_scope: name_scope1, call_params_id: inst_block_empty}
  53. // CHECK:STDOUT: function60000002: {name: name6, parent_scope: name_scope1, call_params_id: inst_block_empty}
  54. // CHECK:STDOUT: function60000003: {name: name4, parent_scope: name_scope1, call_params_id: inst_block13}
  55. // CHECK:STDOUT: function60000004: {name: name6, parent_scope: name_scope1, call_params_id: inst_block18}
  56. // CHECK:STDOUT: classes:
  57. // CHECK:STDOUT: class60000000: {name: name3, parent_scope: name_scope1, self_type_id: type(inst60000013), inheritance_kind: Base, is_dynamic: 0, scope_id: name_scope2, body_block_id: inst_block10, adapt_id: inst<none>, base_id: inst<none>, complete_type_witness_id: inst60000021, vtable_decl_id: inst<none>}}
  58. // CHECK:STDOUT: generics: {}
  59. // CHECK:STDOUT: specifics: {}
  60. // CHECK:STDOUT: struct_type_fields:
  61. // CHECK:STDOUT: struct_type_fields0: {}
  62. // CHECK:STDOUT: types:
  63. // CHECK:STDOUT: 'type(TypeType)':
  64. // CHECK:STDOUT: value_repr: {kind: copy, type: type(TypeType)}
  65. // CHECK:STDOUT: 'type(Error)':
  66. // CHECK:STDOUT: value_repr: {kind: copy, type: type(Error)}
  67. // CHECK:STDOUT: 'type(inst(NamespaceType))':
  68. // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(NamespaceType))}
  69. // CHECK:STDOUT: 'type(inst6000001C)':
  70. // CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)}
  71. // CHECK:STDOUT: 'type(inst6000001D)':
  72. // CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)}
  73. // CHECK:STDOUT: 'type(inst(WitnessType))':
  74. // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst(WitnessType))}
  75. // CHECK:STDOUT: 'type(inst60000020)':
  76. // CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst60000023)}
  77. // CHECK:STDOUT: 'type(inst60000023)':
  78. // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst60000023)}
  79. // CHECK:STDOUT: 'type(inst60000013)':
  80. // CHECK:STDOUT: value_repr: {kind: pointer, type: type(inst60000023)}
  81. // CHECK:STDOUT: 'type(inst60000025)':
  82. // CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)}
  83. // CHECK:STDOUT: 'type(inst6000002A)':
  84. // CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)}
  85. // CHECK:STDOUT: 'type(inst6000002D)':
  86. // CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)}
  87. // CHECK:STDOUT: 'type(inst60000038)':
  88. // CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)}
  89. // CHECK:STDOUT: 'type(inst60000041)':
  90. // CHECK:STDOUT: value_repr: {kind: none, type: type(inst6000001D)}
  91. // CHECK:STDOUT: 'type(inst6000003A)':
  92. // CHECK:STDOUT: value_repr: {kind: copy, type: type(inst6000003A)}
  93. // CHECK:STDOUT: insts:
  94. // CHECK:STDOUT: 'inst(TypeType)': {kind: TypeType, type: type(TypeType)}
  95. // CHECK:STDOUT: 'inst(AutoType)': {kind: AutoType, type: type(TypeType)}
  96. // CHECK:STDOUT: 'inst(BoolType)': {kind: BoolType, type: type(TypeType)}
  97. // CHECK:STDOUT: 'inst(BoundMethodType)': {kind: BoundMethodType, type: type(TypeType)}
  98. // CHECK:STDOUT: 'inst(CharLiteralType)': {kind: CharLiteralType, type: type(TypeType)}
  99. // CHECK:STDOUT: 'inst(ErrorInst)': {kind: ErrorInst, type: type(Error)}
  100. // CHECK:STDOUT: 'inst(FloatLiteralType)': {kind: FloatLiteralType, type: type(TypeType)}
  101. // CHECK:STDOUT: 'inst(ImplWitnessTablePlaceholder)': {kind: ImplWitnessTablePlaceholder, type: type(TypeType)}
  102. // CHECK:STDOUT: 'inst(InstType)': {kind: InstType, type: type(TypeType)}
  103. // CHECK:STDOUT: 'inst(IntLiteralType)': {kind: IntLiteralType, type: type(TypeType)}
  104. // CHECK:STDOUT: 'inst(NamespaceType)': {kind: NamespaceType, type: type(TypeType)}
  105. // CHECK:STDOUT: 'inst(SpecificFunctionType)': {kind: SpecificFunctionType, type: type(TypeType)}
  106. // CHECK:STDOUT: 'inst(VtableType)': {kind: VtableType, type: type(TypeType)}
  107. // CHECK:STDOUT: 'inst(WitnessType)': {kind: WitnessType, type: type(TypeType)}
  108. // CHECK:STDOUT: inst0000000E: {kind: Namespace, arg0: name_scope0, arg1: inst<none>, type: type(inst(NamespaceType))}
  109. // CHECK:STDOUT: inst6000000F: {kind: ImportCppDecl}
  110. // CHECK:STDOUT: inst60000010: {kind: Namespace, arg0: name_scope1, arg1: inst6000000F, type: type(inst(NamespaceType))}
  111. // CHECK:STDOUT: inst60000011: {kind: NameRef, arg0: name0, arg1: inst60000010, type: type(inst(NamespaceType))}
  112. // CHECK:STDOUT: inst60000012: {kind: ClassDecl, arg0: class60000000, arg1: inst_block<none>, type: type(TypeType)}
  113. // CHECK:STDOUT: inst60000013: {kind: ClassType, arg0: class60000000, arg1: specific<none>, type: type(TypeType)}
  114. // CHECK:STDOUT: inst60000014: {kind: NameRef, arg0: name3, arg1: inst60000012, type: type(TypeType)}
  115. // CHECK:STDOUT: inst60000015: {kind: BindName, arg0: entity_name0, arg1: inst60000019, type: type(inst60000013)}
  116. // CHECK:STDOUT: inst60000016: {kind: PatternType, arg0: inst60000013, type: type(TypeType)}
  117. // CHECK:STDOUT: inst60000017: {kind: BindingPattern, arg0: entity_name0, type: type(inst60000016)}
  118. // CHECK:STDOUT: inst60000018: {kind: ValueParamPattern, arg0: inst60000017, arg1: call_param0, type: type(inst60000016)}
  119. // CHECK:STDOUT: inst60000019: {kind: ValueParam, arg0: call_param0, arg1: name2, type: type(inst60000013)}
  120. // CHECK:STDOUT: inst6000001A: {kind: SpliceBlock, arg0: inst_block4, arg1: inst60000014, type: type(TypeType)}
  121. // CHECK:STDOUT: inst6000001B: {kind: FunctionDecl, arg0: function60000000, arg1: inst_block8, type: type(inst6000001C)}
  122. // CHECK:STDOUT: inst6000001C: {kind: FunctionType, arg0: function60000000, arg1: specific<none>, type: type(TypeType)}
  123. // CHECK:STDOUT: inst6000001D: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)}
  124. // CHECK:STDOUT: inst6000001E: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000001C)}
  125. // CHECK:STDOUT: inst6000001F: {kind: CustomLayoutType, arg0: struct_type_fields0, arg1: custom_layout1, type: type(TypeType)}
  126. // CHECK:STDOUT: inst60000020: {kind: CustomLayoutType, arg0: struct_type_fields0, arg1: custom_layout1, type: type(TypeType)}
  127. // CHECK:STDOUT: inst60000021: {kind: CompleteTypeWitness, arg0: inst6000001F, type: type(inst(WitnessType))}
  128. // CHECK:STDOUT: inst60000022: {kind: CompleteTypeWitness, arg0: inst60000020, type: type(inst(WitnessType))}
  129. // CHECK:STDOUT: inst60000023: {kind: PointerType, arg0: inst60000020, type: type(TypeType)}
  130. // CHECK:STDOUT: inst60000024: {kind: NameRef, arg0: name0, arg1: inst60000010, type: type(inst(NamespaceType))}
  131. // CHECK:STDOUT: inst60000025: {kind: CppOverloadSetType, arg0: cpp_overload_set60000000, arg1: specific<none>, type: type(TypeType)}
  132. // CHECK:STDOUT: inst60000026: {kind: CppOverloadSetValue, arg0: cpp_overload_set60000000, type: type(inst60000025)}
  133. // CHECK:STDOUT: inst60000027: {kind: CppOverloadSetValue, arg0: cpp_overload_set60000000, type: type(inst60000025)}
  134. // CHECK:STDOUT: inst60000028: {kind: NameRef, arg0: name4, arg1: inst60000026, type: type(inst60000025)}
  135. // CHECK:STDOUT: inst60000029: {kind: FunctionDecl, arg0: function60000001, arg1: inst_block_empty, type: type(inst6000002A)}
  136. // CHECK:STDOUT: inst6000002A: {kind: FunctionType, arg0: function60000001, arg1: specific<none>, type: type(TypeType)}
  137. // CHECK:STDOUT: inst6000002B: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000002A)}
  138. // CHECK:STDOUT: inst6000002C: {kind: FunctionDecl, arg0: function60000002, arg1: inst_block_empty, type: type(inst6000002D)}
  139. // CHECK:STDOUT: inst6000002D: {kind: FunctionType, arg0: function60000002, arg1: specific<none>, type: type(TypeType)}
  140. // CHECK:STDOUT: inst6000002E: {kind: StructValue, arg0: inst_block_empty, type: type(inst6000002D)}
  141. // CHECK:STDOUT: inst6000002F: {kind: Call, arg0: inst6000002C, arg1: inst_block_empty, type: type(inst6000001D)}
  142. // CHECK:STDOUT: inst60000030: {kind: NameRef, arg0: name0, arg1: inst60000010, type: type(inst(NamespaceType))}
  143. // CHECK:STDOUT: inst60000031: {kind: NameRef, arg0: name4, arg1: inst60000026, type: type(inst60000025)}
  144. // CHECK:STDOUT: inst60000032: {kind: NameRef, arg0: name2, arg1: inst60000015, type: type(inst60000013)}
  145. // CHECK:STDOUT: inst60000033: {kind: BindName, arg0: entity_name1, arg1: inst60000036, type: type(inst60000013)}
  146. // CHECK:STDOUT: inst60000034: {kind: BindingPattern, arg0: entity_name1, type: type(inst60000016)}
  147. // CHECK:STDOUT: inst60000035: {kind: ValueParamPattern, arg0: inst60000034, arg1: call_param0, type: type(inst60000016)}
  148. // CHECK:STDOUT: inst60000036: {kind: ValueParam, arg0: call_param0, arg1: name2, type: type(inst60000013)}
  149. // CHECK:STDOUT: inst60000037: {kind: FunctionDecl, arg0: function60000003, arg1: inst_block15, type: type(inst60000038)}
  150. // CHECK:STDOUT: inst60000038: {kind: FunctionType, arg0: function60000003, arg1: specific<none>, type: type(TypeType)}
  151. // CHECK:STDOUT: inst60000039: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000038)}
  152. // CHECK:STDOUT: inst6000003A: {kind: PointerType, arg0: inst60000013, type: type(TypeType)}
  153. // CHECK:STDOUT: inst6000003B: {kind: BindName, arg0: entity_name2, arg1: inst6000003F, type: type(inst6000003A)}
  154. // CHECK:STDOUT: inst6000003C: {kind: PatternType, arg0: inst6000003A, type: type(TypeType)}
  155. // CHECK:STDOUT: inst6000003D: {kind: BindingPattern, arg0: entity_name2, type: type(inst6000003C)}
  156. // CHECK:STDOUT: inst6000003E: {kind: ValueParamPattern, arg0: inst6000003D, arg1: call_param0, type: type(inst6000003C)}
  157. // CHECK:STDOUT: inst6000003F: {kind: ValueParam, arg0: call_param0, arg1: name2, type: type(inst6000003A)}
  158. // CHECK:STDOUT: inst60000040: {kind: FunctionDecl, arg0: function60000004, arg1: inst_block20, type: type(inst60000041)}
  159. // CHECK:STDOUT: inst60000041: {kind: FunctionType, arg0: function60000004, arg1: specific<none>, type: type(TypeType)}
  160. // CHECK:STDOUT: inst60000042: {kind: StructValue, arg0: inst_block_empty, type: type(inst60000041)}
  161. // CHECK:STDOUT: inst60000043: {kind: ValueAsRef, arg0: inst60000032, type: type(inst60000013)}
  162. // CHECK:STDOUT: inst60000044: {kind: AddrOf, arg0: inst60000043, type: type(inst6000003A)}
  163. // CHECK:STDOUT: inst60000045: {kind: Call, arg0: inst60000040, arg1: inst_block22, type: type(inst6000001D)}
  164. // CHECK:STDOUT: inst60000046: {kind: Return}
  165. // CHECK:STDOUT: constant_values:
  166. // CHECK:STDOUT: values:
  167. // CHECK:STDOUT: 'inst(TypeType)': concrete_constant(inst(TypeType))
  168. // CHECK:STDOUT: 'inst(AutoType)': concrete_constant(inst(AutoType))
  169. // CHECK:STDOUT: 'inst(BoolType)': concrete_constant(inst(BoolType))
  170. // CHECK:STDOUT: 'inst(BoundMethodType)': concrete_constant(inst(BoundMethodType))
  171. // CHECK:STDOUT: 'inst(CharLiteralType)': concrete_constant(inst(CharLiteralType))
  172. // CHECK:STDOUT: 'inst(ErrorInst)': concrete_constant(inst(ErrorInst))
  173. // CHECK:STDOUT: 'inst(FloatLiteralType)': concrete_constant(inst(FloatLiteralType))
  174. // CHECK:STDOUT: 'inst(ImplWitnessTablePlaceholder)': concrete_constant(inst(ImplWitnessTablePlaceholder))
  175. // CHECK:STDOUT: 'inst(InstType)': concrete_constant(inst(InstType))
  176. // CHECK:STDOUT: 'inst(IntLiteralType)': concrete_constant(inst(IntLiteralType))
  177. // CHECK:STDOUT: 'inst(NamespaceType)': concrete_constant(inst(NamespaceType))
  178. // CHECK:STDOUT: 'inst(SpecificFunctionType)': concrete_constant(inst(SpecificFunctionType))
  179. // CHECK:STDOUT: 'inst(VtableType)': concrete_constant(inst(VtableType))
  180. // CHECK:STDOUT: 'inst(WitnessType)': concrete_constant(inst(WitnessType))
  181. // CHECK:STDOUT: inst0000000E: concrete_constant(inst0000000E)
  182. // CHECK:STDOUT: inst60000010: concrete_constant(inst60000010)
  183. // CHECK:STDOUT: inst60000011: concrete_constant(inst60000010)
  184. // CHECK:STDOUT: inst60000012: concrete_constant(inst60000013)
  185. // CHECK:STDOUT: inst60000013: concrete_constant(inst60000013)
  186. // CHECK:STDOUT: inst60000014: concrete_constant(inst60000013)
  187. // CHECK:STDOUT: inst60000016: concrete_constant(inst60000016)
  188. // CHECK:STDOUT: inst60000017: concrete_constant(inst60000017)
  189. // CHECK:STDOUT: inst60000018: concrete_constant(inst60000018)
  190. // CHECK:STDOUT: inst6000001A: concrete_constant(inst60000013)
  191. // CHECK:STDOUT: inst6000001B: concrete_constant(inst6000001E)
  192. // CHECK:STDOUT: inst6000001C: concrete_constant(inst6000001C)
  193. // CHECK:STDOUT: inst6000001D: concrete_constant(inst6000001D)
  194. // CHECK:STDOUT: inst6000001E: concrete_constant(inst6000001E)
  195. // CHECK:STDOUT: inst6000001F: concrete_constant(inst60000020)
  196. // CHECK:STDOUT: inst60000020: concrete_constant(inst60000020)
  197. // CHECK:STDOUT: inst60000021: concrete_constant(inst60000022)
  198. // CHECK:STDOUT: inst60000022: concrete_constant(inst60000022)
  199. // CHECK:STDOUT: inst60000023: concrete_constant(inst60000023)
  200. // CHECK:STDOUT: inst60000024: concrete_constant(inst60000010)
  201. // CHECK:STDOUT: inst60000025: concrete_constant(inst60000025)
  202. // CHECK:STDOUT: inst60000026: concrete_constant(inst60000027)
  203. // CHECK:STDOUT: inst60000027: concrete_constant(inst60000027)
  204. // CHECK:STDOUT: inst60000028: concrete_constant(inst60000027)
  205. // CHECK:STDOUT: inst60000029: concrete_constant(inst6000002B)
  206. // CHECK:STDOUT: inst6000002A: concrete_constant(inst6000002A)
  207. // CHECK:STDOUT: inst6000002B: concrete_constant(inst6000002B)
  208. // CHECK:STDOUT: inst6000002C: concrete_constant(inst6000002E)
  209. // CHECK:STDOUT: inst6000002D: concrete_constant(inst6000002D)
  210. // CHECK:STDOUT: inst6000002E: concrete_constant(inst6000002E)
  211. // CHECK:STDOUT: inst60000030: concrete_constant(inst60000010)
  212. // CHECK:STDOUT: inst60000031: concrete_constant(inst60000027)
  213. // CHECK:STDOUT: inst60000034: concrete_constant(inst60000034)
  214. // CHECK:STDOUT: inst60000035: concrete_constant(inst60000035)
  215. // CHECK:STDOUT: inst60000037: concrete_constant(inst60000039)
  216. // CHECK:STDOUT: inst60000038: concrete_constant(inst60000038)
  217. // CHECK:STDOUT: inst60000039: concrete_constant(inst60000039)
  218. // CHECK:STDOUT: inst6000003A: concrete_constant(inst6000003A)
  219. // CHECK:STDOUT: inst6000003C: concrete_constant(inst6000003C)
  220. // CHECK:STDOUT: inst6000003D: concrete_constant(inst6000003D)
  221. // CHECK:STDOUT: inst6000003E: concrete_constant(inst6000003E)
  222. // CHECK:STDOUT: inst60000040: concrete_constant(inst60000042)
  223. // CHECK:STDOUT: inst60000041: concrete_constant(inst60000041)
  224. // CHECK:STDOUT: inst60000042: concrete_constant(inst60000042)
  225. // CHECK:STDOUT: symbolic_constants: {}
  226. // CHECK:STDOUT: inst_blocks:
  227. // CHECK:STDOUT: inst_block_empty: {}
  228. // CHECK:STDOUT: exports:
  229. // CHECK:STDOUT: 0: inst6000001B
  230. // CHECK:STDOUT: imports:
  231. // CHECK:STDOUT: 0: inst60000010
  232. // CHECK:STDOUT: 1: inst60000012
  233. // CHECK:STDOUT: 2: inst60000026
  234. // CHECK:STDOUT: 3: inst60000029
  235. // CHECK:STDOUT: 4: inst6000002C
  236. // CHECK:STDOUT: 5: inst60000037
  237. // CHECK:STDOUT: 6: inst60000040
  238. // CHECK:STDOUT: global_init: {}
  239. // CHECK:STDOUT: inst_block4:
  240. // CHECK:STDOUT: 0: inst60000011
  241. // CHECK:STDOUT: 1: inst60000014
  242. // CHECK:STDOUT: inst_block5:
  243. // CHECK:STDOUT: 0: inst60000018
  244. // CHECK:STDOUT: inst_block6:
  245. // CHECK:STDOUT: 0: inst60000019
  246. // CHECK:STDOUT: inst_block7:
  247. // CHECK:STDOUT: 0: inst60000017
  248. // CHECK:STDOUT: 1: inst60000018
  249. // CHECK:STDOUT: inst_block8:
  250. // CHECK:STDOUT: 0: inst60000019
  251. // CHECK:STDOUT: 1: inst6000001A
  252. // CHECK:STDOUT: 2: inst60000015
  253. // CHECK:STDOUT: inst_block9:
  254. // CHECK:STDOUT: 0: inst60000024
  255. // CHECK:STDOUT: 1: inst60000028
  256. // CHECK:STDOUT: 2: inst6000002F
  257. // CHECK:STDOUT: 3: inst60000030
  258. // CHECK:STDOUT: 4: inst60000031
  259. // CHECK:STDOUT: 5: inst60000032
  260. // CHECK:STDOUT: 6: inst60000043
  261. // CHECK:STDOUT: 7: inst60000044
  262. // CHECK:STDOUT: 8: inst60000045
  263. // CHECK:STDOUT: 9: inst60000046
  264. // CHECK:STDOUT: inst_block10:
  265. // CHECK:STDOUT: 0: inst6000001F
  266. // CHECK:STDOUT: 1: inst60000021
  267. // CHECK:STDOUT: inst_block11: {}
  268. // CHECK:STDOUT: inst_block12:
  269. // CHECK:STDOUT: 0: inst60000035
  270. // CHECK:STDOUT: inst_block13:
  271. // CHECK:STDOUT: 0: inst60000036
  272. // CHECK:STDOUT: inst_block14:
  273. // CHECK:STDOUT: 0: inst60000034
  274. // CHECK:STDOUT: 1: inst60000035
  275. // CHECK:STDOUT: inst_block15:
  276. // CHECK:STDOUT: 0: inst60000036
  277. // CHECK:STDOUT: 1: inst60000033
  278. // CHECK:STDOUT: inst_block16: {}
  279. // CHECK:STDOUT: inst_block17:
  280. // CHECK:STDOUT: 0: inst6000003E
  281. // CHECK:STDOUT: inst_block18:
  282. // CHECK:STDOUT: 0: inst6000003F
  283. // CHECK:STDOUT: inst_block19:
  284. // CHECK:STDOUT: 0: inst6000003D
  285. // CHECK:STDOUT: 1: inst6000003E
  286. // CHECK:STDOUT: inst_block20:
  287. // CHECK:STDOUT: 0: inst6000003F
  288. // CHECK:STDOUT: 1: inst6000003B
  289. // CHECK:STDOUT: inst_block21:
  290. // CHECK:STDOUT: 0: inst60000032
  291. // CHECK:STDOUT: inst_block22:
  292. // CHECK:STDOUT: 0: inst60000044
  293. // CHECK:STDOUT: inst_block23:
  294. // CHECK:STDOUT: 0: inst0000000E
  295. // CHECK:STDOUT: 1: inst6000000F
  296. // CHECK:STDOUT: 2: inst6000001B
  297. // CHECK:STDOUT: ...