/* { dg-do compile } */ /* { dg-skip-if "HTM inline asm supported" { powerpc_as_p10_htm } } */ /* Use -Wno-attributes to suppress the possible warning on always_inline. */ /* { dg-options "-O2 -mdejagnu-cpu=power9 -Wno-attributes" } */ /* Verify it emits error messages on non-empty inline asm. */ #include #define HWY_PRAGMA(tokens) _Pragma (#tokens) #define HWY_PUSH_ATTRIBUTES(targets_str) HWY_PRAGMA (GCC target targets_str) __attribute__ ((always_inline)) void PreventElision (int output) /* { dg-error "inlining failed in call to .* target specific option mismatch" } */ { asm("nop" : "+r"(output) : : "memory"); } #define HWY_BEFORE_NAMESPACE() HWY_PUSH_ATTRIBUTES (",cpu=power10") HWY_BEFORE_NAMESPACE () namespace detail { template struct CappedTagChecker { }; } template using CappedTag = detail::CappedTagChecker; template struct ForeachCappedR { static void Do (size_t, size_t) { CappedTag d; Test () (int(), d); } }; template struct ForPartialVectors { template void operator() (T) { ForeachCappedR::Do (1, 1); } }; struct TestFloorLog2 { template void operator() (T, DF) { PreventElision (0x10); /* { dg-message "called from here" } */ } }; void TestAllFloorLog2 () { ForPartialVectors () (float()); }