context_main.carbon 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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. package ExplorerTest api;
  5. interface TestInterface {}
  6. fn Main() -> i32 {
  7. return 0;
  8. }
  9. // Place checks after code so that line numbers are stable, reducing merge
  10. // conflicts.
  11. // ARGS: --trace_file=- --trace_phase=all --trace_file_context=main %s
  12. // AUTOUPDATE
  13. // CHECK:STDOUT: * * * * * * * * * * source program * * * * * * * * * *
  14. // CHECK:STDOUT: --------------------------------------------------------
  15. // CHECK:STDOUT: interface TestInterface {
  16. // CHECK:STDOUT: }
  17. // CHECK:STDOUT:
  18. // CHECK:STDOUT: fn Main () -> i32
  19. // CHECK:STDOUT: {
  20. // CHECK:STDOUT: return 0;
  21. // CHECK:STDOUT: }
  22. // CHECK:STDOUT:
  23. // CHECK:STDOUT:
  24. // CHECK:STDOUT: * * * * * * * * * * resolving names * * * * * * * * * *
  25. // CHECK:STDOUT: ---------------------------------------------------------
  26. // CHECK:STDOUT: ==> declared `TestInterface` as `interface TestInterface` in `package` (context_main.carbon:7)
  27. // CHECK:STDOUT: ==> declared `Main` as `fn Main` in `package` (context_main.carbon:11)
  28. // CHECK:STDOUT: ->> resolving decl `interface TestInterface` (context_main.carbon:7)
  29. // CHECK:STDOUT: ==> marked `TestInterface` declared but not usable in `package`
  30. // CHECK:STDOUT: ==> marked `TestInterface` usable in `package`
  31. // CHECK:STDOUT: ==> declared `Self` as `Self` in `interface TestInterface` (context_main.carbon:7)
  32. // CHECK:STDOUT: <<- finished resolving decl `interface TestInterface` (context_main.carbon:7)
  33. // CHECK:STDOUT: ->> resolving decl `fn Main` (context_main.carbon:11)
  34. // CHECK:STDOUT: ==> marked `Main` declared but not usable in `package`
  35. // CHECK:STDOUT: ==> marked `Main` usable in `package`
  36. // CHECK:STDOUT: ->> resolving stmt `{ ... }` (context_main.carbon:11)
  37. // CHECK:STDOUT: ->> resolving stmt `return ...;` (context_main.carbon:10)
  38. // CHECK:STDOUT: <<- finished resolving stmt `return ...;` (context_main.carbon:10)
  39. // CHECK:STDOUT: <<- finished resolving stmt `{ ... }` (context_main.carbon:11)
  40. // CHECK:STDOUT: <<- finished resolving decl `fn Main` (context_main.carbon:11)
  41. // CHECK:STDOUT: ==> resolved `Main` as `fn Main` in `package` (<Main()>:0)
  42. // CHECK:STDOUT:
  43. // CHECK:STDOUT:
  44. // CHECK:STDOUT: * * * * * * * * * * resolving control flow * * * * * * * * * *
  45. // CHECK:STDOUT: ----------------------------------------------------------------
  46. // CHECK:STDOUT: ==> flow-resolved return statement `return 0;` in `fn Main` (context_main.carbon:10)
  47. // CHECK:STDOUT:
  48. // CHECK:STDOUT:
  49. // CHECK:STDOUT: * * * * * * * * * * type checking * * * * * * * * * *
  50. // CHECK:STDOUT: -------------------------------------------------------
  51. // CHECK:STDOUT:
  52. // CHECK:STDOUT: *** declaration at (context_main.carbon:7)
  53. // CHECK:STDOUT: ```
  54. // CHECK:STDOUT: interface TestInterface {
  55. // CHECK:STDOUT: }
  56. // CHECK:STDOUT: ```
  57. // CHECK:STDOUT: ->> declaring `interface TestInterface` (context_main.carbon:7)
  58. // CHECK:STDOUT: <<- finished declaring `interface TestInterface` (context_main.carbon:7)
  59. // CHECK:STDOUT:
  60. // CHECK:STDOUT: *** type checking declaration at (context_main.carbon:7)
  61. // CHECK:STDOUT: ```
  62. // CHECK:STDOUT: interface TestInterface {
  63. // CHECK:STDOUT: }
  64. // CHECK:STDOUT: ```
  65. // CHECK:STDOUT: ->> checking InterfaceDeclaration `interface TestInterface` (context_main.carbon:7)
  66. // CHECK:STDOUT: ->> checking `interface TestInterface` (context_main.carbon:7)
  67. // CHECK:STDOUT: ==> impl declarations for `interface TestInterface` (context_main.carbon:7)
  68. // CHECK:STDOUT: []
  69. // CHECK:STDOUT: [`bool` as `interface EqWith(U = bool)`,
  70. // CHECK:STDOUT: `i32` as `interface EqWith(U = i32)`,
  71. // CHECK:STDOUT: `String` as `interface EqWith(U = String)`,
  72. // CHECK:STDOUT: `i32` as `interface CompareWith(U = i32)`,
  73. // CHECK:STDOUT: `String` as `interface CompareWith(U = String)`,
  74. // CHECK:STDOUT: `i32` as `interface LessWith(U = i32)`,
  75. // CHECK:STDOUT: `String` as `interface LessWith(U = String)`,
  76. // CHECK:STDOUT: `i32` as `interface LessEqWith(U = i32)`,
  77. // CHECK:STDOUT: `String` as `interface LessEqWith(U = String)`,
  78. // CHECK:STDOUT: `i32` as `interface GreaterWith(U = i32)`,
  79. // CHECK:STDOUT: `String` as `interface GreaterWith(U = String)`,
  80. // CHECK:STDOUT: `i32` as `interface GreaterEqWith(U = i32)`,
  81. // CHECK:STDOUT: `String` as `interface GreaterEqWith(U = String)`,
  82. // CHECK:STDOUT: `i32` as `interface Negate`,
  83. // CHECK:STDOUT: `i32` as `interface AddWith(U = i32)`,
  84. // CHECK:STDOUT: `i32` as `interface SubWith(U = i32)`,
  85. // CHECK:STDOUT: `i32` as `interface MulWith(U = i32)`,
  86. // CHECK:STDOUT: `i32` as `interface DivWith(U = i32)`,
  87. // CHECK:STDOUT: `i32` as `interface ModWith(U = i32)`,
  88. // CHECK:STDOUT: `i32` as `interface BitComplement`,
  89. // CHECK:STDOUT: `i32` as `interface BitAndWith(U = i32)`,
  90. // CHECK:STDOUT: `i32` as `interface BitOrWith(U = i32)`,
  91. // CHECK:STDOUT: `i32` as `interface BitXorWith(U = i32)`,
  92. // CHECK:STDOUT: `i32` as `interface LeftShiftWith(U = i32)`,
  93. // CHECK:STDOUT: `i32` as `interface RightShiftWith(U = i32)`,
  94. // CHECK:STDOUT: `i32` as `interface Inc`,
  95. // CHECK:STDOUT: `i32` as `interface Dec`,
  96. // CHECK:STDOUT: `U` as `interface __EqualConverter` [0],
  97. // CHECK:STDOUT: `(T1,)` as `interface As(T = (U1,))` [0, 0, 0; 1, 1, 0, 0, 0],
  98. // CHECK:STDOUT: `(T1, T2)` as `interface As(T = (U1, U2))` [0, 0, 0; 0, 0, 1; 1, 1, 0, 0, 0; 1, 1, 0, 0, 1],
  99. // CHECK:STDOUT: `(T1, U1)` as `interface EqWith(U = (T2, U2))` [0, 0, 0; 0, 0, 1; 1, 1, 0, 0, 0; 1, 1, 0, 0, 1],
  100. // CHECK:STDOUT: `(T1, T2, T3)` as `interface As(T = (U1, U2, U3))` [0, 0, 0; 0, 0, 1; 0, 0, 2; 1, 1, 0, 0, 0; 1, 1, 0, 0, 1; 1, 1, 0, 0, 2],
  101. // CHECK:STDOUT: `T` as `interface ImplicitAs(T = U)` [0; 1, 1, 0],
  102. // CHECK:STDOUT: `T` as `interface As(T = U)` [0; 1, 1, 0],
  103. // CHECK:STDOUT: `T` as `interface ImplicitAs(T = U)` [0; 1, 1, 0],
  104. // CHECK:STDOUT: `T` as `interface As(T = U)` [0; 1, 1, 0],
  105. // CHECK:STDOUT: `T` as `interface AssignWith(U = U)` [0; 1, 1, 0],
  106. // CHECK:STDOUT: `T` as `interface AddAssignWith(U = U)` [0; 1, 1, 0],
  107. // CHECK:STDOUT: `T` as `interface SubAssignWith(U = U)` [0; 1, 1, 0],
  108. // CHECK:STDOUT: `T` as `interface MulAssignWith(U = U)` [0; 1, 1, 0],
  109. // CHECK:STDOUT: `T` as `interface DivAssignWith(U = U)` [0; 1, 1, 0],
  110. // CHECK:STDOUT: `T` as `interface ModAssignWith(U = U)` [0; 1, 1, 0],
  111. // CHECK:STDOUT: `T` as `interface BitAndAssignWith(U = U)` [0; 1, 1, 0],
  112. // CHECK:STDOUT: `T` as `interface BitOrAssignWith(U = U)` [0; 1, 1, 0],
  113. // CHECK:STDOUT: `T` as `interface BitXorAssignWith(U = U)` [0; 1, 1, 0],
  114. // CHECK:STDOUT: `T` as `interface LeftShiftAssignWith(U = U)` [0; 1, 1, 0],
  115. // CHECK:STDOUT: `T` as `interface RightShiftAssignWith(U = U)` [0; 1, 1, 0]]
  116. // CHECK:STDOUT: <<- finished checking `interface TestInterface` (context_main.carbon:7)
  117. // CHECK:STDOUT:
  118. // CHECK:STDOUT: *** declaration at (context_main.carbon:11)
  119. // CHECK:STDOUT: ```
  120. // CHECK:STDOUT: fn Main () -> i32
  121. // CHECK:STDOUT: {
  122. // CHECK:STDOUT: return 0;
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT: ```
  125. // CHECK:STDOUT: ->> declaring function `Main` (context_main.carbon:11)
  126. // CHECK:STDOUT: ->> checking TuplePattern `()` (context_main.carbon:9)
  127. // CHECK:STDOUT: ->> checking IntTypeLiteral `i32` (context_main.carbon:9)
  128. // CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `i32` (context_main.carbon:9)
  129. // CHECK:STDOUT: ->> step ValueExpressionAction pos: 0 `i32` (context_main.carbon:9) --->
  130. // CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `i32` (context_main.carbon:9)
  131. // CHECK:STDOUT: ->> step ExpressionAction pos: 0 `i32` (context_main.carbon:9) --->
  132. // CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 0 `i32` (context_main.carbon:9)
  133. // CHECK:STDOUT: ->> step ValueExpressionAction pos: 1 `i32` results: [`i32`] (context_main.carbon:9) --->
  134. // CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `i32` results: [`i32`] (context_main.carbon:9)
  135. // CHECK:STDOUT: ->> finished declaring function `Main` of type `fn () -> i32` (context_main.carbon:11)
  136. // CHECK:STDOUT:
  137. // CHECK:STDOUT: *** type checking declaration at (context_main.carbon:11)
  138. // CHECK:STDOUT: ```
  139. // CHECK:STDOUT: fn Main () -> i32
  140. // CHECK:STDOUT: {
  141. // CHECK:STDOUT: return 0;
  142. // CHECK:STDOUT: }
  143. // CHECK:STDOUT: ```
  144. // CHECK:STDOUT: ->> checking FunctionDeclaration `fn Main` (context_main.carbon:11)
  145. // CHECK:STDOUT: ->> checking function `Main` (context_main.carbon:11)
  146. // CHECK:STDOUT: ==> impl declarations for `fn Main` (context_main.carbon:11)
  147. // CHECK:STDOUT: []
  148. // CHECK:STDOUT: [`bool` as `interface EqWith(U = bool)`,
  149. // CHECK:STDOUT: `i32` as `interface EqWith(U = i32)`,
  150. // CHECK:STDOUT: `String` as `interface EqWith(U = String)`,
  151. // CHECK:STDOUT: `i32` as `interface CompareWith(U = i32)`,
  152. // CHECK:STDOUT: `String` as `interface CompareWith(U = String)`,
  153. // CHECK:STDOUT: `i32` as `interface LessWith(U = i32)`,
  154. // CHECK:STDOUT: `String` as `interface LessWith(U = String)`,
  155. // CHECK:STDOUT: `i32` as `interface LessEqWith(U = i32)`,
  156. // CHECK:STDOUT: `String` as `interface LessEqWith(U = String)`,
  157. // CHECK:STDOUT: `i32` as `interface GreaterWith(U = i32)`,
  158. // CHECK:STDOUT: `String` as `interface GreaterWith(U = String)`,
  159. // CHECK:STDOUT: `i32` as `interface GreaterEqWith(U = i32)`,
  160. // CHECK:STDOUT: `String` as `interface GreaterEqWith(U = String)`,
  161. // CHECK:STDOUT: `i32` as `interface Negate`,
  162. // CHECK:STDOUT: `i32` as `interface AddWith(U = i32)`,
  163. // CHECK:STDOUT: `i32` as `interface SubWith(U = i32)`,
  164. // CHECK:STDOUT: `i32` as `interface MulWith(U = i32)`,
  165. // CHECK:STDOUT: `i32` as `interface DivWith(U = i32)`,
  166. // CHECK:STDOUT: `i32` as `interface ModWith(U = i32)`,
  167. // CHECK:STDOUT: `i32` as `interface BitComplement`,
  168. // CHECK:STDOUT: `i32` as `interface BitAndWith(U = i32)`,
  169. // CHECK:STDOUT: `i32` as `interface BitOrWith(U = i32)`,
  170. // CHECK:STDOUT: `i32` as `interface BitXorWith(U = i32)`,
  171. // CHECK:STDOUT: `i32` as `interface LeftShiftWith(U = i32)`,
  172. // CHECK:STDOUT: `i32` as `interface RightShiftWith(U = i32)`,
  173. // CHECK:STDOUT: `i32` as `interface Inc`,
  174. // CHECK:STDOUT: `i32` as `interface Dec`,
  175. // CHECK:STDOUT: `U` as `interface __EqualConverter` [0],
  176. // CHECK:STDOUT: `(T1,)` as `interface As(T = (U1,))` [0, 0, 0; 1, 1, 0, 0, 0],
  177. // CHECK:STDOUT: `(T1, T2)` as `interface As(T = (U1, U2))` [0, 0, 0; 0, 0, 1; 1, 1, 0, 0, 0; 1, 1, 0, 0, 1],
  178. // CHECK:STDOUT: `(T1, U1)` as `interface EqWith(U = (T2, U2))` [0, 0, 0; 0, 0, 1; 1, 1, 0, 0, 0; 1, 1, 0, 0, 1],
  179. // CHECK:STDOUT: `(T1, T2, T3)` as `interface As(T = (U1, U2, U3))` [0, 0, 0; 0, 0, 1; 0, 0, 2; 1, 1, 0, 0, 0; 1, 1, 0, 0, 1; 1, 1, 0, 0, 2],
  180. // CHECK:STDOUT: `T` as `interface ImplicitAs(T = U)` [0; 1, 1, 0],
  181. // CHECK:STDOUT: `T` as `interface As(T = U)` [0; 1, 1, 0],
  182. // CHECK:STDOUT: `T` as `interface ImplicitAs(T = U)` [0; 1, 1, 0],
  183. // CHECK:STDOUT: `T` as `interface As(T = U)` [0; 1, 1, 0],
  184. // CHECK:STDOUT: `T` as `interface AssignWith(U = U)` [0; 1, 1, 0],
  185. // CHECK:STDOUT: `T` as `interface AddAssignWith(U = U)` [0; 1, 1, 0],
  186. // CHECK:STDOUT: `T` as `interface SubAssignWith(U = U)` [0; 1, 1, 0],
  187. // CHECK:STDOUT: `T` as `interface MulAssignWith(U = U)` [0; 1, 1, 0],
  188. // CHECK:STDOUT: `T` as `interface DivAssignWith(U = U)` [0; 1, 1, 0],
  189. // CHECK:STDOUT: `T` as `interface ModAssignWith(U = U)` [0; 1, 1, 0],
  190. // CHECK:STDOUT: `T` as `interface BitAndAssignWith(U = U)` [0; 1, 1, 0],
  191. // CHECK:STDOUT: `T` as `interface BitOrAssignWith(U = U)` [0; 1, 1, 0],
  192. // CHECK:STDOUT: `T` as `interface BitXorAssignWith(U = U)` [0; 1, 1, 0],
  193. // CHECK:STDOUT: `T` as `interface LeftShiftAssignWith(U = U)` [0; 1, 1, 0],
  194. // CHECK:STDOUT: `T` as `interface RightShiftAssignWith(U = U)` [0; 1, 1, 0]]
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: *** type checking stmt at (context_main.carbon:11)
  197. // CHECK:STDOUT: ```
  198. // CHECK:STDOUT: {
  199. // CHECK:STDOUT: return 0;
  200. // CHECK:STDOUT: }
  201. // CHECK:STDOUT: ```
  202. // CHECK:STDOUT: ->> checking Block `{ ... }` (context_main.carbon:11)
  203. // CHECK:STDOUT:
  204. // CHECK:STDOUT: *** type checking stmt at (context_main.carbon:10)
  205. // CHECK:STDOUT: ```
  206. // CHECK:STDOUT: return 0;
  207. // CHECK:STDOUT: ```
  208. // CHECK:STDOUT: ->> checking ReturnExpression `return ...;` (context_main.carbon:10)
  209. // CHECK:STDOUT: ->> checking IntLiteral `0` (context_main.carbon:10)
  210. // CHECK:STDOUT: ->> finished checking function `Main` (context_main.carbon:11)
  211. // CHECK:STDOUT: ->> checking CallExpression `Main()` (<Main()>:0)
  212. // CHECK:STDOUT: ->> checking IdentifierExpression `Main` (<Main()>:0)
  213. // CHECK:STDOUT: ->> checking TupleLiteral `()` (<Main()>:0)
  214. // CHECK:STDOUT: ->> checking call to function of type `fn () -> i32` with arguments of type `()` (<Main()>:0)
  215. // CHECK:STDOUT: ->> performing argument deduction for bindings: []
  216. // CHECK:STDOUT: ==> deduction succeeded with results: []
  217. // CHECK:STDOUT:
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: * * * * * * * * * * resolving unformed variables * * * * * * * * * *
  220. // CHECK:STDOUT: ----------------------------------------------------------------------
  221. // CHECK:STDOUT: ->> resolving-unformed in decl `interface TestInterface` (context_main.carbon:7)
  222. // CHECK:STDOUT: ->> resolving-unformed in decl `fn Main` (context_main.carbon:11)
  223. // CHECK:STDOUT: ->> resolving-unformed in stmt `{ ... }` (context_main.carbon:11)
  224. // CHECK:STDOUT: ->> resolving-unformed in stmt `return ...;` (context_main.carbon:10)
  225. // CHECK:STDOUT:
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: * * * * * * * * * * printing declarations * * * * * * * * * *
  228. // CHECK:STDOUT: ---------------------------------------------------------------
  229. // CHECK:STDOUT: interface TestInterface {
  230. // CHECK:STDOUT: }
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: fn Main () -> i32
  233. // CHECK:STDOUT: {
  234. // CHECK:STDOUT: return 0;
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: * * * * * * * * * * starting execution * * * * * * * * * *
  239. // CHECK:STDOUT: ------------------------------------------------------------
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: - - - - - initializing globals - - - - -
  242. // CHECK:STDOUT: ------------------------------------------
  243. // CHECK:STDOUT: >[] stack-push: DeclarationAction pos: 0 `interface TestInterface` (context_main.carbon:7)
  244. // CHECK:STDOUT: ->> step DeclarationAction pos: 0 `interface TestInterface` (context_main.carbon:7) --->
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: *** declaration at (context_main.carbon:7)
  247. // CHECK:STDOUT: ```
  248. // CHECK:STDOUT: interface TestInterface {
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT: ```
  251. // CHECK:STDOUT: <[] stack-pop: DeclarationAction pos: 0 `interface TestInterface` (context_main.carbon:7)
  252. // CHECK:STDOUT: >[] stack-push: DeclarationAction pos: 0 `fn Main` (context_main.carbon:11)
  253. // CHECK:STDOUT: ->> step DeclarationAction pos: 0 `fn Main` (context_main.carbon:11) --->
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: *** declaration at (context_main.carbon:11)
  256. // CHECK:STDOUT: ```
  257. // CHECK:STDOUT: fn Main () -> i32
  258. // CHECK:STDOUT: {
  259. // CHECK:STDOUT: return 0;
  260. // CHECK:STDOUT: }
  261. // CHECK:STDOUT: ```
  262. // CHECK:STDOUT: <[] stack-pop: DeclarationAction pos: 0 `fn Main` (context_main.carbon:11)
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: - - - - - calling main function - - - - -
  265. // CHECK:STDOUT: -------------------------------------------
  266. // CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `Main()` (<Main()>:0)
  267. // CHECK:STDOUT: ->> step ValueExpressionAction pos: 0 `Main()` (<Main()>:0) --->
  268. // CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `Main()` (<Main()>:0)
  269. // CHECK:STDOUT: ->> step ExpressionAction pos: 0 `Main()` (<Main()>:0) --->
  270. // CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `Main` (<Main()>:0)
  271. // CHECK:STDOUT: ->> step ValueExpressionAction pos: 0 `Main` (<Main()>:0) --->
  272. // CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `Main` (<Main()>:0)
  273. // CHECK:STDOUT: ->> step ExpressionAction pos: 0 `Main` (<Main()>:0) --->
  274. // CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 0 `Main` (<Main()>:0)
  275. // CHECK:STDOUT: ->> step ValueExpressionAction pos: 1 `Main` results: [`fun<Main>`] (<Main()>:0) --->
  276. // CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `Main` results: [`fun<Main>`] (<Main()>:0)
  277. // CHECK:STDOUT: ->> step ExpressionAction pos: 1 `Main()` results: [`fun<Main>`] scope: [] (<Main()>:0) --->
  278. // CHECK:STDOUT: -() calling function: fun<Main>
  279. // CHECK:STDOUT: === match pattern `()`
  280. // CHECK:STDOUT: from value expression with value `()`
  281. // CHECK:STDOUT: >[] stack-push: ScopeAction pos: 0 scope: [] (None)
  282. // CHECK:STDOUT: >[] stack-push: StatementAction pos: 0 `{ ... }` (context_main.carbon:11)
  283. // CHECK:STDOUT: ->> step StatementAction pos: 0 `{ ... }` (context_main.carbon:11) --->
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: *** statement at (context_main.carbon:11)
  286. // CHECK:STDOUT: ```
  287. // CHECK:STDOUT: {
  288. // CHECK:STDOUT: return 0;
  289. // CHECK:STDOUT: }
  290. // CHECK:STDOUT: ```
  291. // CHECK:STDOUT: >[] stack-push: StatementAction pos: 0 `return ...;` (context_main.carbon:10)
  292. // CHECK:STDOUT: ->> step StatementAction pos: 0 `return ...;` (context_main.carbon:10) --->
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: *** statement at (context_main.carbon:10)
  295. // CHECK:STDOUT: ```
  296. // CHECK:STDOUT: return 0;
  297. // CHECK:STDOUT: ```
  298. // CHECK:STDOUT: >[] stack-push: ValueExpressionAction pos: 0 `0` (context_main.carbon:10)
  299. // CHECK:STDOUT: ->> step ValueExpressionAction pos: 0 `0` (context_main.carbon:10) --->
  300. // CHECK:STDOUT: >[] stack-push: ExpressionAction pos: 0 `0` (context_main.carbon:10)
  301. // CHECK:STDOUT: ->> step ExpressionAction pos: 0 `0` (context_main.carbon:10) --->
  302. // CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 0 `0` (context_main.carbon:10)
  303. // CHECK:STDOUT: ->> step ValueExpressionAction pos: 1 `0` results: [`0`] (context_main.carbon:10) --->
  304. // CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `0` results: [`0`] (context_main.carbon:10)
  305. // CHECK:STDOUT: ->> step StatementAction pos: 1 `return ...;` results: [`0`] (context_main.carbon:10) --->
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: *** statement at (context_main.carbon:10)
  308. // CHECK:STDOUT: ```
  309. // CHECK:STDOUT: return 0;
  310. // CHECK:STDOUT: ```
  311. // CHECK:STDOUT: <[] stack-pop: StatementAction pos: 1 `return ...;` results: [`0`] (context_main.carbon:10)
  312. // CHECK:STDOUT: <[] stack-pop: StatementAction pos: 1 `{ ... }` scope: [] (context_main.carbon:11)
  313. // CHECK:STDOUT: <[] stack-pop: ScopeAction pos: 0 scope: [] (None)
  314. // CHECK:STDOUT: >[] stack-push: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
  315. // CHECK:STDOUT: >[] stack-push: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
  316. // CHECK:STDOUT: ->> step CleanUpAction pos: 0 scope: [] (stack cleanup:1) --->
  317. // CHECK:STDOUT: <[] stack-pop: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
  318. // CHECK:STDOUT: ->> step CleanUpAction pos: 0 scope: [] (stack cleanup:1) --->
  319. // CHECK:STDOUT: <[] stack-pop: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
  320. // CHECK:STDOUT: ->> step ExpressionAction pos: 2 `Main()` results: [`fun<Main>`, `0`] scope: [] (<Main()>:0) --->
  321. // CHECK:STDOUT: <[] stack-pop: ExpressionAction pos: 2 `Main()` results: [`fun<Main>`, `0`] scope: [] (<Main()>:0)
  322. // CHECK:STDOUT: >[] stack-push: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
  323. // CHECK:STDOUT: ->> step CleanUpAction pos: 0 scope: [] (stack cleanup:1) --->
  324. // CHECK:STDOUT: <[] stack-pop: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
  325. // CHECK:STDOUT: ->> step ValueExpressionAction pos: 1 `Main()` results: [`0`] (<Main()>:0) --->
  326. // CHECK:STDOUT: <[] stack-pop: ValueExpressionAction pos: 1 `Main()` results: [`0`] (<Main()>:0)
  327. // CHECK:STDOUT: ==> interpreter result: 0
  328. // CHECK:STDOUT:
  329. // CHECK:STDOUT:
  330. // CHECK:STDOUT: * * * * * * * * * * printing timing * * * * * * * * * *
  331. // CHECK:STDOUT: ---------------------------------------------------------
  332. // CHECK:STDOUT: Time elapsed in ExecProgram: {{\d+}}ms
  333. // CHECK:STDOUT: Time elapsed in AnalyzeProgram: {{\d+}}ms
  334. // CHECK:STDOUT: Time elapsed in AddPrelude: {{\d+}}ms
  335. // CHECK:STDOUT: Time elapsed in Parse: {{\d+}}ms
  336. // CHECK:STDOUT: result: 0