Add testcase for __set_errno; Remove #include <stdint.h> in test issue38441-Elf32_auxv_t
In response to header changes in
https://android-review.googlesource.com/#/c/54637/
Change-Id: Iaefb9cc7f6cf96686f72825f56f86ec03a8f39c3
diff --git a/tests/build/deprecate-__set_errno/BUILD_SHOULD_FAIL b/tests/build/deprecate-__set_errno/BUILD_SHOULD_FAIL
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/build/deprecate-__set_errno/BUILD_SHOULD_FAIL
diff --git a/tests/build/deprecate-__set_errno/jni/Android.mk b/tests/build/deprecate-__set_errno/jni/Android.mk
new file mode 100644
index 0000000..e597107
--- /dev/null
+++ b/tests/build/deprecate-__set_errno/jni/Android.mk
@@ -0,0 +1,7 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := deprecate-__set_errno
+LOCAL_SRC_FILES := deprecate-__set_errno.c foo.c
+LOCAL_CFLAGS += -Werror
+include $(BUILD_EXECUTABLE)
diff --git a/tests/build/deprecate-__set_errno/jni/Application.mk b/tests/build/deprecate-__set_errno/jni/Application.mk
new file mode 100644
index 0000000..a252a72
--- /dev/null
+++ b/tests/build/deprecate-__set_errno/jni/Application.mk
@@ -0,0 +1 @@
+APP_ABI := all
diff --git a/tests/build/deprecate-__set_errno/jni/deprecate-__set_errno.c b/tests/build/deprecate-__set_errno/jni/deprecate-__set_errno.c
new file mode 100644
index 0000000..ee918d7
--- /dev/null
+++ b/tests/build/deprecate-__set_errno/jni/deprecate-__set_errno.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2010 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 <errno.h>
+
+extern void foo();
+int main()
+{
+ __set_errno(0);
+ foo();
+
+ return 0;
+}
diff --git a/tests/build/deprecate-__set_errno/jni/foo.c b/tests/build/deprecate-__set_errno/jni/foo.c
new file mode 100644
index 0000000..052025b
--- /dev/null
+++ b/tests/build/deprecate-__set_errno/jni/foo.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2010 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 <errno.h>
+
+void foo()
+{
+}
diff --git a/tests/build/issue38441-Elf32_auxv_t/jni/issue38441-Elf32_auxv_t.c b/tests/build/issue38441-Elf32_auxv_t/jni/issue38441-Elf32_auxv_t.c
index fa3b229..a32c20b 100644
--- a/tests/build/issue38441-Elf32_auxv_t/jni/issue38441-Elf32_auxv_t.c
+++ b/tests/build/issue38441-Elf32_auxv_t/jni/issue38441-Elf32_auxv_t.c
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <stdint.h>
#include <elf.h>
Elf32_auxv_t auxv32;