Skip to content

Commit beb06eb

Browse files
Fixed 2 tests that failed on MacOS (#168482)
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
1 parent 20795e0 commit beb06eb

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

cross-project-tests/dtlto/dtlto-cache.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN: -Wl,--thinlto-cache-dir=cache.dir \
1717
RUN: -Wl,--save-temps
1818

1919
# Check that there are two backend compilation jobs occurred.
20-
RUN: grep -wo args populate1.*.dist-file.json | wc -l | grep -qx 3
20+
RUN: grep -wo args populate1.*.dist-file.json | wc -l | grep -qx "\s*3"
2121
RUN: ls cache.dir/llvmcache.timestamp
2222
RUN: ls cache.dir | count 3
2323

@@ -32,7 +32,7 @@ RUN: -Wl,--thinlto-cache-dir=cache.dir \
3232
RUN: -Wl,--save-temps
3333

3434
# Check that there are no backend compilation jobs occurred.
35-
RUN: grep -wo args populate2.*.dist-file.json | wc -l | grep -qx 1
35+
RUN: grep -wo args populate2.*.dist-file.json | wc -l | grep -qx "\s*1"
3636
RUN: ls cache.dir | count 3
3737

3838
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 \
5252
RUN: -Wl,--save-temps
5353

5454
# Check that there are two new backend compilation jobs occurred.
55-
RUN: grep -wo args populate3.*.dist-file.json | wc -l | grep -qx 3
55+
RUN: grep -wo args populate3.*.dist-file.json | wc -l | grep -qx "\s*3"
5656
RUN: ls cache.dir | count 5
5757

5858
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 \
6969
RUN: -Wl,--save-temps
7070

7171
# Check that there is one new backend compilation jobs occurred.
72-
RUN: grep -wo args main-partial.*.dist-file.json | wc -l | grep -qx 2
72+
RUN: grep -wo args main-partial.*.dist-file.json | wc -l | grep -qx "\s*2"
7373
RUN: ls cache.dir | count 6
7474

7575
#--- foo.c

cross-project-tests/dtlto/dtlto-thinlto-cache.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RUN: -Wl,--thinlto-cache-dir=cache.dir \
2929
RUN: -Wl,--save-temps
3030

3131
# Check that there are two backend compilation jobs occurred.
32-
RUN: grep -wo args populate1.*.dist-file.json | wc -l | grep -qx 3
32+
RUN: grep -wo args populate1.*.dist-file.json | wc -l | grep -qx "\s*3"
3333
RUN: ls cache.dir | count 5
3434

3535
# Clean up cache directory.
@@ -45,7 +45,7 @@ RUN: -Wl,--thinlto-cache-dir=cache.dir \
4545
RUN: -Wl,--save-temps
4646

4747
# Check that there are two backend compilation jobs occurred.
48-
RUN: grep -wo args populate2.*.dist-file.json | wc -l | grep -qx 3
48+
RUN: grep -wo args populate2.*.dist-file.json | wc -l | grep -qx "\s*3"
4949
RUN: ls cache.dir/llvmcache.timestamp
5050
RUN: ls cache.dir | count 3
5151

llvm/test/ThinLTO/X86/dtlto/dtlto-cache.ll

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,11 @@ THINLTO-DAG: {{^}}t.o.2{{$}}
4343

4444
RUN: %{command}
4545

46-
; Check that the expected output files have been created.
4746
RUN: ls | count 3
48-
; Check that two native object files has been created
4947
RUN: ls | FileCheck %s --check-prefix=THINLTO
50-
; Check that DTLTO cache directory has been created
5148
RUN: ls cache-dir/* | count 2
52-
; Check that 2 cache entries are created
5349
RUN: ls cache-dir/llvmcache-* | count 2
5450

55-
56-
57-
5851
;--- t1.ll
5952

6053
target triple = "x86_64-unknown-linux-gnu"

0 commit comments

Comments
 (0)