aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.apple/asm-block-50.c
blob: bb5f064d8b01ea09c13ee7eca01410dd0cc890d1 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* APPLE LOCAL file CW asm blocks */
/* { dg-do assemble { target i?86*-*-darwin* } } */
/* { dg-options { -fasm-blocks -msse3 } } */
/* Radar 4505741 */

static int c[5];
void foo(int pa[5], int j) {
  unsigned int *ptr = (unsigned int *)0x12345678;
  static int b[5];
  int i;
  int a[5];
  _asm {
    mov   esi, [ptr][0]
    mov   esi, [ptr]
    mov   esi, [esi][eax]
    mov   esi, [esi+eax]
    mov   esi, [esi+eax+4]
    mov   esi, [esi][eax][4]
    mov   esi, [a][4]
    mov   esi, [pa]
    mov   esi, [j]
    mov   esi, [i]
    mov   esi, i
    mov   esi, [b][4]	/* { dg-warning "non-pic addressing form not suitible for pic code" } */
    mov   esi, [c][4]	/* { dg-warning "non-pic addressing form not suitible for pic code" } */
    mov   esi, [b]	/* { dg-warning "non-pic addressing form not suitible for pic code" } */
    mov   esi, [c]	/* { dg-warning "non-pic addressing form not suitible for pic code" } */
    mov   esi, [ptr][4]        /* { dg-warning "will consume extra register" } */
    mov   esi, [ptr+4]         /* { dg-warning "will consume extra register" } */
    mov   esi, [ptr][eax]      /* { dg-warning "will consume extra register" } */
    mov   esi, [ptr+eax]       /* { dg-warning "will consume extra register" } */
    mov   esi, [-4][pa+esi]    /* { dg-warning "will consume extra register" } */
    mov   esi, [-4][j+esi]     /* { dg-warning "will consume extra register" } */
    mov   esi, [pa-4+esi]      /* { dg-warning "will consume extra register" } */
    mov   esi, [a][3]          /* { dg-warning "will consume extra register" } */
    jmp   [a+4*ebx]            /* { dg-warning "will consume extra register" } */
  }
}