yaxunl marked 2 inline comments as done.
yaxunl added inline comments.

================
Comment at: clang/lib/Sema/SemaExpr.cpp:17145
     };
-    if (Var && Var->hasGlobalStorage() && !IsEmittedOnDeviceSide(Var)) {
-      SemaRef.targetDiag(Loc, diag::err_ref_bad_target)
-          << /*host*/ 2 << /*variable*/ 1 << Var << Target;
+    if (Var && Var->hasGlobalStorage()) {
+      if (SemaRef.LangOpts.CUDAIsDevice && !IsEmittedOnDeviceSide(Var)) {
----------------
tra wrote:
> This can be collapsed with the `if (SemaRef.LangOpts.CUDA) ` above.
This cannot be collapsed since there is else if.


================
Comment at: clang/test/CodeGenCUDA/static-device-var-rdc.cu:100-105
 // HOST: __hipRegisterVar({{.*}}@_ZL1x {{.*}}@[[DEVNAMEX]]
 // HOST: __hipRegisterVar({{.*}}@_ZL1y {{.*}}@[[DEVNAMEY]]
 // HOST-NOT: __hipRegisterVar({{.*}}@_ZL2x2
 // HOST-NOT: __hipRegisterVar({{.*}}@_ZZ6kernelPiPPKiE1w
 // HOST-NOT: __hipRegisterVar({{.*}}@_ZZ6devfunPPKiE1p
+// HOST-NOT: __hipRegisterVar({{.*}}@_ZL1u
----------------
tra wrote:
> Positive checks should be `-DAG` and negative checks should be done in a 
> separate `RUN` as we can't really guarantee the order in which registration 
> calls are emitted.
will add separate run lines for negative tests


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102237/new/

https://reviews.llvm.org/D102237

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to