Skip to content

Commit 27b1e88

Browse files
add test coverage for regular LTO
1 parent dfe5970 commit 27b1e88

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed

llvm/test/ThinLTO/X86/devirt_prevailing.ll

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
; RUN: llvm-lto2 run hybrid.o -save-temps -pass-remarks=. \
5656
; RUN: -thinlto-threads=1 \
57-
; RUN: -o hybrid \
57+
; RUN: -o hybrid-tmp \
5858
; RUN: --whole-program-visibility-enabled-in-lto=true \
5959
; RUN: --validate-all-vtables-have-type-infos=true \
6060
; RUN: --all-vtables-have-type-infos=true \
@@ -75,7 +75,7 @@
7575

7676
; RUN: llvm-lto2 run hybrid.o -save-temps -pass-remarks=. \
7777
; RUN: -thinlto-threads=1 \
78-
; RUN: -o hybrid \
78+
; RUN: -o hybrid-tmp \
7979
; RUN: --whole-program-visibility-enabled-in-lto=true \
8080
; RUN: --validate-all-vtables-have-type-infos=true \
8181
; RUN: --all-vtables-have-type-infos=true \
@@ -94,11 +94,42 @@
9494
; RUN: 2>&1 | FileCheck --allow-empty %s --implicit-check-not='single-impl: devirtualized a call to'
9595

9696

97-
; In regular LTO, global resolutions (as expected) show symbols are visible
98-
; outside summary (when they come from regular LTO module without summaries).
99-
; In the setting of this test case (equivalent of `-Wl,--lto-whole-program-visibility -Wl,--lto-validate-all-vtables-have-type-infos` in lld),
100-
; devirtualization will be suppressed even if the compatible class is not
101-
; referenced from shared libraries. So regular LTO test coverage is not meaningful.
97+
; Repeat the above tests for WPD in regular LTO.
98+
; RUN: opt -module-summary -o regular.o %s
99+
100+
; RUN: llvm-lto2 run regular.o -save-temps -pass-remarks=. \
101+
; RUN: -thinlto-threads=1 \
102+
; RUN: -o regular-temp \
103+
; RUN: --whole-program-visibility-enabled-in-lto=true \
104+
; RUN: --validate-all-vtables-have-type-infos=true \
105+
; RUN: --all-vtables-have-type-infos=true \
106+
; RUN: -r=regular.o,__cxa_pure_virtual, \
107+
; RUN: -r=regular.o,_ZN8DerivedNC2Ev,x \
108+
; RUN: -r=regular.o,_ZN4Base8dispatchEv,px \
109+
; RUN: -r=regular.o,_ZN7DerivedC2Ev, \
110+
; RUN: -r=regular.o,_ZN8DerivedN5printEv,px \
111+
; RUN: -r=regular.o,_ZTS8DerivedN,p \
112+
; RUN: -r=regular.o,_ZTI7Derived,p \
113+
; RUN: -r=regular.o,_ZTV8DerivedN,p \
114+
; RUN: -r=regular.o,_ZTI8DerivedN,p \
115+
; RUN: 2>&1 | FileCheck --allow-empty %s --check-prefix=REMARK
116+
117+
; RUN: llvm-lto2 run regular.o -save-temps -pass-remarks=. \
118+
; RUN: -thinlto-threads=1 \
119+
; RUN: -o regular-temp \
120+
; RUN: --whole-program-visibility-enabled-in-lto=true \
121+
; RUN: --validate-all-vtables-have-type-infos=true \
122+
; RUN: --all-vtables-have-type-infos=true \
123+
; RUN: -r=regular.o,__cxa_pure_virtual, \
124+
; RUN: -r=regular.o,_ZN8DerivedNC2Ev,x \
125+
; RUN: -r=regular.o,_ZN4Base8dispatchEv,px \
126+
; RUN: -r=regular.o,_ZN7DerivedC2Ev, \
127+
; RUN: -r=regular.o,_ZN8DerivedN5printEv,px \
128+
; RUN: -r=regular.o,_ZTS8DerivedN,p \
129+
; RUN: -r=regular.o,_ZTI7Derived, \
130+
; RUN: -r=regular.o,_ZTV8DerivedN,p \
131+
; RUN: -r=regular.o,_ZTI8DerivedN,p \
132+
; RUN: 2>&1 | FileCheck --allow-empty %s --implicit-check-not='single-impl: devirtualized a call to'
102133

103134
; REMARK: single-impl: devirtualized a call to _ZN8DerivedN5printEv
104135

0 commit comments

Comments
 (0)