[clang] Clang/Preprocessor: Support short circuit in directive (PR #123912)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 22 05:30:06 PST 2025


================
@@ -23,7 +23,7 @@ template<int N> __attribute__((host, device)) int templatify(int x) {
 __attribute__((device)) const int GlobalConst = __AMDGCN_WAVEFRONT_SIZE__; // expected-warning {{macro '__AMDGCN_WAVEFRONT_SIZE__' has been marked as deprecated}}
 constexpr int GlobalConstExpr = __AMDGCN_WAVEFRONT_SIZE__; // expected-warning {{macro '__AMDGCN_WAVEFRONT_SIZE__' has been marked as deprecated}}
 
-#if defined(__HIP_DEVICE_COMPILE__) && (__AMDGCN_WAVEFRONT_SIZE__ == 64) // expected-warning {{macro '__AMDGCN_WAVEFRONT_SIZE__' has been marked as deprecated}}
+#if (__AMDGCN_WAVEFRONT_SIZE__ == 64) && defined(__HIP_DEVICE_COMPILE__) // expected-warning {{macro '__AMDGCN_WAVEFRONT_SIZE__' has been marked as deprecated}}
----------------
AaronBallman wrote:

Errr, I think this change shows a bug with the `RUN` line. Should it be passing `-fcuda-is-device` so that `__HIP_DEVICE_COMPILE__` is actually defined? CC @ritter-x2a 

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


More information about the cfe-commits mailing list