2009-06-18 Sandra Loosemore <sandra@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / arm-fp16-compile-convert.c
blob04341959f4fc3509cefec29f37bc41290c77b479
1 /* { dg-do compile { target arm*-*-* } } */
2 /* { dg-options "-mfp16-format=ieee" } */
4 /* Test basic assignments and conversions for __fp16. */
6 __fp16 h1 = 0.0;
7 __fp16 h2 = 1234.0;
8 char c1 = 1;
9 char c2 = 2;
10 short s1 = 10;
11 short s2 = 20;
12 int i1 = -100;
13 int i2 = -200;
14 long long l1 = 1000.0;
15 long long l2 = 2000.0;
16 double d1 = -10000.0;
17 double d2 = -20000.0;
19 void f (void)
21 c1 = h1;
22 h2 = c2;
24 h1 = s1;
25 s2 = h2;
27 i1 = h1;
28 h2 = i2;
30 h1 = l1;
31 l2 = h2;
33 d1 = h1;
34 h2 = d2;
37 /* Make sure we are not falling through to undefined libcalls. */
38 /* { dg-final { scan-assembler-not "__float.ihf" } } */
39 /* { dg-final { scan-assembler-not "__fixhf.i" } } */
40 /* { dg-final { scan-assembler-not "__trunc.fhf" } } */
41 /* { dg-final { scan-assembler-not "__extendhf.f" } } */