Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr35800.c
blobe12b4713f481244d831e9283e0fb64714b64aa6d
1 /*
2 pr35800.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 84
10 #endif
12 int stab_xcoff_builtin_type (int typenum)
14 const char *name;
15 if (typenum >= 0 || typenum < -34)
17 return 0;
19 switch (-typenum)
21 case 1:
22 name = "int";
23 break;
24 case 2:
25 name = "char";
26 case 3:
27 name = "short";
28 break;
29 case 4:
30 name = "long";
31 case 5:
32 name = "unsigned char";
33 case 6:
34 name = "signed char";
35 case 7:
36 name = "unsigned short";
37 case 8:
38 name = "unsigned int";
39 case 9:
40 name = "unsigned";
41 case 10:
42 name = "unsigned long";
43 case 11:
44 name = "void";
45 case 12:
46 name = "float";
47 case 13:
48 name = "double";
49 case 14:
50 name = "long double";
51 case 15:
52 name = "integer";
53 case 16:
54 name = "boolean";
55 case 17:
56 name = "short real";
57 case 18:
58 name = "real";
59 case 19:
60 name = "stringptr";
61 case 20:
62 name = "character";
63 case 21:
64 name = "logical*1";
65 case 22:
66 name = "logical*2";
67 case 23:
68 name = "logical*4";
69 case 24:
70 name = "logical";
71 case 25:
72 name = "complex";
73 case 26:
74 name = "double complex";
75 case 27:
76 name = "integer*1";
77 case 28:
78 name = "integer*2";
79 case 29:
80 name = "integer*4";
81 case 30:
82 name = "wchar";
83 case 31:
84 name = "long long";
85 case 32:
86 name = "unsigned long long";
87 case 33:
88 name = "logical*8";
89 case 34:
90 name = "integer*8";
92 return name[0];
95 void
96 testTortureExecute (void)
98 int i;
99 if (stab_xcoff_builtin_type(0) != 0)
100 ASSERT (0);
101 if (stab_xcoff_builtin_type(-1) != 'i')
102 ASSERT (0);
103 if (stab_xcoff_builtin_type(-2) != 's')
104 ASSERT (0);
105 if (stab_xcoff_builtin_type(-3) != 's')
106 ASSERT (0);
107 for (i = -4; i >= -34; --i)
108 if (stab_xcoff_builtin_type(i) != 'i')
109 ASSERT (0);
110 if (stab_xcoff_builtin_type(-35) != 0)
111 ASSERT (0);
112 return;