...

Text file src/debug/dwarf/testdata/typedef.c

Documentation: debug/dwarf/testdata

     1// Copyright 2009 The Go Authors. All rights reserved.
     2// Use of this source code is governed by a BSD-style
     3// license that can be found in the LICENSE file.
     4
     5/*
     6Linux ELF:
     7gcc -gdwarf-2 -m64 -c typedef.c && gcc -gdwarf-2 -m64 -o typedef.elf typedef.o
     8
     9OS X Mach-O:
    10gcc -gdwarf-2 -m64 -c typedef.c -o typedef.macho
    11gcc -gdwarf-4 -m64 -c typedef.c -o typedef.macho4
    12*/
    13#include <complex.h>
    14
    15typedef volatile int* t_ptr_volatile_int;
    16typedef const char *t_ptr_const_char;
    17typedef long t_long;
    18typedef unsigned short t_ushort;
    19typedef int t_func_int_of_float_double(float, double);
    20typedef int (*t_ptr_func_int_of_float_double)(float, double);
    21typedef int (*t_ptr_func_int_of_float_complex)(float complex);
    22typedef int (*t_ptr_func_int_of_double_complex)(double complex);
    23typedef int (*t_ptr_func_int_of_long_double_complex)(long double complex);
    24typedef int *t_func_ptr_int_of_char_schar_uchar(char, signed char, unsigned char);
    25typedef void t_func_void_of_char(char);
    26typedef void t_func_void_of_void(void);
    27typedef void t_func_void_of_ptr_char_dots(char*, ...);
    28typedef struct my_struct {
    29	volatile int vi;
    30	char x : 1;
    31	int y : 4;
    32	int z[0];
    33	long long array[40];
    34	int zz[0];
    35} t_my_struct;
    36typedef struct my_struct1 {
    37	int zz [1];
    38} t_my_struct1;
    39typedef union my_union {
    40	volatile int vi;
    41	char x : 1;
    42	int y : 4;
    43	long long array[40];
    44} t_my_union;
    45typedef enum my_enum {
    46	e1 = 1,
    47	e2 = 2,
    48	e3 = -5,
    49	e4 = 1000000000000000LL,
    50} t_my_enum;
    51
    52typedef struct list t_my_list;
    53struct list {
    54	short val;
    55	t_my_list *next;
    56};
    57
    58typedef struct tree {
    59	struct tree *left, *right;
    60	unsigned long long val;
    61} t_my_tree;
    62
    63t_ptr_volatile_int *a2;
    64t_ptr_const_char **a3a;
    65t_long *a4;
    66t_ushort *a5;
    67t_func_int_of_float_double *a6;
    68t_ptr_func_int_of_float_double *a7;
    69t_func_ptr_int_of_char_schar_uchar *a8;
    70t_func_void_of_char *a9;
    71t_func_void_of_void *a10;
    72t_func_void_of_ptr_char_dots *a11;
    73t_my_struct *a12;
    74t_my_struct1 *a12a;
    75t_my_union *a12b;
    76t_my_enum *a13;
    77t_my_list *a14;
    78t_my_tree *a15;
    79t_ptr_func_int_of_float_complex *a16;
    80t_ptr_func_int_of_double_complex *a17;
    81t_ptr_func_int_of_long_double_complex *a18;
    82
    83int main()
    84{
    85	return 0;
    86}

View as plain text