blob: aff0e03d1d91513651db11d00f56d9e3b21588b0 (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// { dg-do run }
// { dg-require-effective-target dfp }
extern "C" void abort ();
typedef float dec32 __attribute__((mode(SD)));
typedef float dec64 __attribute__((mode(DD)));
typedef float dec128 __attribute__((mode(TD)));
int
foo (double fp)
{
if (fp < 32.0)
throw (dec32)32;
if (fp < 64.0)
throw (dec64)64;
if (fp < 128.0)
throw (dec128)128;
return 0;
}
int bar (double fp)
{
try
{
foo (fp);
abort ();
}
catch (dec32 df)
{
if (df != (dec32)32)
abort ();
}
catch (dec64 dd)
{
if (dd != (dec64)64)
abort ();
}
catch (dec128 dl)
{
if (dl != (dec128)128)
abort ();
}
return 0;
}
int
main ()
{
bar (10.0);
bar (20.0);
bar (100.0);
return 0;
}
|