xref: /llvm-project/clang/test/CodeGen/nvptx_attributes.c (revision 4583f6d3443c8dc6605c868724e3743161954210)
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2 // RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -target-cpu sm_61 -emit-llvm %s -o - | FileCheck %s
3 
4 // CHECK: Function Attrs: convergent noinline nounwind optnone
5 // CHECK-LABEL: define {{[^@]+}}@foo
6 // CHECK-SAME: (ptr noundef [[RET:%.*]]) #[[ATTR0:[0-9]+]] {
7 // CHECK-NEXT:  entry:
8 // CHECK-NEXT:    [[RET_ADDR:%.*]] = alloca ptr, align 8
9 // CHECK-NEXT:    store ptr [[RET]], ptr [[RET_ADDR]], align 8
10 // CHECK-NEXT:    [[TMP0:%.*]] = load ptr, ptr [[RET_ADDR]], align 8
11 // CHECK-NEXT:    store i32 1, ptr [[TMP0]], align 4
12 // CHECK-NEXT:    ret void
13 //
14 __attribute__((nvptx_kernel)) void foo(int *ret) {
15   *ret = 1;
16 }
17 
18 //.
19 // CHECK: attributes #[[ATTR0]] = { convergent noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_61" "target-features"="+ptx32,+sm_61" }
20 //.
21 // CHECK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
22 // CHECK: [[META1:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
23 //.
24