blob: d58e1e8d9b1a947294e5fea5611a538f470b0e93 [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-O2 -mwaitpkg" } */
/* { dg-final { scan-assembler-times "umonitor\[ \\t\]+\[^\{\n\]*%" 3 } } */
/* { dg-final { scan-assembler-times "umwait" 3 } } */
/* { dg-final { scan-assembler-times "setc\[ \\t\]+\[^\{\n\]*%" 3 } } */
/* Verify that they work in both 32bit and 64bit. */
#include <x86intrin.h>
unsigned char
foo (void *p, unsigned x, unsigned y)
{
_umonitor (p);
return _umwait (x, y);
}
unsigned char
bar (void *p, unsigned x, unsigned long long y)
{
_umonitor (p);
return _umwait (x, y);
}
unsigned char
foo1 (char *p)
{
_umonitor (p);
return _umwait (0, 0);
}