From d2cf5f997fa1a72e92b641dd42177ea7a98ae1a6 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Thu, 3 Apr 2008 02:08:13 +0000 Subject: [PATCH] re PR middle-end/35800 (Revision 133835 failed to compile binutils) PR middle-end/35800 * gcc.c-torture/execute/pr35800.c: New test. From-SVN: r133856 --- gcc/testsuite/ChangeLog | 5 + gcc/testsuite/gcc.c-torture/execute/pr35800.c | 103 ++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr35800.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1e2d40d9afe..07af98dfb92 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-04-03 Richard Guenther + + PR middle-end/35800 + * gcc.c-torture/execute/pr35800.c: New test. + 2008-04-02 Joseph Myers * gcc.dg/cpp/cmdlne-dU-1.c, gcc.dg/cpp/cmdlne-dU-2.c, diff --git a/gcc/testsuite/gcc.c-torture/execute/pr35800.c b/gcc/testsuite/gcc.c-torture/execute/pr35800.c new file mode 100644 index 00000000000..22b36f0b3bb --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr35800.c @@ -0,0 +1,103 @@ +extern void abort (void); + +int stab_xcoff_builtin_type (int typenum) +{ + const char *name; + if (typenum >= 0 || typenum < -34) + { + return 0; + } + switch (-typenum) + { + case 1: + name = "int"; + break; + case 2: + name = "char"; + case 3: + name = "short"; + break; + case 4: + name = "long"; + case 5: + name = "unsigned char"; + case 6: + name = "signed char"; + case 7: + name = "unsigned short"; + case 8: + name = "unsigned int"; + case 9: + name = "unsigned"; + case 10: + name = "unsigned long"; + case 11: + name = "void"; + case 12: + name = "float"; + case 13: + name = "double"; + case 14: + name = "long double"; + case 15: + name = "integer"; + case 16: + name = "boolean"; + case 17: + name = "short real"; + case 18: + name = "real"; + case 19: + name = "stringptr"; + case 20: + name = "character"; + case 21: + name = "logical*1"; + case 22: + name = "logical*2"; + case 23: + name = "logical*4"; + case 24: + name = "logical"; + case 25: + name = "complex"; + case 26: + name = "double complex"; + case 27: + name = "integer*1"; + case 28: + name = "integer*2"; + case 29: + name = "integer*4"; + case 30: + name = "wchar"; + case 31: + name = "long long"; + case 32: + name = "unsigned long long"; + case 33: + name = "logical*8"; + case 34: + name = "integer*8"; + } + return name[0]; +} + +int main() +{ + int i; + if (stab_xcoff_builtin_type(0) != 0) + abort (); + if (stab_xcoff_builtin_type(-1) != 'i') + abort (); + if (stab_xcoff_builtin_type(-2) != 's') + abort (); + if (stab_xcoff_builtin_type(-3) != 's') + abort (); + for (i = -4; i >= -34; --i) + if (stab_xcoff_builtin_type(i) != 'i') + abort (); + if (stab_xcoff_builtin_type(-35) != 0) + abort (); + return 0; +} -- 2.30.2