Add ifunc for variable test-case

Also move ifunc tests to clang and c++.

Test: bionic-unit-tests --gtest_filter=dlfcn.ifunc*
Change-Id: I008c4fc01470c8e4d314003c03a2b63ff9bf7fd8
diff --git a/tests/libs/Android.bp b/tests/libs/Android.bp
index a031fe9..973a8d2 100644
--- a/tests/libs/Android.bp
+++ b/tests/libs/Android.bp
@@ -272,10 +272,8 @@
 cc_test_library {
     name: "libtest_ifunc",
     defaults: ["bionic_testlib_defaults"],
-    srcs: ["dlopen_testlib_ifunc.c"],
+    srcs: ["dlopen_testlib_ifunc.cpp"],
 
-    // TODO(dimitry): clang does not support ifunc attribute
-    clang: false,
     arch: {
         mips: {
             enabled: false,
@@ -284,6 +282,64 @@
             enabled: false,
         },
     },
+
+    target: {
+        android: {
+            shared_libs: ["libdl"],
+        },
+        host: {
+            host_ldlibs: ["-ldl"],
+        },
+    },
+}
+
+cc_test_library {
+    name: "libtest_ifunc_variable",
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["dlopen_testlib_ifunc_variable.cpp"],
+    shared_libs: [ "libtest_ifunc_variable_impl" ],
+
+    arch: {
+        mips: {
+            enabled: false,
+        },
+        mips64: {
+            enabled: false,
+        },
+    },
+
+    target: {
+        android: {
+            shared_libs: ["libdl"],
+        },
+        host: {
+            host_ldlibs: ["-ldl"],
+        },
+    },
+}
+
+cc_test_library {
+    name: "libtest_ifunc_variable_impl",
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["dlopen_testlib_ifunc_variable_impl.cpp"],
+
+    arch: {
+        mips: {
+            enabled: false,
+        },
+        mips64: {
+            enabled: false,
+        },
+    },
+
+    target: {
+        android: {
+            shared_libs: ["libdl"],
+        },
+        host: {
+            host_ldlibs: ["-ldl"],
+        },
+    },
 }
 
 // -----------------------------------------------------------------------------