Skip to content

Conversation

@romanova-ekaterina
Copy link
Contributor

  1. Fixed 2 DTLTO cache tests that failed on MacOS because input to grep command is different compared to Windows
  2. Removed unneeded comments from dtlto-cache.ll

@llvmbot llvmbot added the LTO Link time optimization (regular/full LTO or ThinLTO) label Nov 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 18, 2025

@llvm/pr-subscribers-lto

Author: Katya Romanova (romanova-ekaterina)

Changes
  1. Fixed 2 DTLTO cache tests that failed on MacOS because input to grep command is different compared to Windows
  2. Removed unneeded comments from dtlto-cache.ll

Full diff: https://github.com/llvm/llvm-project/pull/168482.diff

3 Files Affected:

  • (modified) cross-project-tests/dtlto/dtlto-cache.test (+4-4)
  • (modified) cross-project-tests/dtlto/dtlto-thinlto-cache.test (+2-2)
  • (modified) llvm/test/ThinLTO/X86/dtlto/dtlto-cache.ll (-7)
diff --git a/cross-project-tests/dtlto/dtlto-cache.test b/cross-project-tests/dtlto/dtlto-cache.test
index b98d4dbb433bb..5dd67a50ab2c3 100644
--- a/cross-project-tests/dtlto/dtlto-cache.test
+++ b/cross-project-tests/dtlto/dtlto-cache.test
@@ -17,7 +17,7 @@ RUN:   -Wl,--thinlto-cache-dir=cache.dir \
 RUN:   -Wl,--save-temps
 
 # Check that there are two backend compilation jobs occurred.
-RUN: grep -wo args populate1.*.dist-file.json | wc -l | grep -qx 3
+RUN: grep -wo args populate1.*.dist-file.json | wc -l | grep -qx "\s*3"
 RUN: ls cache.dir/llvmcache.timestamp
 RUN: ls cache.dir | count 3
 
@@ -32,7 +32,7 @@ RUN:   -Wl,--thinlto-cache-dir=cache.dir \
 RUN:   -Wl,--save-temps
 
 # Check that there are no backend compilation jobs occurred.
-RUN: grep -wo args populate2.*.dist-file.json | wc -l | grep -qx 1
+RUN: grep -wo args populate2.*.dist-file.json | wc -l | grep -qx "\s*1"
 RUN: ls cache.dir | count 3
 
 RUN: %clang -O0 --target=x86_64-linux-gnu -flto=thin -c foo.c -o foo.O0.o
@@ -52,7 +52,7 @@ RUN:   -Wl,--thinlto-cache-dir=cache.dir \
 RUN:   -Wl,--save-temps
 
 # Check that there are two new backend compilation jobs occurred.
-RUN: grep -wo args populate3.*.dist-file.json | wc -l | grep -qx 3
+RUN: grep -wo args populate3.*.dist-file.json | wc -l | grep -qx "\s*3"
 RUN: ls cache.dir | count 5
 
 RUN: %clang -O2 --target=x86_64-linux-gnu -flto=thin -c main-partial.c 
@@ -69,7 +69,7 @@ RUN:   -Wl,--thinlto-cache-dir=cache.dir \
 RUN:   -Wl,--save-temps
 
 # Check that there is one new backend compilation jobs occurred.
-RUN: grep -wo args main-partial.*.dist-file.json | wc -l | grep -qx 2
+RUN: grep -wo args main-partial.*.dist-file.json | wc -l | grep -qx "\s*2"
 RUN: ls cache.dir | count 6
 
 #--- foo.c
diff --git a/cross-project-tests/dtlto/dtlto-thinlto-cache.test b/cross-project-tests/dtlto/dtlto-thinlto-cache.test
index c177112e2dbbd..9b0ca228480d1 100644
--- a/cross-project-tests/dtlto/dtlto-thinlto-cache.test
+++ b/cross-project-tests/dtlto/dtlto-thinlto-cache.test
@@ -29,7 +29,7 @@ RUN:   -Wl,--thinlto-cache-dir=cache.dir \
 RUN:   -Wl,--save-temps
 
 # Check that there are two backend compilation jobs occurred.
-RUN: grep -wo args populate1.*.dist-file.json | wc -l | grep -qx 3
+RUN: grep -wo args populate1.*.dist-file.json | wc -l | grep -qx "\s*3"
 RUN: ls cache.dir | count 5
 
 # Clean up cache directory.
@@ -45,7 +45,7 @@ RUN:   -Wl,--thinlto-cache-dir=cache.dir \
 RUN:   -Wl,--save-temps
 
 # Check that there are two backend compilation jobs occurred.
-RUN: grep -wo args populate2.*.dist-file.json | wc -l | grep -qx 3
+RUN: grep -wo args populate2.*.dist-file.json | wc -l | grep -qx "\s*3"
 RUN: ls cache.dir/llvmcache.timestamp
 RUN: ls cache.dir | count 3
 
diff --git a/llvm/test/ThinLTO/X86/dtlto/dtlto-cache.ll b/llvm/test/ThinLTO/X86/dtlto/dtlto-cache.ll
index df98c5e90b1ae..129093452101d 100644
--- a/llvm/test/ThinLTO/X86/dtlto/dtlto-cache.ll
+++ b/llvm/test/ThinLTO/X86/dtlto/dtlto-cache.ll
@@ -43,18 +43,11 @@ THINLTO-DAG: {{^}}t.o.2{{$}}
 
 RUN: %{command}
 
-; Check that the expected output files have been created.
 RUN: ls | count 3
-; Check that two native object files has been created
 RUN: ls | FileCheck %s --check-prefix=THINLTO
-; Check that DTLTO cache directory has been created
 RUN: ls cache-dir/* | count 2
-; Check that 2 cache entries are created
 RUN: ls cache-dir/llvmcache-* | count 2
 
-
-
-
 ;--- t1.ll
 
 target triple = "x86_64-unknown-linux-gnu"

Copy link
Collaborator

@dyung dyung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes pass for me on my local MacOS machine.

@github-actions
Copy link

🐧 Linux x64 Test Results

  • 186266 tests passed
  • 4852 tests skipped

@romanova-ekaterina romanova-ekaterina merged commit beb06eb into llvm:main Nov 18, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LTO Link time optimization (regular/full LTO or ThinLTO)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants