summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/combine-mul.c
blob: 8a2e8628482e303106e3f1d9961cffb547d1b25c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target nonpic } */
/* { dg-final { scan-assembler-not "12345" } } */

static inline unsigned int myrnd (void)
{
    static unsigned int s = 1388815473;
    s *= 1103515245;
    s += 12345;
}

struct __attribute__ ((packed)) A {
    unsigned short i:1, l:1, j:3, k:11;
};

struct A sA;
void testA (void)
{
    char *p = (char *) &sA;
    *p++ = myrnd ();
    *p++ = myrnd ();
    sA.k = -1;
}