From f2df276012897eff1b9484aebc9c5871f9948a31 Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Mon, 10 Oct 2022 22:45:55 +0000 Subject: [PATCH] Add test that set strong symbols by default. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bugs: https://github.com/android/ndk/issues/837 Test: ./run_tests.py –rebuild –filter weak_symbols_off_by_default Change-Id: I99e15f666b157e1ec6a7eaeaf97e65f80676105b --- tests/device/weak_symbols_off_by_default/CMakeLists.txt | 3 +++ tests/device/weak_symbols_off_by_default/jni/Android.mk | 7 +++++++ .../device/weak_symbols_off_by_default/jni/Application.mk | 1 + .../weak_symbols_off_by_default/jni/weak_symbols.cpp | 6 ++++++ tests/device/weak_symbols_off_by_default/test_config.py | 2 ++ 5 files changed, 19 insertions(+) create mode 100644 tests/device/weak_symbols_off_by_default/CMakeLists.txt create mode 100644 tests/device/weak_symbols_off_by_default/jni/Android.mk create mode 100644 tests/device/weak_symbols_off_by_default/jni/Application.mk create mode 100644 tests/device/weak_symbols_off_by_default/jni/weak_symbols.cpp create mode 100644 tests/device/weak_symbols_off_by_default/test_config.py diff --git a/tests/device/weak_symbols_off_by_default/CMakeLists.txt b/tests/device/weak_symbols_off_by_default/CMakeLists.txt new file mode 100644 index 00000000..1efabbf9 --- /dev/null +++ b/tests/device/weak_symbols_off_by_default/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.22.1) +project(WeakSymbolsBuildSupport CXX) +add_executable(weak_symbols jni/weak_symbols.cpp) \ No newline at end of file diff --git a/tests/device/weak_symbols_off_by_default/jni/Android.mk b/tests/device/weak_symbols_off_by_default/jni/Android.mk new file mode 100644 index 00000000..3eb59f0b --- /dev/null +++ b/tests/device/weak_symbols_off_by_default/jni/Android.mk @@ -0,0 +1,7 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := weak_symbols +LOCAL_SRC_FILES := weak_symbols.cpp +LOCAL_LDLIBS := -landroid +include $(BUILD_EXECUTABLE) \ No newline at end of file diff --git a/tests/device/weak_symbols_off_by_default/jni/Application.mk b/tests/device/weak_symbols_off_by_default/jni/Application.mk new file mode 100644 index 00000000..067c76ff --- /dev/null +++ b/tests/device/weak_symbols_off_by_default/jni/Application.mk @@ -0,0 +1 @@ +APP_STL := c++_static \ No newline at end of file diff --git a/tests/device/weak_symbols_off_by_default/jni/weak_symbols.cpp b/tests/device/weak_symbols_off_by_default/jni/weak_symbols.cpp new file mode 100644 index 00000000..bc596e9b --- /dev/null +++ b/tests/device/weak_symbols_off_by_default/jni/weak_symbols.cpp @@ -0,0 +1,6 @@ +#include + +int main(int, char**) { + ATrace_beginAsyncSection("ndk::asyncBeginEndSection", 0); + return 0; +} \ No newline at end of file diff --git a/tests/device/weak_symbols_off_by_default/test_config.py b/tests/device/weak_symbols_off_by_default/test_config.py new file mode 100644 index 00000000..9d9b5549 --- /dev/null +++ b/tests/device/weak_symbols_off_by_default/test_config.py @@ -0,0 +1,2 @@ +def is_negative_test() -> bool: + return True