2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / target-attribute / tattr-17.c
blob2e0fcf77ffdb86bddb3dd670ffcca59ecbecde0a
1 /* Functional tests for the "target" attribute and pragma. */
3 /* { dg-do compile { target { lp64 } } } */
4 /* { dg-require-effective-target dfp } */
5 /* { dg-require-effective-target target_attribute } */
6 /* { dg-options "-march=z13 -std=gnu99 -mno-hard-dfp" } */
8 #pragma GCC target("hard-dfp")
9 _Decimal64 p1(_Decimal64 f, _Decimal64 g)
11 return f * g;
12 /* { dg-final { scan-assembler-times "\tmdtr\t" 1 } } */
14 #pragma GCC reset_options
16 #pragma GCC target("no-hard-dfp")
17 _Decimal64 p0(_Decimal64 f, _Decimal64 g)
19 return f / 2;
20 /* { dg-final { scan-assembler-not "\tddtr\t" } } */
22 #pragma GCC reset_options
24 __attribute__ ((target("hard-dfp")))
25 _Decimal64 a1(_Decimal64 f, _Decimal64 g)
27 /* { dg-final { scan-assembler-times "\tadtr\t" 1 } } */
28 return f + g;
31 __attribute__ ((target("no-hard-dfp")))
32 _Decimal64 a0(_Decimal64 f, _Decimal64 g)
34 return f - g;
35 /* { dg-final { scan-assembler-not "\tsdtr\t" } } */
38 _Decimal64 d(_Decimal64 f, _Decimal64 g)
40 return f - g;
41 /* { dg-final { scan-assembler-not "\tsdtr\t" } } */