1/* PR target/39240 */ 2 3extern void abort (void); 4 5__attribute__ ((noinline)) 6static int foo1 (int x) 7{ 8 return x; 9} 10 11__attribute__ ((noinline)) 12unsigned int bar1 (int x) 13{ 14 return foo1 (x + 6); 15} 16 17volatile unsigned long l1 = (unsigned int) -4; 18 19__attribute__ ((noinline)) 20static short int foo2 (int x) 21{ 22 return x; 23} 24 25__attribute__ ((noinline)) 26unsigned short int bar2 (int x) 27{ 28 return foo2 (x + 6); 29} 30 31volatile unsigned long l2 = (unsigned short int) -4; 32 33__attribute__ ((noinline)) 34static signed char foo3 (int x) 35{ 36 return x; 37} 38 39__attribute__ ((noinline)) 40unsigned char bar3 (int x) 41{ 42 return foo3 (x + 6); 43} 44 45volatile unsigned long l3 = (unsigned char) -4; 46 47__attribute__ ((noinline)) 48static unsigned int foo4 (int x) 49{ 50 return x; 51} 52 53__attribute__ ((noinline)) 54int bar4 (int x) 55{ 56 return foo4 (x + 6); 57} 58 59volatile unsigned long l4 = (int) -4; 60 61__attribute__ ((noinline)) 62static unsigned short int foo5 (int x) 63{ 64 return x; 65} 66 67__attribute__ ((noinline)) 68short int bar5 (int x) 69{ 70 return foo5 (x + 6); 71} 72 73volatile unsigned long l5 = (short int) -4; 74 75__attribute__ ((noinline)) 76static unsigned char foo6 (int x) 77{ 78 return x; 79} 80 81__attribute__ ((noinline)) 82signed char bar6 (int x) 83{ 84 return foo6 (x + 6); 85} 86 87volatile unsigned long l6 = (signed char) -4; 88 89int 90main (void) 91{ 92 if (bar1 (-10) != l1) 93 abort (); 94 if (bar2 (-10) != l2) 95 abort (); 96 if (bar3 (-10) != l3) 97 abort (); 98 if (bar4 (-10) != l4) 99 abort (); 100 if (bar5 (-10) != l5) 101 abort (); 102 if (bar6 (-10) != l6) 103 abort (); 104 return 0; 105} 106