[clang] [llvm] [NVPTX] Make `shortptr` a target ABI (PR #214112)

Justin Fargnoli via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 12:57:04 PDT 2026


================
@@ -0,0 +1,19 @@
+// REQUIRES: nvptx-registered-target
+
+// Check that the CUDA driver translates the legacy Clang option to the
+// shortptr ABI.
+// RUN: %clang --target=x86_64-linux-gnu -x cuda --cuda-device-only \
+// RUN:   -fcuda-short-ptr -nocudainc -S -o /dev/null %s
+
+// Check that the NVPTX shortptr ABI can be selected directly.
+// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -target-abi shortptr \
+// RUN:   -emit-llvm -o - %s | FileCheck %s --check-prefix=SHORT-DL
+// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -target-abi shortptr \
+// RUN:   -S -o - %s | FileCheck %s --check-prefix=PTX
+
+// SHORT-DL: target datalayout = "e-p3:32:32-p4:32:32-p5:32:32-p6:32:32-p7:32:32-p101:32:32-i64:64-i128:128-i256:256-v16:16-v32:32-n16:32:64"
----------------
justinfargnoli wrote:

I moved this testing to `clang/test/CodeGen/target-data.c`, which has the example without directly above it. 

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


More information about the llvm-commits mailing list