summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr8788-1.c
blob: 74e1694090c199c9ebebaae2563ef01c0f1fb3a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* PR inline-asm/8788 */
/* { dg-do compile } */
/* { dg-options "-O2" } */

typedef struct {
    long x[6];
} myjmp_buf;

typedef struct {
    myjmp_buf regs;
} my_stack;

void switch_to_stack (my_stack *stack){
    asm (  /* { dg-error "impossible constraint" } */
/* { dg-warning "asm operand 1" "asm operand 1" { target *-*-* } 14 } */
        "\n"
        : "+r" (stack->regs)
    );
}