view gcc/testsuite/c-c++-common/attr-opt-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR c/70255 */
/* { dg-do compile } */

double
fn1 (double h, double l) /* { dg-message "previous definition" } */
{
  return h + l;
}
double fn1 (double, double) __attribute__ ((optimize ("no-associative-math"))); /* { dg-warning "optimization attribute" } */

__attribute__ ((optimize ("no-associative-math"))) double
fn2 (double h, double l)
{
  return h + l;
}
double fn2 (double, double) __attribute__ ((optimize ("no-associative-math")));

__attribute__ ((optimize ("no-associative-math"))) double
fn3 (double h, double l) /* { dg-message "previous definition" } */
{
  return h + l;
}
double fn3 (double, double) __attribute__ ((optimize ("O2,no-associative-math"))); /* { dg-warning "optimization attribute" } */

__attribute__ ((optimize ("no-associative-math,O2"))) double
fn4 (double h, double l) /* { dg-message "previous definition" } */
{
  return h + l;
}
double fn4 (double, double) __attribute__ ((optimize ("O2,no-associative-math"))); /* { dg-warning "optimization attribute" } */

__attribute__ ((optimize ("no-reciprocal-math"), optimize ("no-associative-math"))) int
fn5 (void)
{
  return 0;
}
int __attribute__ ((optimize ("no-associative-math"), optimize ("no-reciprocal-math"))) fn5 (void);