Skip to content

Commit ecc3e28

Browse files
committed
[Clang][OpenCL][NVPTX] precommit test for using vprintf to implement builtin printf on OpenCL with NVPTX
1 parent a3e883a commit ecc3e28

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4
2+
// RUN: %clang_cc1 -cl-std=CL3.0 -triple nvptx-- -disable-llvm-passes -emit-llvm -o - %s | FileCheck -check-prefixes=NV %s
3+
4+
int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2)));
5+
6+
// NV-LABEL: define dso_local spir_kernel void @test_printf(
7+
// NV-SAME: ) #[[ATTR0:[0-9]+]] !kernel_arg_addr_space !4 !kernel_arg_access_qual !4 !kernel_arg_type !4 !kernel_arg_base_type !4 !kernel_arg_type_qual !4 {
8+
// NV-NEXT: entry:
9+
// NV-NEXT: [[CALL:%.*]] = call i32 (ptr addrspace(4), ...) @printf(ptr addrspace(4) noundef @.str) #[[ATTR2:[0-9]+]]
10+
// NV-NEXT: ret void
11+
//
12+
__kernel void test_printf() {
13+
printf("hello, printf on nvptx.");
14+
}

0 commit comments

Comments
 (0)