8318525: Atomic gtest should run as TEST_VM to access VM capabilities
Reviewed-by: stefank, stuefe
This commit is contained in:
parent
8099261050
commit
744f206fef
@ -53,7 +53,7 @@ struct AtomicAddTestSupport {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(AtomicAddTest, int32) {
|
TEST_VM(AtomicAddTest, int32) {
|
||||||
using Support = AtomicAddTestSupport<int32_t>;
|
using Support = AtomicAddTestSupport<int32_t>;
|
||||||
Support().test_add();
|
Support().test_add();
|
||||||
Support().test_fetch_add();
|
Support().test_fetch_add();
|
||||||
@ -61,14 +61,14 @@ TEST(AtomicAddTest, int32) {
|
|||||||
|
|
||||||
// 64bit Atomic::add is only supported on 64bit platforms.
|
// 64bit Atomic::add is only supported on 64bit platforms.
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
TEST(AtomicAddTest, int64) {
|
TEST_VM(AtomicAddTest, int64) {
|
||||||
using Support = AtomicAddTestSupport<int64_t>;
|
using Support = AtomicAddTestSupport<int64_t>;
|
||||||
Support().test_add();
|
Support().test_add();
|
||||||
Support().test_fetch_add();
|
Support().test_fetch_add();
|
||||||
}
|
}
|
||||||
#endif // _LP64
|
#endif // _LP64
|
||||||
|
|
||||||
TEST(AtomicAddTest, ptr) {
|
TEST_VM(AtomicAddTest, ptr) {
|
||||||
uint _test_values[10] = {};
|
uint _test_values[10] = {};
|
||||||
uint* volatile _test_value{};
|
uint* volatile _test_value{};
|
||||||
|
|
||||||
@ -103,14 +103,14 @@ struct AtomicXchgTestSupport {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(AtomicXchgTest, int32) {
|
TEST_VM(AtomicXchgTest, int32) {
|
||||||
using Support = AtomicXchgTestSupport<int32_t>;
|
using Support = AtomicXchgTestSupport<int32_t>;
|
||||||
Support().test();
|
Support().test();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 64bit Atomic::xchg is only supported on 64bit platforms.
|
// 64bit Atomic::xchg is only supported on 64bit platforms.
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
TEST(AtomicXchgTest, int64) {
|
TEST_VM(AtomicXchgTest, int64) {
|
||||||
using Support = AtomicXchgTestSupport<int64_t>;
|
using Support = AtomicXchgTestSupport<int64_t>;
|
||||||
Support().test();
|
Support().test();
|
||||||
}
|
}
|
||||||
@ -136,12 +136,12 @@ struct AtomicCmpxchgTestSupport {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(AtomicCmpxchgTest, int32) {
|
TEST_VM(AtomicCmpxchgTest, int32) {
|
||||||
using Support = AtomicCmpxchgTestSupport<int32_t>;
|
using Support = AtomicCmpxchgTestSupport<int32_t>;
|
||||||
Support().test();
|
Support().test();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(AtomicCmpxchgTest, int64) {
|
TEST_VM(AtomicCmpxchgTest, int64) {
|
||||||
using Support = AtomicCmpxchgTestSupport<int64_t>;
|
using Support = AtomicCmpxchgTestSupport<int64_t>;
|
||||||
Support().test();
|
Support().test();
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ struct AtomicCmpxchg1ByteStressSupport {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(AtomicCmpxchg1Byte, stress) {
|
TEST_VM(AtomicCmpxchg1Byte, stress) {
|
||||||
AtomicCmpxchg1ByteStressSupport support;
|
AtomicCmpxchg1ByteStressSupport support;
|
||||||
support.test();
|
support.test();
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ namespace AtomicEnumTestUnscoped { // Scope the enumerators.
|
|||||||
enum TestEnum { A, B, C };
|
enum TestEnum { A, B, C };
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(AtomicEnumTest, unscoped_enum) {
|
TEST_VM(AtomicEnumTest, unscoped_enum) {
|
||||||
using namespace AtomicEnumTestUnscoped;
|
using namespace AtomicEnumTestUnscoped;
|
||||||
using Support = AtomicEnumTestSupport<TestEnum>;
|
using Support = AtomicEnumTestSupport<TestEnum>;
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ TEST(AtomicEnumTest, unscoped_enum) {
|
|||||||
|
|
||||||
enum class AtomicEnumTestScoped { A, B, C };
|
enum class AtomicEnumTestScoped { A, B, C };
|
||||||
|
|
||||||
TEST(AtomicEnumTest, scoped_enum) {
|
TEST_VM(AtomicEnumTest, scoped_enum) {
|
||||||
const AtomicEnumTestScoped B = AtomicEnumTestScoped::B;
|
const AtomicEnumTestScoped B = AtomicEnumTestScoped::B;
|
||||||
const AtomicEnumTestScoped C = AtomicEnumTestScoped::C;
|
const AtomicEnumTestScoped C = AtomicEnumTestScoped::C;
|
||||||
using Support = AtomicEnumTestSupport<AtomicEnumTestScoped>;
|
using Support = AtomicEnumTestSupport<AtomicEnumTestScoped>;
|
||||||
@ -329,28 +329,28 @@ const T AtomicBitopsTestSupport<T>::_old_value;
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
const T AtomicBitopsTestSupport<T>::_change_value;
|
const T AtomicBitopsTestSupport<T>::_change_value;
|
||||||
|
|
||||||
TEST(AtomicBitopsTest, int8) {
|
TEST_VM(AtomicBitopsTest, int8) {
|
||||||
AtomicBitopsTestSupport<int8_t>()();
|
AtomicBitopsTestSupport<int8_t>()();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(AtomicBitopsTest, uint8) {
|
TEST_VM(AtomicBitopsTest, uint8) {
|
||||||
AtomicBitopsTestSupport<uint8_t>()();
|
AtomicBitopsTestSupport<uint8_t>()();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(AtomicBitopsTest, int32) {
|
TEST_VM(AtomicBitopsTest, int32) {
|
||||||
AtomicBitopsTestSupport<int32_t>()();
|
AtomicBitopsTestSupport<int32_t>()();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(AtomicBitopsTest, uint32) {
|
TEST_VM(AtomicBitopsTest, uint32) {
|
||||||
AtomicBitopsTestSupport<uint32_t>()();
|
AtomicBitopsTestSupport<uint32_t>()();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
TEST(AtomicBitopsTest, int64) {
|
TEST_VM(AtomicBitopsTest, int64) {
|
||||||
AtomicBitopsTestSupport<int64_t>()();
|
AtomicBitopsTestSupport<int64_t>()();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(AtomicBitopsTest, uint64) {
|
TEST_VM(AtomicBitopsTest, uint64) {
|
||||||
AtomicBitopsTestSupport<uint64_t>()();
|
AtomicBitopsTestSupport<uint64_t>()();
|
||||||
}
|
}
|
||||||
#endif // _LP64
|
#endif // _LP64
|
||||||
|
Loading…
x
Reference in New Issue
Block a user