float fp_reassoc_simple(float a, float b, float c) {
#pragma clang fp reassociate(on)
a = b + c;
return a * b + c;
}
float fp_reassoc_scoped(float a, float b, float c) {
{
#pragma clang fp reassociate(on)
}
return a * b + c;
}
class Foo {};
Foo operator+(Foo, Foo);
template <typename T>
T template_reassoc(T a, T b, T c) {
#pragma clang fp reassociate(on)
return ((a + b) - c) + c;
}
float fp_reassoc_template(float a, float b, float c) {
return template_reassoc<float>(a, b, c);
}
#pragma clang fp reassociate(on)
float fp_file_scope_on(float a, float b, float c) {
return (a * c) + (b * c);
}
float fp_file_scope_stop(float a, float b, float c) {
a = a + a;
{
#pragma clang fp reassociate(off)
return (a * c) - (b * c);
}
}
#pragma clang fp reassociate(off)
float fp_reassoc_off(float a, float b, float c) {
return (a / c) + (b / c);
}
float fp_reassoc_many(float a, float b, float c) {
#pragma clang fp reassociate(off) reassociate(on)
return (a / c) + (b / c);
}
float helper_func(float a, float b, float c) { return a + b + c; }
float fp_reassoc_call_helper(float a, float b, float c) {
#pragma clang fp reassociate(on)
return helper_func(a, b, c);
}