| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mrvv-vector-bits=scalable -march=rv64gcv -mabi=lp64d -O3" } */ |
| 3 |
|
| 4 |
int printf(char *, ...); |
| 5 |
int a, l, i, p, q, t, n, o; |
| 6 |
int *volatile c; |
| 7 |
static int j; |
| 8 |
static struct pack_1_struct d; |
| 9 |
long e; |
| 10 |
char m = 5; |
| 11 |
short s; |
| 12 |
|
| 13 |
#pragma pack(1) |
| 14 |
struct pack_1_struct { |
| 15 |
long c; |
| 16 |
int d; |
| 17 |
int e; |
| 18 |
int f; |
| 19 |
int g; |
| 20 |
int h; |
| 21 |
int i; |
| 22 |
} h, r = {1}, *f = &h, *volatile g; |
| 23 |
|
| 24 |
void add_em_up(int count, ...) { |
| 25 |
__builtin_va_list ap; |
| 26 |
__builtin_va_start(ap, count); |
| 27 |
__builtin_va_end(ap); |
| 28 |
} |
| 29 |
|
| 30 |
int main() { |
| 31 |
int u; |
| 32 |
j = 0; |
| 33 |
|
| 34 |
for (; j < 9; ++j) { |
| 35 |
u = ++t ? a : 0; |
| 36 |
if (u) { |
| 37 |
int *v = &d.d; |
| 38 |
*v = g || e; |
| 39 |
*c = 0; |
| 40 |
*f = h; |
| 41 |
} |
| 42 |
s = l && c; |
| 43 |
o = i; |
| 44 |
d.f || (p = 0); |
| 45 |
q |= n; |
| 46 |
} |
| 47 |
|
| 48 |
r = *f; |
| 49 |
|
| 50 |
add_em_up(1, 1); |
| 51 |
|
| 52 |
printf("%d\n", m); |
| 53 |
} |
| 54 |
|
| 55 |
/* { dg-final { scan-assembler-times {vsetvli} 3 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |
| 56 |
/* { dg-final { scan-assembler-not {vsetivli} } } */ |
| 57 |
/* { dg-final { scan-assembler-times {vsetvli\t[a-x0-9]+,\s*[a-x0-9]+,\s*e8,\s*m1,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |
| 58 |
/* { dg-final { scan-assembler-times {li\t[a-x0-9]+,\s*32} 3 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |