summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ABI/C.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/ABI/C.cmake')
-rw-r--r--Tests/RunCMake/ABI/C.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/ABI/C.cmake b/Tests/RunCMake/ABI/C.cmake
index a90c766..92f5da4 100644
--- a/Tests/RunCMake/ABI/C.cmake
+++ b/Tests/RunCMake/ABI/C.cmake
@@ -5,3 +5,18 @@ if(NOT CMAKE_C_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$")
endif()
message(FATAL_ERROR "CMAKE_C_BYTE_ORDER has unexpected value '${CMAKE_C_BYTE_ORDER}'")
endif()
+
+include(TestBigEndian)
+test_big_endian(IS_BIG_ENDIAN)
+if(IS_BIG_ENDIAN AND NOT CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN")
+ message(FATAL_ERROR "test_big_endian result does not match ABI result")
+endif()
+
+# Test legacy check.
+set(byte_order "${CMAKE_C_BYTE_ORDER}")
+unset(CMAKE_C_BYTE_ORDER)
+include(TestBigEndian)
+test_big_endian(IS_BIG)
+if(IS_BIG AND NOT byte_order STREQUAL "BIG_ENDIAN")
+ message(FATAL_ERROR "test_big_endian result does not match ABI result")
+endif()