| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O0 -dA -gbtf -mco-re -masm=normal" } */ |
| 3 |
|
| 4 |
enum { |
| 5 |
FIELD_SIGNEDNESS = 3, |
| 6 |
}; |
| 7 |
|
| 8 |
typedef unsigned uint; |
| 9 |
|
| 10 |
struct S { |
| 11 |
unsigned char c; |
| 12 |
int d; |
| 13 |
uint u; |
| 14 |
short ar[3]; |
| 15 |
}; |
| 16 |
|
| 17 |
unsigned int foo (struct S *s) |
| 18 |
{ |
| 19 |
unsigned d = __builtin_preserve_field_info (s->d, FIELD_SIGNEDNESS); |
| 20 |
unsigned u = __builtin_preserve_field_info (s->u, FIELD_SIGNEDNESS); |
| 21 |
unsigned ar = __builtin_preserve_field_info (s->ar[1], FIELD_SIGNEDNESS); |
| 22 |
|
| 23 |
return d + u + ar; |
| 24 |
} |
| 25 |
|
| 26 |
/* { dg-final { scan-assembler-times "\[\t \]lddw\[\t \]%r\[0-9\],1" 2 } } */ |
| 27 |
/* { dg-final { scan-assembler-times "\[\t \]lddw\[\t \]%r\[0-9\],0" 1 } } */ |
| 28 |
|
| 29 |
/* { dg-final { scan-assembler-times "ascii \"0:1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ |
| 30 |
/* { dg-final { scan-assembler-times "ascii \"0:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ |
| 31 |
/* { dg-final { scan-assembler-times "ascii \"0:3:1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ |
| 32 |
|
| 33 |
/* { dg-final { scan-assembler-times "0x3\[\t \]+\[^\n\]*bpfcr_kind" 3 } } */ |