summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr34312.c
blob: 846c2853799d1cc97e53194f98e424a903fe88d3 (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
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-require-effective-target fpic } */
/* { dg-options "-O2 -march=pentium-m -fpic" } */

typedef struct
{
  unsigned char seq[3];
} JamoNormMap;

static const JamoNormMap *
JamoClusterSearch (JamoNormMap aKey, const JamoNormMap * aClusters,
		   short aClustersSize)
{
  unsigned short l = 0, u = aClustersSize - 1;
  unsigned short h = (l + u) / 2;

  if ((aKey.seq[1] - aClusters[h].seq[1]) < 0)
    return JamoClusterSearch (aKey, &(aClusters[l]), h - l);
}

short
JamoSrchReplace (const JamoNormMap * aClusters, unsigned short aClustersSize,
		 unsigned short * aIn, unsigned int * aLength,
		 unsigned short aOffset)
{
  JamoNormMap key;

  key.seq[0] = 0;
  key.seq[1] = 1;
  key.seq[2] = 2;

  JamoClusterSearch (key, aClusters, aClustersSize);
}