diff options
author | Dan Albert <danalbert@google.com> | 2015-12-24 00:27:57 -0800 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2016-01-04 12:39:44 -0800 |
commit | c73d327b7a644218b5ef73d41a8fcc9f8e71581c (patch) | |
tree | 9b7c5cde9e72cc99ad5be201b661ef121857ecd2 /tests | |
parent | 8e2956edefafa73d2a4490613324604a5be4d07a (diff) | |
download | ndk-c73d327b7a644218b5ef73d41a8fcc9f8e71581c.tar.gz |
Add a test for missing LP32 std::copysign.
https://twitter.com/sonicadvance1/status/679201171781713920?s=03
Apparently gnustl doesn't include std::copysign on LP32 platforms.
Haven't looked in to why yet, but this is the test case I used to
narrow down the bug (since the tweets make terrible bug reports).
Bug: http://b.android.com/74835
Bug: http://b/26318616
Change-Id: I55bc9baf7259646a3322dfee64a189805c0dedcd
Diffstat (limited to 'tests')
-rw-r--r-- | tests/build/copysign/jni/Android.mk | 7 | ||||
-rw-r--r-- | tests/build/copysign/jni/Application.mk | 1 | ||||
-rw-r--r-- | tests/build/copysign/jni/copysign.cpp | 6 | ||||
-rw-r--r-- | tests/build/copysign/test_config.py | 4 |
4 files changed, 18 insertions, 0 deletions
diff --git a/tests/build/copysign/jni/Android.mk b/tests/build/copysign/jni/Android.mk new file mode 100644 index 000000000..a6dc1b407 --- /dev/null +++ b/tests/build/copysign/jni/Android.mk @@ -0,0 +1,7 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := copysign +LOCAL_SRC_FILES := copysign.cpp +LOCAL_CPPFLAGS := -std=c++11 +include $(BUILD_SHARED_LIBRARY) diff --git a/tests/build/copysign/jni/Application.mk b/tests/build/copysign/jni/Application.mk new file mode 100644 index 000000000..87124dd88 --- /dev/null +++ b/tests/build/copysign/jni/Application.mk @@ -0,0 +1 @@ +APP_STL := gnustl_static diff --git a/tests/build/copysign/jni/copysign.cpp b/tests/build/copysign/jni/copysign.cpp new file mode 100644 index 000000000..847b6783f --- /dev/null +++ b/tests/build/copysign/jni/copysign.cpp @@ -0,0 +1,6 @@ +#include <cmath> + +template <typename T> +T foo(T a) { + return std::copysign(a, static_cast<T>(-1.0)); +} diff --git a/tests/build/copysign/test_config.py b/tests/build/copysign/test_config.py new file mode 100644 index 000000000..caa81aea2 --- /dev/null +++ b/tests/build/copysign/test_config.py @@ -0,0 +1,4 @@ +def match_broken(abi, platform, toolchain, subtest=None): + if abi not in ('arm64-v8a', 'mips64', 'x86_64'): + return abi, 'https://b.android.com/74835' + return None, None |