Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr103097.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fharden-conditional-branches" } */
3
4 /* This is a slightly simplified version of
5 gcc.target/s390/vector/long-double-asm-earlyclobber.c. On x86, the f
6 constraints in asm statements imposes some requirements that the testcase
7 doesn't meet. What's unusual is that -fharden-conditional-branches extends
8 the effects of the malformed asm onto a different basic blocks, which
9 reg-stack did not expect. */
10
11 #include <assert.h>
12 #include <stdint.h>
13
14 void
15 f (void)
16 {
17 long double res, x = 0;
18 asm("" : "=f"(res) /* { dg-error "must specify a single register" } */
19 : "0"(x));
20 assert (res == x);
21 }
22
23 void
24 g (void)
25 {
26 long double res, x = 0;
27 asm("" : "=g"(res) /* this is ok. */
28 : "0"(x));
29 assert (res == x);
30 }