| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2" } */ |
| 3 |
|
| 4 |
/* These 2 functions should be the same; even though there is a label in f1. |
| 5 |
The label should not make a difference in code generation. |
| 6 |
There sign extend should be removed as it is not needed. */ |
| 7 |
void f(int t, int a, short *b) |
| 8 |
{ |
| 9 |
short t1 = 1; |
| 10 |
if (a) |
| 11 |
{ |
| 12 |
t1 = t; |
| 13 |
} |
| 14 |
*b = t1; |
| 15 |
} |
| 16 |
|
| 17 |
void f1(int t, int a, short *b) |
| 18 |
{ |
| 19 |
short t1 = 1; |
| 20 |
if (a) |
| 21 |
{ |
| 22 |
label1: __attribute__((unused)) |
| 23 |
t1 = t; |
| 24 |
} |
| 25 |
*b = t1; |
| 26 |
} |
| 27 |
|
| 28 |
/* { dg-final { scan-assembler-not "sxth\t" } } */ |