Support basic int printing (#1405)

We don't have overload resolution, so I've simply added PrintInt for now. But it's really tempting to turn __intrinsic_print into a total kludge function.
This commit is contained in:
Jon Ross-Perkins
2022-07-17 23:35:44 -04:00
committed by GitHub
parent 770376bd6e
commit a41915b5af
8 changed files with 80 additions and 24 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
package ExplorerTest api;
fn Main() -> i32 {
var s: auto = "Hello world!\n";
var s: auto = "Hello world!";
Print(s);
return 0;
}
+18
View File
@@ -0,0 +1,18 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// RUN: %{explorer} %s 2>&1 | \
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s
// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s
// AUTOUPDATE: %{explorer} %s
// CHECK: Printing 1
// CHECK: result: 0
package ExplorerTest api;
fn Main() -> i32 {
PrintInt("Printing {0}", 1);
return 0;
}