diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/asm-flag-5.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/asm-flag-5.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/asm-flag-5.c b/gcc/testsuite/gcc.target/i386/asm-flag-5.c new file mode 100644 index 00000000000..151157daf41 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/asm-flag-5.c @@ -0,0 +1,29 @@ +/* Test error conditions of asm flag outputs. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +void f_B(void) { _Bool x; asm("" : "=@ccc"(x)); } +void f_c(void) { char x; asm("" : "=@ccc"(x)); } +void f_s(void) { short x; asm("" : "=@ccc"(x)); } +void f_i(void) { int x; asm("" : "=@ccc"(x)); } +void f_l(void) { long x; asm("" : "=@ccc"(x)); } + +void f_f(void) +{ + float x; + asm("" : "=@ccc"(x)); /* { dg-error invalid type } */ +} + +void f_d(void) +{ + double x; + asm("" : "=@ccc"(x)); /* { dg-error invalid type } */ +} + +struct S { int x[3]; }; + +void f_S(void) +{ + struct S x; + asm("" : "=@ccc"(x)); /* { dg-error invalid type } */ +} |