Skip to content

Commit 34d1490

Browse files
committed
Revise test checks, avoid instcombine, and use x86_64
1 parent 9dddbf9 commit 34d1490

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

llvm/test/LTO/Resolution/RISCV/bcmp-libcall.ll renamed to llvm/test/LTO/Resolution/X86/bcmp-libcall.ll

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,33 @@
22
;; definition of bcmp is deleted because it has no uses, but later instcombine
33
;; re-introduces a call to bcmp() as part of SimplifyLibCalls.
44

5-
; RUN: opt %s -o %t -module-summary -mtriple riscv32-unknown-linux-musl
5+
; RUN: opt %s -o %t -module-summary -mtriple x86_64-unknown-linux-musl
66
; RUN: llvm-lto2 run -o %t2 \
77
; RUN: -r %t,foo,plx \
88
; RUN: -r %t,memcmp,x \
99
; RUN: -r %t,bcmp,pl %t -save-temps
1010
; RUN: llvm-dis %t2.1.2.internalize.bc -o - \
11-
; RUN: | FileCheck %s --check-prefix=INTERNALIZE
12-
; RUN: opt %t2.1.2.internalize.bc -passes=instcombine -o - -S \
13-
; RUN: | FileCheck %s --check-prefix=OPTIMIZE
11+
; RUN: | FileCheck %s
1412

1513
define i1 @foo(ptr %0, [2 x i32] %1) {
16-
; OPTIMIZE-LABEL: define{{.*}}i1 @foo
17-
; OPTIMIZE-NEXT: %size = extractvalue [2 x i32] %1, 1
18-
; OPTIMIZE-NEXT: %bcmp = {{.*}}call i32 @bcmp
19-
; OPTIMIZE-NEXT: %eq = icmp eq i32 %bcmp, 0
20-
; OPTIMIZE-NEXT: ret i1 %eq
14+
; CHECK-LABEL: define{{.*}}i1 @foo
15+
; CHECK-NEXT: %size = extractvalue [2 x i32] %1, 1
16+
; CHECK-NEXT: %cmp = {{.*}}call i32 @memcmp
17+
; CHECK-NEXT: %eq = icmp eq i32 %cmp, 0
18+
; CHECK-NEXT: ret i1 %eq
2119

2220
%size = extractvalue [2 x i32] %1, 1
2321
%cmp = call i32 @memcmp(ptr %0, ptr null, i32 %size)
2422
%eq = icmp eq i32 %cmp, 0
2523
ret i1 %eq
2624
}
2725

28-
; INTERNALIZE: declare i32 @memcmp(ptr, ptr, i32)
26+
; CHECK: declare i32 @memcmp(ptr, ptr, i32)
2927
declare i32 @memcmp(ptr, ptr, i32)
3028

3129
;; Ensure bcmp is removed from module. Follow up patches can address this.
32-
; INTERNALIZE-NOT: declare{{.*}}i32 @bcmp
33-
; INTERNALIZE-NOT: define{{.*}}i32 @bcmp
30+
; CHECK-NOT: declare{{.*}}i32 @bcmp
31+
; CHECK-NOT: define{{.*}}i32 @bcmp
3432
define i32 @bcmp(ptr %0, ptr %1, i32 %2) {
3533
ret i32 0
3634
}

0 commit comments

Comments
 (0)