You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

96 lines
2.5 KiB

  1. // Copyright 2018 Google Inc. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /*
  15. Linux ELF:
  16. gcc -gdwarf-2 -m64 -c typedef.c && gcc -gdwarf-2 -m64 -o typedef.elf typedef.o
  17. OS X Mach-O:
  18. gcc -gdwarf-2 -m64 -c typedef.c -o typedef.macho
  19. */
  20. #include <complex.h>
  21. typedef volatile int* t_ptr_volatile_int;
  22. typedef const char *t_ptr_const_char;
  23. typedef long t_long;
  24. typedef unsigned short t_ushort;
  25. typedef int t_func_int_of_float_double(float, double);
  26. typedef int (*t_ptr_func_int_of_float_double)(float, double);
  27. typedef int (*t_ptr_func_int_of_float_complex)(float complex);
  28. typedef int (*t_ptr_func_int_of_double_complex)(double complex);
  29. typedef int (*t_ptr_func_int_of_long_double_complex)(long double complex);
  30. typedef int *t_func_ptr_int_of_char_schar_uchar(char, signed char, unsigned char);
  31. typedef void t_func_void_of_char(char);
  32. typedef void t_func_void_of_void(void);
  33. typedef void t_func_void_of_ptr_char_dots(char*, ...);
  34. typedef struct my_struct {
  35. volatile int vi;
  36. char x : 1;
  37. int y : 4;
  38. int z[0];
  39. long long array[40];
  40. int zz[0];
  41. } t_my_struct;
  42. typedef struct my_struct1 {
  43. int zz [1];
  44. } t_my_struct1;
  45. typedef union my_union {
  46. volatile int vi;
  47. char x : 1;
  48. int y : 4;
  49. long long array[40];
  50. } t_my_union;
  51. typedef enum my_enum {
  52. e1 = 1,
  53. e2 = 2,
  54. e3 = -5,
  55. e4 = 1000000000000000LL,
  56. } t_my_enum;
  57. typedef struct list t_my_list;
  58. struct list {
  59. short val;
  60. t_my_list *next;
  61. };
  62. typedef struct tree {
  63. struct tree *left, *right;
  64. unsigned long long val;
  65. } t_my_tree;
  66. t_ptr_volatile_int *a2;
  67. t_ptr_const_char **a3a;
  68. t_long *a4;
  69. t_ushort *a5;
  70. t_func_int_of_float_double *a6;
  71. t_ptr_func_int_of_float_double *a7;
  72. t_func_ptr_int_of_char_schar_uchar *a8;
  73. t_func_void_of_char *a9;
  74. t_func_void_of_void *a10;
  75. t_func_void_of_ptr_char_dots *a11;
  76. t_my_struct *a12;
  77. t_my_struct1 *a12a;
  78. t_my_union *a12b;
  79. t_my_enum *a13;
  80. t_my_list *a14;
  81. t_my_tree *a15;
  82. t_ptr_func_int_of_float_complex *a16;
  83. t_ptr_func_int_of_double_complex *a17;
  84. t_ptr_func_int_of_long_double_complex *a18;
  85. int main()
  86. {
  87. return 0;
  88. }