diff --git a/tests/device/libcxx-relocs/jni/Android.mk b/tests/device/libcxx-relocs/jni/Android.mk new file mode 100644 index 000000000..94902ccdc --- /dev/null +++ b/tests/device/libcxx-relocs/jni/Android.mk @@ -0,0 +1,13 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := libfoo +LOCAL_SRC_FILES := foo.cpp +LOCAL_LDLIBS := -latomic +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE := bar +LOCAL_SRC_FILES := bar.cpp +LOCAL_SHARED_LIBRARIES := libfoo +include $(BUILD_EXECUTABLE) diff --git a/tests/device/libcxx-relocs/jni/Application.mk b/tests/device/libcxx-relocs/jni/Application.mk new file mode 100644 index 000000000..ce095350e --- /dev/null +++ b/tests/device/libcxx-relocs/jni/Application.mk @@ -0,0 +1 @@ +APP_STL := c++_static diff --git a/tests/device/libcxx-relocs/jni/bar.cpp b/tests/device/libcxx-relocs/jni/bar.cpp new file mode 100644 index 000000000..fb4184265 --- /dev/null +++ b/tests/device/libcxx-relocs/jni/bar.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +extern void foo(); + +int main(int, char**) { + foo(); +} diff --git a/tests/device/libcxx-relocs/jni/foo.cpp b/tests/device/libcxx-relocs/jni/foo.cpp new file mode 100644 index 000000000..63d77070b --- /dev/null +++ b/tests/device/libcxx-relocs/jni/foo.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#include +#include + +void foo() { + std::string message = "Hello, world!"; + std::cout << message << std::endl; +} diff --git a/tests/device/libcxx-relocs/test_config.py b/tests/device/libcxx-relocs/test_config.py new file mode 100644 index 000000000..331282063 --- /dev/null +++ b/tests/device/libcxx-relocs/test_config.py @@ -0,0 +1,5 @@ +def match_broken(abi, platform, device_platform, toolchain, subtest=None): + if abi == 'armeabi' and toolchain == '4.9': + bug = 'https://github.com/android-ndk/ndk/issues/31' + return toolchain + ' ' + abi, bug + return None, None