summaryrefslogtreecommitdiff
path: root/rust/compiler_test.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2020-08-26 20:32:32 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-08-26 20:32:32 +0000
commit4d947f0ea84f80939348d1f792730b38ca5720c5 (patch)
tree5abc8acec9ba712976f8b6cbcda825e7f0c7ff79 /rust/compiler_test.go
parent6945e9b65042a722a6db399481799f11628cee47 (diff)
parent042504f7d60857dd3d6292d56b3356a8a2d617d0 (diff)
Merge "Link device binaries dynamically by default."
Diffstat (limited to 'rust/compiler_test.go')
-rw-r--r--rust/compiler_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/rust/compiler_test.go b/rust/compiler_test.go
index 8b9fccc61..56a8ef8ac 100644
--- a/rust/compiler_test.go
+++ b/rust/compiler_test.go
@@ -177,3 +177,30 @@ func TestLints(t *testing.T) {
})
}
}
+
+// Test that devices are linking the stdlib dynamically
+func TestStdDeviceLinkage(t *testing.T) {
+ ctx := testRust(t, `
+ rust_binary {
+ name: "fizz",
+ srcs: ["foo.rs"],
+ }
+ rust_library {
+ name: "libfoo",
+ srcs: ["foo.rs"],
+ crate_name: "foo",
+ }`)
+ fizz := ctx.ModuleForTests("fizz", "android_arm64_armv8-a").Module().(*Module)
+ fooRlib := ctx.ModuleForTests("libfoo", "android_arm64_armv8-a_rlib").Module().(*Module)
+ fooDylib := ctx.ModuleForTests("libfoo", "android_arm64_armv8-a_dylib").Module().(*Module)
+
+ if !android.InList("libstd", fizz.Properties.AndroidMkDylibs) {
+ t.Errorf("libstd is not linked dynamically for device binaries")
+ }
+ if !android.InList("libstd", fooRlib.Properties.AndroidMkDylibs) {
+ t.Errorf("libstd is not linked dynamically for rlibs")
+ }
+ if !android.InList("libstd", fooDylib.Properties.AndroidMkDylibs) {
+ t.Errorf("libstd is not linked dynamically for dylibs")
+ }
+}