Back to index

glibc  2.9
Defines | Functions
tst-gcc.c File Reference
#include <stdio.h>

Go to the source code of this file.

Defines

#define __no_type_class   -1
#define __void_type_class   0
#define __integer_type_class   1
#define __char_type_class   2
#define __enumeral_type_class   3
#define __boolean_type_class   4
#define __pointer_type_class   5
#define __reference_type_class   6
#define __offset_type_class   7
#define __real_type_class   8
#define __complex_type_class   9
#define __function_type_class   10
#define __method_type_class   11
#define __record_type_class   12
#define __union_type_class   13
#define __array_type_class   14
#define __string_type_class   15
#define __set_type_class   16
#define __file_type_class   17
#define __lang_type_class   18
#define TEST(var)

Functions

int main (void)

Define Documentation

#define __array_type_class   14

Definition at line 38 of file tst-gcc.c.

#define __boolean_type_class   4

Definition at line 28 of file tst-gcc.c.

#define __char_type_class   2

Definition at line 26 of file tst-gcc.c.

#define __complex_type_class   9

Definition at line 33 of file tst-gcc.c.

#define __enumeral_type_class   3

Definition at line 27 of file tst-gcc.c.

#define __file_type_class   17

Definition at line 41 of file tst-gcc.c.

#define __function_type_class   10

Definition at line 34 of file tst-gcc.c.

#define __integer_type_class   1

Definition at line 25 of file tst-gcc.c.

#define __lang_type_class   18

Definition at line 42 of file tst-gcc.c.

#define __method_type_class   11

Definition at line 35 of file tst-gcc.c.

#define __no_type_class   -1

Definition at line 23 of file tst-gcc.c.

#define __offset_type_class   7

Definition at line 31 of file tst-gcc.c.

#define __pointer_type_class   5

Definition at line 29 of file tst-gcc.c.

#define __real_type_class   8

Definition at line 32 of file tst-gcc.c.

#define __record_type_class   12

Definition at line 36 of file tst-gcc.c.

#define __reference_type_class   6

Definition at line 30 of file tst-gcc.c.

#define __set_type_class   16

Definition at line 40 of file tst-gcc.c.

#define __string_type_class   15

Definition at line 39 of file tst-gcc.c.

#define __union_type_class   13

Definition at line 37 of file tst-gcc.c.

#define __void_type_class   0

Definition at line 24 of file tst-gcc.c.

#define TEST (   var)
Value:
({ int wrong = (__builtin_classify_type (__##var##_type)                    \
                != __##var##_type_class);                            \
     printf ("%-15s is %d: %s\n",                                    \
            #var, __builtin_classify_type (__##var##_type),                 \
            wrong ? "WRONG" : "OK");                                        \
     wrong;                                                          \
  })

Definition at line 45 of file tst-gcc.c.


Function Documentation

int main ( void  )

Definition at line 56 of file tst-gcc.c.

{
  int result = 0;
  int __integer_type;
  void *__pointer_type;
  double __real_type;
  __complex__ double __complex_type;
  struct { int a; } __record_type;
  union { int a; int b; } __union_type;

  result |= TEST (integer);
  result |= TEST (pointer);
  result |= TEST (real);
  result |= TEST (complex);
  result |= TEST (record);
  result |= TEST (union);

  return result;
}