[clang] [CIR][AMDGPU] Route printf in device code through the OpenCL runtime (PR #226435)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 28 05:06:29 PDT 2026


================
@@ -0,0 +1,65 @@
+// REQUIRES: amdgpu-registered-target
+// RUN: %clang_cc1 -triple=amdgpu9.0a-amd-amdhsa -x hip -std=c++11 \
+// RUN: -fcxx-exceptions -fexceptions \
+// RUN: -fclangir -fcuda-is-device -emit-llvm %s -o %t-cir.ll
+// RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s
+// RUN: %clang_cc1 -triple=amdgpu9.0a-amd-amdhsa -x hip -std=c++11 \
+// RUN: -fcxx-exceptions -fexceptions \
+// RUN: -fcuda-is-device -emit-llvm %s -o %t.ll
+// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
----------------
Fznamznon wrote:

I think it is a bit more readable and way shorter, not sure also if c++11 required since default is c++17 for plain c++
```suggestion
// RUN: %clang_cc1 -triple=amdgpu9.0a-amd-amdhsa -x hip -fcuda-is-device -emit-llvm %s -o - | FileCheck --check-prefix=LLVM %s
```

https://github.com/llvm/llvm-project/pull/226435


More information about the cfe-commits mailing list