summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/mod-1.c
blob: a7b1a92258de352175bf3b6b0d4f353a847eddfe (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
/* { dg-do compile } */
/* { dg-options "-Os -mtune=generic" } */

typedef struct {
  int a;
} VCR;

typedef struct {
  VCR vcr[8];
} VCRC;

typedef struct {
  char vcr;
} OWN;

OWN Own[16];

void
f (VCRC *x, OWN *own)
{
  x[own->vcr / 8].vcr[own->vcr % 8].a--;
  x[own->vcr / 8].vcr[own->vcr % 8].a = x[own->vcr / 8].vcr[own->vcr % 8].a;
}

/* { dg-final { scan-assembler-times "idivb" 1 } } */
/* { dg-final { scan-assembler-not "incl" } } */
/* { dg-final { scan-assembler-not "orl" } } */
/* { dg-final { scan-assembler-not "andb" } } */
/* { dg-final { scan-assembler-not "jns" } } */