Skip to content

Commit e2c2753

Browse files
committed
libast: Fix detection of GCC 4.1+ 64/32-bit atomic operations model
This fix to the atomic scalar operations feature tests is from OpenSUSE: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-aso.dif
1 parent 69e18de commit e2c2753

File tree

1 file changed

+7
-2
lines changed
  • src/lib/libast/features

1 file changed

+7
-2
lines changed

src/lib/libast/features/aso

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ if aso note{ gcc 4.1+ 64 bit memory atomic operations model }end link{
55
int main()
66
{
77
uint64_t i = 0;
8-
return __sync_fetch_and_add(&i,7);
8+
uint32_t j = 0;
9+
uint16_t l = 0;
10+
uint8_t m = 0;
11+
return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7)+__sync_fetch_and_add(&m,7);
912
}
1013
}end && {
1114
#define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n)
@@ -31,7 +34,9 @@ elif aso note{ gcc 4.1+ 32 bit memory atomic operations model }end link{
3134
int main()
3235
{
3336
uint32_t i = 0;
34-
return __sync_fetch_and_add(&i,7);
37+
uint16_t j = 0;
38+
uint8_t l = 0;
39+
return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7);
3540
}
3641
}end && {
3742
#define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n)

0 commit comments

Comments
 (0)