Skip to content

Commit 99ea15e

Browse files
committed
Updated nocapture test.
1 parent 8ecc5a6 commit 99ea15e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

flang/test/Transforms/function-attrs.fir

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,28 @@ func.func private @_QMarg_modPcheck_args(!fir.ref<i32> {fir.target}, !fir.ref<i3
4343
// CHECK-SAME: !fir.ref<i32> {llvm.nocapture},
4444
// CHECK-SAME: !fir.boxchar<1>,
4545
// CHECK-SAME: !fir.ref<complex<f32>> {llvm.nocapture})
46+
47+
// Test !fir.box arguments:
48+
// CHECK-LABEL: func.func private @test_box(
49+
// CHECK-SAME: %[[ARG0:.*]]: !fir.box<i32> {llvm.nocapture}) {
50+
func.func private @test_box(%arg0: !fir.box<i32>) {
51+
return
52+
}
53+
54+
// CHECK-LABEL: func.func private @test_box_target(
55+
// CHECK-SAME: %[[ARG0:.*]]: !fir.box<i32> {fir.target, llvm.nocapture}) {
56+
func.func private @test_box_target(%arg0: !fir.box<i32> {fir.target}) {
57+
return
58+
}
59+
60+
// CHECK-LABEL: func.func private @test_box_volatile(
61+
// CHECK-SAME: %[[ARG0:.*]]: !fir.box<i32> {fir.volatile, llvm.nocapture}) {
62+
func.func private @test_box_volatile(%arg0: !fir.box<i32> {fir.volatile}) {
63+
return
64+
}
65+
66+
// CHECK-LABEL: func.func private @test_box_asynchronous(
67+
// CHECK-SAME: %[[ARG0:.*]]: !fir.box<i32> {fir.asynchronous, llvm.nocapture}) {
68+
func.func private @test_box_asynchronous(%arg0: !fir.box<i32> {fir.asynchronous}) {
69+
return
70+
}

0 commit comments

Comments
 (0)