printf-aggregate.cu 445 B

1234567891011121314151617
  1. // REQUIRES: x86-registered-target
  2. // REQUIRES: nvptx-registered-target
  3. // RUN: not %clang_cc1 -triple nvptx64-nvidia-cuda -fcuda-is-device -emit-llvm \
  4. // RUN: -o - %s 2>&1 | FileCheck %s
  5. #include "Inputs/cuda.h"
  6. // Check that we don't crash when asked to printf a non-scalar arg.
  7. struct Struct {
  8. int x;
  9. int y;
  10. };
  11. __device__ void PrintfNonScalar() {
  12. // CHECK: cannot compile this non-scalar arg to printf
  13. printf("%d", Struct());
  14. }