Author: Chris Bieneman
Date: 2022-09-13T20:53:39-05:00
New Revision: 0c9b242cf0af15fa154d006cb25f20c7bf05d60a

URL: 
https://github.com/llvm/llvm-project/commit/0c9b242cf0af15fa154d006cb25f20c7bf05d60a
DIFF: 
https://github.com/llvm/llvm-project/commit/0c9b242cf0af15fa154d006cb25f20c7bf05d60a.diff

LOG: [HLSL] Adding a test change I forgot to add

This test just verifies that even at -O0 the buffer subscript operators
are inlined. The original change was
fb5baffc28c8beaf790a2fb1c8a863d29020bfbe.

Added: 
    clang/test/CodeGenHLSL/builtins/RWBuffer-subscript.hlsl

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGenHLSL/builtins/RWBuffer-subscript.hlsl 
b/clang/test/CodeGenHLSL/builtins/RWBuffer-subscript.hlsl
new file mode 100644
index 0000000000000..da8a1e538ec5e
--- /dev/null
+++ b/clang/test/CodeGenHLSL/builtins/RWBuffer-subscript.hlsl
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm -o - -O0 
%s | FileCheck %s
+
+RWBuffer<int> In;
+RWBuffer<int> Out;
+
+[numthreads(1,1,1)]
+void main(unsigned GI : SV_GroupIndex) {
+  Out[GI] = In[GI];
+}
+
+// Even at -O0 the subscript operators get inlined. The -O0 IR is a bit messy
+// and confusing to follow so the match here is pretty weak.
+
+// CHECK: define internal void @"?main@@YAXI@Z"
+// CHECK-NOT: call
+// CHECK: ret void


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

Reply via email to