1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs
2 ; RUN: opt < %s -S -passes=openmp-opt | FileCheck %s --check-prefix=MODULE
3 ; RUN: opt < %s -S -passes=openmp-opt-cgscc | FileCheck %s --check-prefix=CGSCC
5 target triple = "nvptx64-nvidia-cuda"
7 declare noalias ptr @alloc()
9 define internal i32 @nblist() {
10 %1 = call ptr @alloc()
11 call fastcc void @rec(ptr %1, i64 0)
15 define fastcc void @rec(ptr %0, i64 %1) {
16 %3 = getelementptr i32, ptr %0, i64 %1
17 store i32 0, ptr %3, align 4
18 call fastcc void @rec(ptr %0, i64 0)
22 !llvm.module.flags = !{!0, !1}
24 !0 = !{i32 7, !"openmp", i32 50}
25 !1 = !{i32 7, !"openmp-device", i32 50}
26 ; MODULE-LABEL: define {{[^@]+}}@rec
27 ; MODULE-SAME: (ptr [[TMP0:%.*]], i64 [[TMP1:%.*]]) {
28 ; MODULE-NEXT: [[TMP3:%.*]] = getelementptr i32, ptr [[TMP0]], i64 [[TMP1]]
29 ; MODULE-NEXT: store i32 0, ptr [[TMP3]], align 4
30 ; MODULE-NEXT: call fastcc void @rec(ptr [[TMP0]], i64 0)
31 ; MODULE-NEXT: ret void
34 ; CGSCC-LABEL: define {{[^@]+}}@nblist() {
35 ; CGSCC-NEXT: [[TMP1:%.*]] = call ptr @alloc()
36 ; CGSCC-NEXT: call fastcc void @rec(ptr [[TMP1]], i64 0)
37 ; CGSCC-NEXT: ret i32 0
40 ; CGSCC-LABEL: define {{[^@]+}}@rec
41 ; CGSCC-SAME: (ptr nocapture writeonly [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] {
42 ; CGSCC-NEXT: [[TMP3:%.*]] = getelementptr i32, ptr [[TMP0]], i64 [[TMP1]]
43 ; CGSCC-NEXT: store i32 0, ptr [[TMP3]], align 4
44 ; CGSCC-NEXT: call fastcc void @rec(ptr nocapture writeonly [[TMP0]], i64 0) #[[ATTR1:[0-9]+]]
45 ; CGSCC-NEXT: ret void