Sfoglia il codice sorgente

Merged PR 14: Clean up line ending issues

Young Kim 7 anni fa
parent
commit
aa35aca941

+ 1 - 1
tools/clang/test/CodeGenHLSL/SimpleHs9.hlsl

@@ -1,6 +1,6 @@
 // RUN: %dxc -E main -T hs_6_0  %s | FileCheck %s
 
-// CHECK: SV_TessFactor 0
+// CHECK: SV_TessFactor 0
 // CHECK: SV_InsideTessFactor 0
 
 // CHECK: define void @main

+ 18 - 18
tools/clang/test/CodeGenHLSL/lib_select_res.hlsl

@@ -1,19 +1,19 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
-
-// Make sure load resource rangeID when select resource.
-// CHECK:load i32, i32* @ReadBuffer1_rangeID
-// CHECK:load i32, i32* @ReadBuffer_rangeID
-
-RWByteAddressBuffer outputBuffer : register(u0);
-ByteAddressBuffer ReadBuffer : register(t0);
-ByteAddressBuffer ReadBuffer1 : register(t1);
-
-void test( uint cond)
-{
-	ByteAddressBuffer buffer = ReadBuffer;
-        if (cond > 2)
-           buffer = ReadBuffer1;
-
-	uint v= buffer.Load(0);
-    outputBuffer.Store(0, v);
+// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+
+// Make sure load resource rangeID when select resource.
+// CHECK:load i32, i32* @ReadBuffer1_rangeID
+// CHECK:load i32, i32* @ReadBuffer_rangeID
+
+RWByteAddressBuffer outputBuffer : register(u0);
+ByteAddressBuffer ReadBuffer : register(t0);
+ByteAddressBuffer ReadBuffer1 : register(t1);
+
+void test( uint cond)
+{
+	ByteAddressBuffer buffer = ReadBuffer;
+        if (cond > 2)
+           buffer = ReadBuffer1;
+
+	uint v= buffer.Load(0);
+    outputBuffer.Store(0, v);
 }

+ 7 - 7
tools/clang/test/CodeGenHLSL/lib_select_res_entry.hlsl

@@ -1,8 +1,8 @@
-
-void test( uint cond);
-
-[shader("pixel")]
-float main(uint c : C) : SV_Target {
-   test(c);
-   return 1;
+
+void test( uint cond);
+
+[shader("pixel")]
+float main(uint c : C) : SV_Target {
+   test(c);
+   return 1;
 }

+ 134 - 134
tools/clang/test/CodeGenHLSL/quick-ll-test/mem2reg_hlsl.ll

@@ -1,135 +1,135 @@
-; RUN: %opt %s -reg2mem_hlsl -S | FileCheck %s
-
-; Make sure store is after load.
-; CHECK: while.body:
-; CHECK: load i32
-; CHECK: store i32 -1
-; CHECK: switch
-
-; ModuleID = 'MyModule'
-target triple = "dxil-ms-dx"
-
-%dx.types.CBufRet.f32 = type { float, float, float, float }
-%dx.types.Handle = type { i8* }
-%dx.types.CBufRet.i32 = type { i32, i32, i32, i32 }
-%class.RWTexture2D = type { <4 x float> }
-%Viewport = type { <2 x float>, <2 x float> }
-%Constants = type { %struct.DispatchRaysConstants.6 }
-%struct.DispatchRaysConstants.6 = type { <2 x i32> }
-
-; Function Attrs: nounwind readonly
-declare %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32, %dx.types.Handle, i32) #0
-
-; Function Attrs: nounwind readnone
-declare i32 @dx.op.flattenedThreadIdInGroup.i32(i32) #1
-
-; Function Attrs: nounwind readonly
-declare %dx.types.CBufRet.i32 @dx.op.cbufferLoadLegacy.i32(i32, %dx.types.Handle, i32) #0
-
-; Function Attrs: nounwind readonly
-declare %dx.types.Handle @dx.op.createHandle(i32, i8, i32, i32, i1) #0
-
-; Function Attrs: nounwind readnone
-declare i32 @dx.op.threadId.i32(i32, i32) #1
-
-; Function Attrs: nounwind
-declare void @dx.op.textureStore.f32(i32, %dx.types.Handle, i32, i32, i32, float, float, float, float, i8) #2
-
-define void @main() {
-entry:
-  %0 = call i32 @dx.op.threadId.i32(i32 93, i32 0)
-  %1 = call i32 @dx.op.threadId.i32(i32 93, i32 1)
-  %2 = call i32 @dx.op.flattenedThreadIdInGroup.i32(i32 96)
-  br label %while.cond.outer
-
-while.cond.outer:                                 ; preds = %sw.bb.5.i, %sw.bb.3.i, %sw.bb.i, %while.body, %entry
-  %stateObj.0.0.0.i076.ph = phi float [ 0.000000e+00, %entry ], [ %11, %sw.bb.i ], [ %stateObj.0.0.0.i076.ph, %sw.bb.3.i ], [ %stateObj.0.0.0.i076.ph, %sw.bb.5.i ], [ %stateObj.0.0.0.i076.ph, %while.body ]
-  %stateObj.0.0.0.i177.ph = phi float [ 0.000000e+00, %entry ], [ %16, %sw.bb.i ], [ %stateObj.0.0.0.i177.ph, %sw.bb.3.i ], [ %stateObj.0.0.0.i177.ph, %sw.bb.5.i ], [ %stateObj.0.0.0.i177.ph, %while.body ]
-  %stateObj.0.0.0.i278.ph = phi float [ 0.000000e+00, %entry ], [ 0.000000e+00, %sw.bb.i ], [ %stateObj.0.0.0.i278.ph, %sw.bb.3.i ], [ %stateObj.0.0.0.i278.ph, %sw.bb.5.i ], [ %stateObj.0.0.0.i278.ph, %while.body ]
-  %stateObj.0.1.0.ph = phi float [ 0.000000e+00, %entry ], [ 0.000000e+00, %sw.bb.i ], [ %stateObj.0.1.0.ph, %sw.bb.3.i ], [ %stateObj.0.1.0.ph, %sw.bb.5.i ], [ %stateObj.0.1.0.ph, %while.body ]
-  %stateObj.0.2.0.i079.ph = phi float [ 0.000000e+00, %entry ], [ 0.000000e+00, %sw.bb.i ], [ %stateObj.0.2.0.i079.ph, %sw.bb.3.i ], [ %stateObj.0.2.0.i079.ph, %sw.bb.5.i ], [ %stateObj.0.2.0.i079.ph, %while.body ]
-  %stateObj.0.2.0.i180.ph = phi float [ 0.000000e+00, %entry ], [ 0.000000e+00, %sw.bb.i ], [ %stateObj.0.2.0.i180.ph, %sw.bb.3.i ], [ %stateObj.0.2.0.i180.ph, %sw.bb.5.i ], [ %stateObj.0.2.0.i180.ph, %while.body ]
-  %stateObj.0.2.0.i281.ph = phi float [ 0.000000e+00, %entry ], [ 1.000000e+00, %sw.bb.i ], [ %stateObj.0.2.0.i281.ph, %sw.bb.3.i ], [ %stateObj.0.2.0.i281.ph, %sw.bb.5.i ], [ %stateObj.0.2.0.i281.ph, %while.body ]
-  %stateObj.0.3.0.ph = phi float [ 0.000000e+00, %entry ], [ 1.000000e+04, %sw.bb.i ], [ %stateObj.0.3.0.ph, %sw.bb.3.i ], [ %stateObj.0.3.0.ph, %sw.bb.5.i ], [ %stateObj.0.3.0.ph, %while.body ]
-  %stateId.0.ph = phi i32 [ 0, %entry ], [ 1, %sw.bb.i ], [ -1, %sw.bb.3.i ], [ -1, %sw.bb.5.i ], [ 3, %while.body ]
-  br label %while.cond
-
-while.cond:                                       ; preds = %while.body, %while.cond.outer
-  %stateId.0 = phi i32 [ -1, %while.body ], [ %stateId.0.ph, %while.cond.outer ]
-  %cmp = icmp sgt i32 %stateId.0, -1
-  br i1 %cmp, label %while.body, label %while.end
-
-while.body:                                       ; preds = %while.cond
-  switch i32 %stateId.0, label %while.cond [
-    i32 0, label %sw.bb.i
-    i32 1, label %while.cond.outer
-    i32 2, label %sw.bb.3.i
-    i32 3, label %sw.bb.5.i
-  ]
-
-sw.bb.i:                                          ; preds = %while.body
-  %Viewport_buffer.i = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 2, i32 0, i32 0, i1 false) #2
-  %conv.i0.i = uitofp i32 %0 to float
-  %conv.i1.i = uitofp i32 %1 to float
-  %Constants_buffer.i.i = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 2, i32 1, i32 4, i1 false) #2
-  %3 = call %dx.types.CBufRet.i32 @dx.op.cbufferLoadLegacy.i32(i32 59, %dx.types.Handle %Constants_buffer.i.i, i32 0) #2
-  %4 = extractvalue %dx.types.CBufRet.i32 %3, 0
-  %5 = extractvalue %dx.types.CBufRet.i32 %3, 1
-  %conv2.i0.i = uitofp i32 %4 to float
-  %conv2.i1.i = uitofp i32 %5 to float
-  %div.i0.i = fdiv float %conv.i0.i, %conv2.i0.i
-  %div.i1.i = fdiv float %conv.i1.i, %conv2.i1.i
-  %6 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %Viewport_buffer.i, i32 0) #2
-  %7 = extractvalue %dx.types.CBufRet.f32 %6, 2
-  %8 = extractvalue %dx.types.CBufRet.f32 %6, 0
-  %9 = fsub float %7, %8
-  %10 = fmul float %div.i0.i, %9
-  %11 = fadd float %8, %10
-  %12 = extractvalue %dx.types.CBufRet.f32 %6, 3
-  %13 = extractvalue %dx.types.CBufRet.f32 %6, 1
-  %14 = fsub float %12, %13
-  %15 = fmul float %div.i1.i, %14
-  %16 = fadd float %13, %15
-  br label %while.cond.outer
-
-sw.bb.3.i:                                        ; preds = %while.body
-  %RenderTarget_UAV_2d.i = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 1, i32 0, i32 0, i1 false) #2
-  call void @dx.op.textureStore.f32(i32 67, %dx.types.Handle %RenderTarget_UAV_2d.i, i32 %0, i32 %1, i32 undef, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, i8 15) #2
-  br label %while.cond.outer
-
-sw.bb.5.i:                                        ; preds = %while.body
-  %RenderTarget_UAV_2d.i.1 = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 1, i32 0, i32 0, i1 false) #2
-  call void @dx.op.textureStore.f32(i32 67, %dx.types.Handle %RenderTarget_UAV_2d.i.1, i32 %0, i32 %1, i32 undef, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, i8 15) #2
-  br label %while.cond.outer
-
-while.end:                                        ; preds = %while.cond
-  ret void
-}
-
-attributes #0 = { nounwind readonly }
-attributes #1 = { nounwind readnone }
-attributes #2 = { nounwind }
-
-!dx.version = !{!0}
-!dx.valver = !{!0}
-!dx.shaderModel = !{!1}
-!dx.resources = !{!2}
-!dx.typeAnnotations = !{!9}
-!dx.entryPoints = !{!13}
-
-!0 = !{i32 1, i32 0}
-!1 = !{!"cs", i32 6, i32 0}
-!2 = !{null, !3, !6, null}
-!3 = !{!4}
-!4 = !{i32 0, %class.RWTexture2D* undef, !"RenderTarget", i32 0, i32 0, i32 1, i32 2, i1 false, i1 false, i1 false, !5}
-!5 = !{i32 0, i32 9}
-!6 = !{!7, !8}
-!7 = !{i32 0, %Viewport* undef, !"Viewport", i32 0, i32 0, i32 1, i32 16, null}
-!8 = !{i32 1, %Constants* undef, !"Constants", i32 2147473647, i32 4, i32 1, i32 8, null}
-!9 = !{i32 1, void ()* @main, !10}
-!10 = !{!11}
-!11 = !{i32 0, !12, !12}
-!12 = !{}
-!13 = !{void ()* @main, !"main", null, !2, !14}
-!14 = !{i32 4, !15}
+; RUN: %opt %s -reg2mem_hlsl -S | FileCheck %s
+
+; Make sure store is after load.
+; CHECK: while.body:
+; CHECK: load i32
+; CHECK: store i32 -1
+; CHECK: switch
+
+; ModuleID = 'MyModule'
+target triple = "dxil-ms-dx"
+
+%dx.types.CBufRet.f32 = type { float, float, float, float }
+%dx.types.Handle = type { i8* }
+%dx.types.CBufRet.i32 = type { i32, i32, i32, i32 }
+%class.RWTexture2D = type { <4 x float> }
+%Viewport = type { <2 x float>, <2 x float> }
+%Constants = type { %struct.DispatchRaysConstants.6 }
+%struct.DispatchRaysConstants.6 = type { <2 x i32> }
+
+; Function Attrs: nounwind readonly
+declare %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32, %dx.types.Handle, i32) #0
+
+; Function Attrs: nounwind readnone
+declare i32 @dx.op.flattenedThreadIdInGroup.i32(i32) #1
+
+; Function Attrs: nounwind readonly
+declare %dx.types.CBufRet.i32 @dx.op.cbufferLoadLegacy.i32(i32, %dx.types.Handle, i32) #0
+
+; Function Attrs: nounwind readonly
+declare %dx.types.Handle @dx.op.createHandle(i32, i8, i32, i32, i1) #0
+
+; Function Attrs: nounwind readnone
+declare i32 @dx.op.threadId.i32(i32, i32) #1
+
+; Function Attrs: nounwind
+declare void @dx.op.textureStore.f32(i32, %dx.types.Handle, i32, i32, i32, float, float, float, float, i8) #2
+
+define void @main() {
+entry:
+  %0 = call i32 @dx.op.threadId.i32(i32 93, i32 0)
+  %1 = call i32 @dx.op.threadId.i32(i32 93, i32 1)
+  %2 = call i32 @dx.op.flattenedThreadIdInGroup.i32(i32 96)
+  br label %while.cond.outer
+
+while.cond.outer:                                 ; preds = %sw.bb.5.i, %sw.bb.3.i, %sw.bb.i, %while.body, %entry
+  %stateObj.0.0.0.i076.ph = phi float [ 0.000000e+00, %entry ], [ %11, %sw.bb.i ], [ %stateObj.0.0.0.i076.ph, %sw.bb.3.i ], [ %stateObj.0.0.0.i076.ph, %sw.bb.5.i ], [ %stateObj.0.0.0.i076.ph, %while.body ]
+  %stateObj.0.0.0.i177.ph = phi float [ 0.000000e+00, %entry ], [ %16, %sw.bb.i ], [ %stateObj.0.0.0.i177.ph, %sw.bb.3.i ], [ %stateObj.0.0.0.i177.ph, %sw.bb.5.i ], [ %stateObj.0.0.0.i177.ph, %while.body ]
+  %stateObj.0.0.0.i278.ph = phi float [ 0.000000e+00, %entry ], [ 0.000000e+00, %sw.bb.i ], [ %stateObj.0.0.0.i278.ph, %sw.bb.3.i ], [ %stateObj.0.0.0.i278.ph, %sw.bb.5.i ], [ %stateObj.0.0.0.i278.ph, %while.body ]
+  %stateObj.0.1.0.ph = phi float [ 0.000000e+00, %entry ], [ 0.000000e+00, %sw.bb.i ], [ %stateObj.0.1.0.ph, %sw.bb.3.i ], [ %stateObj.0.1.0.ph, %sw.bb.5.i ], [ %stateObj.0.1.0.ph, %while.body ]
+  %stateObj.0.2.0.i079.ph = phi float [ 0.000000e+00, %entry ], [ 0.000000e+00, %sw.bb.i ], [ %stateObj.0.2.0.i079.ph, %sw.bb.3.i ], [ %stateObj.0.2.0.i079.ph, %sw.bb.5.i ], [ %stateObj.0.2.0.i079.ph, %while.body ]
+  %stateObj.0.2.0.i180.ph = phi float [ 0.000000e+00, %entry ], [ 0.000000e+00, %sw.bb.i ], [ %stateObj.0.2.0.i180.ph, %sw.bb.3.i ], [ %stateObj.0.2.0.i180.ph, %sw.bb.5.i ], [ %stateObj.0.2.0.i180.ph, %while.body ]
+  %stateObj.0.2.0.i281.ph = phi float [ 0.000000e+00, %entry ], [ 1.000000e+00, %sw.bb.i ], [ %stateObj.0.2.0.i281.ph, %sw.bb.3.i ], [ %stateObj.0.2.0.i281.ph, %sw.bb.5.i ], [ %stateObj.0.2.0.i281.ph, %while.body ]
+  %stateObj.0.3.0.ph = phi float [ 0.000000e+00, %entry ], [ 1.000000e+04, %sw.bb.i ], [ %stateObj.0.3.0.ph, %sw.bb.3.i ], [ %stateObj.0.3.0.ph, %sw.bb.5.i ], [ %stateObj.0.3.0.ph, %while.body ]
+  %stateId.0.ph = phi i32 [ 0, %entry ], [ 1, %sw.bb.i ], [ -1, %sw.bb.3.i ], [ -1, %sw.bb.5.i ], [ 3, %while.body ]
+  br label %while.cond
+
+while.cond:                                       ; preds = %while.body, %while.cond.outer
+  %stateId.0 = phi i32 [ -1, %while.body ], [ %stateId.0.ph, %while.cond.outer ]
+  %cmp = icmp sgt i32 %stateId.0, -1
+  br i1 %cmp, label %while.body, label %while.end
+
+while.body:                                       ; preds = %while.cond
+  switch i32 %stateId.0, label %while.cond [
+    i32 0, label %sw.bb.i
+    i32 1, label %while.cond.outer
+    i32 2, label %sw.bb.3.i
+    i32 3, label %sw.bb.5.i
+  ]
+
+sw.bb.i:                                          ; preds = %while.body
+  %Viewport_buffer.i = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 2, i32 0, i32 0, i1 false) #2
+  %conv.i0.i = uitofp i32 %0 to float
+  %conv.i1.i = uitofp i32 %1 to float
+  %Constants_buffer.i.i = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 2, i32 1, i32 4, i1 false) #2
+  %3 = call %dx.types.CBufRet.i32 @dx.op.cbufferLoadLegacy.i32(i32 59, %dx.types.Handle %Constants_buffer.i.i, i32 0) #2
+  %4 = extractvalue %dx.types.CBufRet.i32 %3, 0
+  %5 = extractvalue %dx.types.CBufRet.i32 %3, 1
+  %conv2.i0.i = uitofp i32 %4 to float
+  %conv2.i1.i = uitofp i32 %5 to float
+  %div.i0.i = fdiv float %conv.i0.i, %conv2.i0.i
+  %div.i1.i = fdiv float %conv.i1.i, %conv2.i1.i
+  %6 = call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %Viewport_buffer.i, i32 0) #2
+  %7 = extractvalue %dx.types.CBufRet.f32 %6, 2
+  %8 = extractvalue %dx.types.CBufRet.f32 %6, 0
+  %9 = fsub float %7, %8
+  %10 = fmul float %div.i0.i, %9
+  %11 = fadd float %8, %10
+  %12 = extractvalue %dx.types.CBufRet.f32 %6, 3
+  %13 = extractvalue %dx.types.CBufRet.f32 %6, 1
+  %14 = fsub float %12, %13
+  %15 = fmul float %div.i1.i, %14
+  %16 = fadd float %13, %15
+  br label %while.cond.outer
+
+sw.bb.3.i:                                        ; preds = %while.body
+  %RenderTarget_UAV_2d.i = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 1, i32 0, i32 0, i1 false) #2
+  call void @dx.op.textureStore.f32(i32 67, %dx.types.Handle %RenderTarget_UAV_2d.i, i32 %0, i32 %1, i32 undef, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, i8 15) #2
+  br label %while.cond.outer
+
+sw.bb.5.i:                                        ; preds = %while.body
+  %RenderTarget_UAV_2d.i.1 = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 1, i32 0, i32 0, i1 false) #2
+  call void @dx.op.textureStore.f32(i32 67, %dx.types.Handle %RenderTarget_UAV_2d.i.1, i32 %0, i32 %1, i32 undef, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, i8 15) #2
+  br label %while.cond.outer
+
+while.end:                                        ; preds = %while.cond
+  ret void
+}
+
+attributes #0 = { nounwind readonly }
+attributes #1 = { nounwind readnone }
+attributes #2 = { nounwind }
+
+!dx.version = !{!0}
+!dx.valver = !{!0}
+!dx.shaderModel = !{!1}
+!dx.resources = !{!2}
+!dx.typeAnnotations = !{!9}
+!dx.entryPoints = !{!13}
+
+!0 = !{i32 1, i32 0}
+!1 = !{!"cs", i32 6, i32 0}
+!2 = !{null, !3, !6, null}
+!3 = !{!4}
+!4 = !{i32 0, %class.RWTexture2D* undef, !"RenderTarget", i32 0, i32 0, i32 1, i32 2, i1 false, i1 false, i1 false, !5}
+!5 = !{i32 0, i32 9}
+!6 = !{!7, !8}
+!7 = !{i32 0, %Viewport* undef, !"Viewport", i32 0, i32 0, i32 1, i32 16, null}
+!8 = !{i32 1, %Constants* undef, !"Constants", i32 2147473647, i32 4, i32 1, i32 8, null}
+!9 = !{i32 1, void ()* @main, !10}
+!10 = !{!11}
+!11 = !{i32 0, !12, !12}
+!12 = !{}
+!13 = !{void ()* @main, !"main", null, !2, !14}
+!14 = !{i32 4, !15}
 !15 = !{i32 8, i32 4, i32 1}

+ 19 - 19
tools/clang/test/CodeGenHLSL/quick-test/lib_select_res.hlsl

@@ -1,20 +1,20 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
-
-// Make sure createHandleFromResourceStructForLib is used for resource.
-// CHECK:call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.ByteAddressBuffer(i32 160
-// CHECK:call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.ByteAddressBuffer(i32 160
-// CHECK:call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.RWByteAddressBuffer(i32 160
-
-RWByteAddressBuffer outputBuffer : register(u0);
-ByteAddressBuffer ReadBuffer : register(t0);
-ByteAddressBuffer ReadBuffer1 : register(t1);
-
-void test( uint cond)
-{
-	ByteAddressBuffer buffer = ReadBuffer;
-        if (cond > 2)
-           buffer = ReadBuffer1;
-
-	uint v= buffer.Load(0);
-    outputBuffer.Store(0, v);
+// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+
+// Make sure createHandleFromResourceStructForLib is used for resource.
+// CHECK:call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.ByteAddressBuffer(i32 160
+// CHECK:call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.ByteAddressBuffer(i32 160
+// CHECK:call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.RWByteAddressBuffer(i32 160
+
+RWByteAddressBuffer outputBuffer : register(u0);
+ByteAddressBuffer ReadBuffer : register(t0);
+ByteAddressBuffer ReadBuffer1 : register(t1);
+
+void test( uint cond)
+{
+	ByteAddressBuffer buffer = ReadBuffer;
+        if (cond > 2)
+           buffer = ReadBuffer1;
+
+	uint v= buffer.Load(0);
+    outputBuffer.Store(0, v);
 }

+ 10 - 10
tools/clang/test/CodeGenHLSL/quick-test/local_constant.hlsl

@@ -1,11 +1,11 @@
-// RUN: %dxc -T ps_6_0 -E main  -fcgl %s | FileCheck %s
-
-// Make sure global variable is created for local constant.
-// CHECK: internal constant [3 x float]
-// CHECK-NOT: alloca [3 x float]
-
-float main(uint i : A) : SV_TARGET
-{
-  const float cb[] = {1.3, 1.2, 3.3};
-  return cb[i];
+// RUN: %dxc -T ps_6_0 -E main  -fcgl %s | FileCheck %s
+
+// Make sure global variable is created for local constant.
+// CHECK: internal constant [3 x float]
+// CHECK-NOT: alloca [3 x float]
+
+float main(uint i : A) : SV_TARGET
+{
+  const float cb[] = {1.3, 1.2, 3.3};
+  return cb[i];
 }

+ 16 - 16
tools/clang/test/CodeGenHLSL/quick-test/local_res_array.hlsl

@@ -1,17 +1,17 @@
-// RUN: %dxc -T cs_6_0 -E main %s | FileCheck %s
-
-// Make sure simple local resource array works.
-// CHECK: main
-
-RWByteAddressBuffer outputBuffer;
-RWByteAddressBuffer outputBuffer2;
-
-[numthreads(8, 8, 1)]
-void main( uint2 id : SV_DispatchThreadID )
-{
-	RWByteAddressBuffer buffer[2];
-	buffer[0] = outputBuffer;
-	buffer[1] = outputBuffer2;
-    buffer[0].Store(id.x, id.y);
-    buffer[1].Store(id.y, id.x);
+// RUN: %dxc -T cs_6_0 -E main %s | FileCheck %s
+
+// Make sure simple local resource array works.
+// CHECK: main
+
+RWByteAddressBuffer outputBuffer;
+RWByteAddressBuffer outputBuffer2;
+
+[numthreads(8, 8, 1)]
+void main( uint2 id : SV_DispatchThreadID )
+{
+	RWByteAddressBuffer buffer[2];
+	buffer[0] = outputBuffer;
+	buffer[1] = outputBuffer2;
+    buffer[0].Store(id.x, id.y);
+    buffer[1].Store(id.y, id.x);
 } 

+ 15 - 15
tools/clang/test/CodeGenHLSL/quick-test/local_res_array2.hlsl

@@ -1,16 +1,16 @@
-// RUN: %dxc -T cs_6_0 -E main %s | FileCheck %s
-
-// Report error when cannot promote local resource.
-// CHECK: non-promotable local resource found
-
-RWByteAddressBuffer outputBuffer;
-RWByteAddressBuffer outputBuffer2;
-uint i;
-[numthreads(8, 8, 1)]
-void main( uint2 id : SV_DispatchThreadID )
-{
-	RWByteAddressBuffer buffer[2];
-	buffer[0] = outputBuffer;
-	buffer[1] = outputBuffer2;
-    buffer[i].Store(id.y, id.x);
+// RUN: %dxc -T cs_6_0 -E main %s | FileCheck %s
+
+// Report error when cannot promote local resource.
+// CHECK: non-promotable local resource found
+
+RWByteAddressBuffer outputBuffer;
+RWByteAddressBuffer outputBuffer2;
+uint i;
+[numthreads(8, 8, 1)]
+void main( uint2 id : SV_DispatchThreadID )
+{
+	RWByteAddressBuffer buffer[2];
+	buffer[0] = outputBuffer;
+	buffer[1] = outputBuffer2;
+    buffer[i].Store(id.y, id.x);
 }

+ 8 - 8
tools/clang/test/CodeGenHLSL/quick-test/vec_smooth_step.hlsl

@@ -1,9 +1,9 @@
-// RUN: %dxc -T ps_6_0 -E main %s | FileCheck %s
-
-// Make sure use vector smoothstep works.
-// CHECK: Saturate
-
-float2 main(float2 a : A) : SV_TARGET
-{
-  return smoothstep(a, 1.2,1.6);
+// RUN: %dxc -T ps_6_0 -E main %s | FileCheck %s
+
+// Make sure use vector smoothstep works.
+// CHECK: Saturate
+
+float2 main(float2 a : A) : SV_TARGET
+{
+  return smoothstep(a, 1.2,1.6);
 }

+ 17 - 17
tools/clang/tools/dotnetc/EditorForm.cs

@@ -489,8 +489,8 @@ namespace MainNs
             if (target != null && target.Length == 6)
                 if (Int32.TryParse(new string(target[3], 1), out major))
                     return major >= 6;
-            if (target.StartsWith("lib"))
-                if (Int32.TryParse(new string(target[4], 1), out major))
+            if (target.StartsWith("lib"))
+                if (Int32.TryParse(new string(target[4], 1), out major))
                     return major >= 6;
             return false;
         }
@@ -537,22 +537,22 @@ namespace MainNs
                     string[] arguments = fileVars.Arguments;
                     if (isDxil)
                     {
-                        try
-                        {
-                            var result = compiler.Compile(source, fileName, fileVars.Entry, fileVars.Target, arguments, arguments.Length, null, 0, library.CreateIncludeHandler());
-                            if (result.GetStatus() == 0)
-                            {
-                                this.SelectedShaderBlob = result.GetResult();
-                                this.DisassembleSelectedShaderBlob();
-                            }
-                            else
-                            {
-                                this.colorizationService.ClearColorization(this.DisassemblyTextBox);
-                                this.DisassemblyTextBox.Text = GetStringFromBlob(result.GetErrors());
+                        try
+                        {
+                            var result = compiler.Compile(source, fileName, fileVars.Entry, fileVars.Target, arguments, arguments.Length, null, 0, library.CreateIncludeHandler());
+                            if (result.GetStatus() == 0)
+                            {
+                                this.SelectedShaderBlob = result.GetResult();
+                                this.DisassembleSelectedShaderBlob();
+                            }
+                            else
+                            {
+                                this.colorizationService.ClearColorization(this.DisassemblyTextBox);
+                                this.DisassemblyTextBox.Text = GetStringFromBlob(result.GetErrors());
                             }
-                        } catch (Exception e)
-                        {
-                            DisassemblyTextBox.Text = e.ToString();
+                        } catch (Exception e)
+                        {
+                            DisassemblyTextBox.Text = e.ToString();
                         }
                     }
                     else

+ 16 - 16
tools/clang/tools/dotnetc/dia2.cs

@@ -463,27 +463,27 @@ namespace dia2
             [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I1, SizeParamIndex = 1)] ref byte[] pbData);
     }
 
-    [ComImport]
+    [ComImport]
     [Guid("AE605CDC-8105-4a23-B710-3259F1E26112")]
-    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
-    public interface IDiaInjectedSource
-    {
-        uint get_crc();
-        uint get_length();
-
+    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+    public interface IDiaInjectedSource
+    {
+        uint get_crc();
+        uint get_length();
+
         [return: MarshalAs(UnmanagedType.BStr)]
-        string get_fileName();
+        string get_fileName();
         [return: MarshalAs(UnmanagedType.BStr)]
-        string get_objectFilename();
+        string get_objectFilename();
         [return: MarshalAs(UnmanagedType.BStr)]
-        string get_virtualFilename();
-        uint get_sourceCompression();
-        [PreserveSig]
+        string get_virtualFilename();
+        uint get_sourceCompression();
+        [PreserveSig]
         int get_source(uint cbData, out uint pcbData,
-            [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U8, SizeParamIndex = 0)] byte[] pbData);
-
-    }
-
+            [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U8, SizeParamIndex = 0)] byte[] pbData);
+
+    }
+
     [ComImport]
     [Guid("4A59FB77-ABAC-469b-A30B-9ECC85BFEF14")]
     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]