1 // REQUIRES: amdgpu-registered-target
2 // RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -fcuda-is-device \
3 // RUN: -verify -emit-llvm-only %s
5 #define __device__ __attribute__((device))
6 extern "C" __device__
int printf(const char *format
, ...);
8 // Check that we don't crash when asked to printf a non-scalar arg.
14 __device__
void PrintfNonScalar(const char *fmt
) {
16 // Ignore the warning about the %d not matching the struct argument
17 // expected-warning@+2 {{}}
18 // expected-error@+1 {{cannot compile this non-scalar arg to printf}}
19 printf("%d", Struct());