opal: fix c11 compare-exchange 128-bit check
There were too many arguments being passed to the compare_exchange_strong macro. This commit removes the extra arguments and restores the functionality. Signed-off-by: Nathan Hjelm <hjelmn@google.com>
Этот коммит содержится в:
родитель
489c0840d1
Коммит
2277453737
@ -135,6 +135,7 @@ AC_DEFUN([OPAL_ATOMIC_COMPARE_EXCHANGE_STRONG_TEST_SOURCE],[[
|
|||||||
typedef union {
|
typedef union {
|
||||||
uint64_t fake@<:@2@:>@;
|
uint64_t fake@<:@2@:>@;
|
||||||
_Atomic __int128 real;
|
_Atomic __int128 real;
|
||||||
|
__int128 real2;
|
||||||
} ompi128;
|
} ompi128;
|
||||||
|
|
||||||
static void test1(void)
|
static void test1(void)
|
||||||
@ -145,9 +146,8 @@ static void test1(void)
|
|||||||
ompi128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }};
|
ompi128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }};
|
||||||
ompi128 expected = { .fake = { 0x11EEDDCCBBAA0099, 0x88776655443322FF }};
|
ompi128 expected = { .fake = { 0x11EEDDCCBBAA0099, 0x88776655443322FF }};
|
||||||
ompi128 desired = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }};
|
ompi128 desired = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }};
|
||||||
bool r = atomic_compare_exchange_strong (&ptr.real, &expected.real,
|
bool r = atomic_compare_exchange_strong (&ptr.real, &expected.real2,
|
||||||
desired.real, true,
|
desired.real);
|
||||||
atomic_relaxed, atomic_relaxed);
|
|
||||||
if ( !(r == false && ptr.real == expected.real)) {
|
if ( !(r == false && ptr.real == expected.real)) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -158,9 +158,8 @@ static void test2(void)
|
|||||||
ompi128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }};
|
ompi128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }};
|
||||||
ompi128 expected = ptr;
|
ompi128 expected = ptr;
|
||||||
ompi128 desired = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }};
|
ompi128 desired = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }};
|
||||||
bool r = atomic_compare_exchange_strong (&ptr.real, &expected.real,
|
bool r = atomic_compare_exchange_strong (&ptr.real, &expected.real2,
|
||||||
desired.real, true,
|
desired.real);
|
||||||
atomic_relaxed, atomic_relaxed);
|
|
||||||
if (!(r == true && ptr.real == desired.real)) {
|
if (!(r == true && ptr.real == desired.real)) {
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user