Skip to content

Commit 05e6eed

Browse files
committed
adapt MLIR tests
1 parent f923274 commit 05e6eed

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

mlir/test/Target/LLVMIR/Import/intrinsic.ll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,12 @@ define void @expect_with_probability(i16 %0) {
641641
ret void
642642
}
643643

644+
@tls_var = dso_local thread_local global i32 0, align 4
645+
644646
; CHECK-LABEL: llvm.func @threadlocal_test
645-
define void @threadlocal_test(ptr %0) {
647+
define void @threadlocal_test() {
646648
; CHECK: "llvm.intr.threadlocal.address"(%{{.*}}) : (!llvm.ptr) -> !llvm.ptr
647-
%local = call ptr @llvm.threadlocal.address.p0(ptr %0)
649+
%local = call ptr @llvm.threadlocal.address.p0(ptr @tls_var)
648650
ret void
649651
}
650652

mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,13 @@ llvm.func @expect_with_probability(%arg0: i16) {
576576
llvm.return
577577
}
578578

579+
llvm.mlir.global external thread_local @tls_var(0 : i32) {addr_space = 0 : i32, alignment = 4 : i64, dso_local} : i32
580+
579581
// CHECK-LABEL: @threadlocal_test
580-
llvm.func @threadlocal_test(%arg0 : !llvm.ptr) {
581-
// CHECK: call ptr @llvm.threadlocal.address.p0(ptr %{{.*}})
582-
"llvm.intr.threadlocal.address"(%arg0) : (!llvm.ptr) -> !llvm.ptr
582+
llvm.func @threadlocal_test() {
583+
// CHECK: call ptr @llvm.threadlocal.address.p0(ptr @tls_var)
584+
%0 = llvm.mlir.addressof @tls_var : !llvm.ptr
585+
"llvm.intr.threadlocal.address"(%0) : (!llvm.ptr) -> !llvm.ptr
583586
llvm.return
584587
}
585588

0 commit comments

Comments
 (0)