PR middle-end/53411
[official-gcc.git] / libgo / runtime / go-print.c
blob3fe879a48af6b889b44eab989cd57900aa6375d1
1 /* go-print.c -- support for the go print statement.
3 Copyright 2009 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
7 #include <math.h>
8 #include <stdint.h>
9 #include <stdio.h>
11 #include "runtime.h"
12 #include "array.h"
13 #include "go-panic.h"
14 #include "go-string.h"
15 #include "interface.h"
17 /* This implements the various little functions which are called by
18 the predeclared functions print/println/panic/panicln. */
20 void
21 __go_print_empty_interface (struct __go_empty_interface e)
23 runtime_printf ("(%p,%p)", e.__type_descriptor, e.__object);
26 void
27 __go_print_interface (struct __go_interface i)
29 runtime_printf ("(%p,%p)", i.__methods, i.__object);
32 void
33 __go_print_slice (struct __go_open_array val)
35 runtime_printf ("[%d/%d]", val.__count, val.__capacity);
36 runtime_printpointer (val.__values);