================
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -o - 
-disable-llvm-passes %s | FileCheck %s
+
+// Verify that no per variable _Init_thread instructions are emitted for 
non-trivial static locals
+// These would normally be emitted by the MicrosoftCXXABI, but the DirectX 
backend should exlude them
+// Instead, check for the guardvar oparations that should protect the 
constructor initialization should
+// only take place once.
+
+RWBuffer<int> buf[10];
+
+void InitBuf(RWBuffer<int> buf) {
+  for (unsigned i; i < 100; i++)
----------------
pow2clk wrote:

Yeah. That's something I've been considering how to address. There are dozens 
of existing tests that use this same construction though. I think we should 
make DXC accept it as part of 202x or just out of band rather than forbid it in 
clang. 

https://github.com/llvm/llvm-project/pull/106096
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to