diff options
author | 2024-05-29 02:15:37 +0000 | |
---|---|---|
committer | 2024-05-29 02:15:37 +0000 | |
commit | 8723705fadb0af4a670e6537014061eea7297caa (patch) | |
tree | 4f6c5b36d85782356a15e159ede0ee50f10c231e /java/dex_test.go | |
parent | f820c3beda57f5dbcc1788599456af0b7baf2c11 (diff) | |
parent | 3dbda18e808f79bb94d57b645f686a9f737cdc76 (diff) |
Merge "Use r8/d8 optimized profile for dexpreopt" into main
Diffstat (limited to 'java/dex_test.go')
-rw-r--r-- | java/dex_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/java/dex_test.go b/java/dex_test.go index 1ecdae0c5..eb017d5e9 100644 --- a/java/dex_test.go +++ b/java/dex_test.go @@ -662,3 +662,30 @@ func TestProguardFlagsInheritanceAppImport(t *testing.T) { android.AssertStringDoesContain(t, "expected aarimports's proguard flags", appR8.Args["r8Flags"], "proguard.txt") } + +func TestR8FlagsArtProfile(t *testing.T) { + result := PrepareForTestWithJavaDefaultModules.RunTestWithBp(t, ` + android_app { + name: "app", + srcs: ["foo.java"], + platform_apis: true, + dex_preopt: { + profile_guided: true, + profile: "profile.txt.prof", + enable_profile_rewriting: true, + }, + } + `) + + app := result.ModuleForTests("app", "android_common") + appR8 := app.Rule("r8") + android.AssertStringDoesContain(t, "expected --art-profile in app r8 flags", + appR8.Args["r8Flags"], "--art-profile") + + appDexpreopt := app.Rule("dexpreopt") + android.AssertStringDoesContain(t, + "expected --art-profile output to be used to create .prof binary", + appDexpreopt.RuleParams.Command, + "--create-profile-from=out/soong/.intermediates/app/android_common/profile.prof.txt --output-profile-type=app", + ) +} |