* gcc.target/i386/pr70021.c: Add -mtune=skylake.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr39139.c
blobe4cb845f9ec7709d150a8e58033c27bc098e3621
1 /* PR target/39139 */
2 /* { dg-do compile } */
3 /* { dg-options "-Os" } */
5 #ifdef __x86_64__
6 # define AX_REG asm ("rax")
7 # define DI_REG asm ("rdi")
8 # define SI_REG asm ("rsi")
9 #else
10 # define AX_REG asm ("eax")
11 # define DI_REG asm ("edi")
12 # define SI_REG asm ("esi")
13 #endif
15 __extension__ typedef __SIZE_TYPE__ size_t;
17 static inline int
18 foo (unsigned int x, void *y)
20 register size_t r AX_REG;
21 register size_t a1 DI_REG;
22 register size_t a2 SI_REG;
23 a1 = (size_t) x;
24 a2 = (size_t) y;
25 asm volatile ("" : "=r" (r), "+r" (a1), "+r" (a2) : : "memory");
26 return (int) r;
29 struct T { size_t t1, t2; unsigned int t3, t4, t5; };
31 int
32 bar (size_t x, unsigned int y, size_t u, unsigned int v)
34 long r;
35 struct T e = { .t1 = x, .t2 = u };
37 if (x << y != u << v)
38 return 5;
39 r = foo (11, &e);
40 return e.t3 == x;