Skip to content

Commit 3bf7d5c

Browse files
authored
[SYCL] Strengthen split-with-func-ptrs.ll test. (#6481)
Add a tescase which checks that the definition of a function called from an address-taken function is also added to all split modules. Signed-off-by: Konstantin S Bobrovsky <[email protected]>
1 parent 6f0bb25 commit 3bf7d5c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

llvm/test/tools/sycl-post-link/split-with-func-ptrs.ll

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ define linkonce_odr dso_local spir_func void @foo() unnamed_addr #0 comdat align
3838
ret void
3939
}
4040

41+
; -- Also check that function called from an addr-taken function is also added
42+
; to every split module.
43+
; Function Attrs: mustprogress norecurse nounwind
44+
define weak dso_local spir_func void @baz() #3 {
45+
; CHECK-A0: define weak dso_local spir_func void @baz
46+
; CHECK-A1: define weak dso_local spir_func void @baz
47+
; CHECK-B0: define weak dso_local spir_func void @baz
48+
; CHECK-B1: define weak dso_local spir_func void @baz
49+
; CHECK-C0: define weak dso_local spir_func void @baz
50+
; CHECK-C1: define weak dso_local spir_func void @baz
51+
ret void
52+
}
53+
4154
; Function Attrs: mustprogress norecurse nounwind
4255
define linkonce_odr dso_local spir_func void @bar() unnamed_addr #1 comdat align 2 {
4356
; CHECK-A0: define linkonce_odr dso_local spir_func void @bar
@@ -46,6 +59,7 @@ define linkonce_odr dso_local spir_func void @bar() unnamed_addr #1 comdat align
4659
; CHECK-B1: define linkonce_odr dso_local spir_func void @bar
4760
; CHECK-C0: define linkonce_odr dso_local spir_func void @bar
4861
; CHECK-C1: define linkonce_odr dso_local spir_func void @bar
62+
call void @baz()
4963
ret void
5064
}
5165

0 commit comments

Comments
 (0)