2
0
Эх сурвалжийг харах

Fix tests which /Zi makes trivially succeed (#2171)

/Zi should be used with much care in FileCheck tests, because the contents of the test file gets embedded into the output, so any CHECK: lines will match by default because they will match themselves in the quoted source file.

This change removes /Zi from most tests which should not have it anyways. Several tests had to be updated or deleted because they weren't actually passing. All tests with /Zi remaining are now under the debug subfolder and reference the readme file that explains the gotcha.
Tristan Labelle 6 жил өмнө
parent
commit
c9aa79b127
56 өөрчлөгдсөн 113 нэмэгдсэн , 286 устгасан
  1. 1 1
      tools/clang/test/CodeGenHLSL/Samples/MiniEngine/FXAAPass1_Luma_CS.hlsl
  2. 2 2
      tools/clang/test/CodeGenHLSL/batch/declarations/resources/nonglobal/misc/local_res_fail_map_error_msg.hlsl
  3. 0 85
      tools/clang/test/CodeGenHLSL/batch/misc/BasicHLSL11_PS2.hlsl
  4. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/MinimalTraverseShaderLib-pp.hlsl
  5. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/PatchLength1.hlsl
  6. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/SimpleHs1.hlsl
  7. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/SimpleHs6.hlsl
  8. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/SimpleHs7.hlsl
  9. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/clip_planes.hlsl
  10. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/eval.hlsl
  11. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/input1.hlsl
  12. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/local_resource1.hlsl
  13. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/local_resource4.hlsl
  14. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/local_resource7_dbg.hlsl
  15. 0 20
      tools/clang/test/CodeGenHLSL/batch/misc/lower-memcpy-gep-test.hlsl
  16. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/matElt.hlsl
  17. 0 11
      tools/clang/test/CodeGenHLSL/batch/misc/min10float.hlsl
  18. 0 21
      tools/clang/test/CodeGenHLSL/batch/misc/min10float_to_float.hlsl
  19. 0 11
      tools/clang/test/CodeGenHLSL/batch/misc/min12int.hlsl
  20. 0 21
      tools/clang/test/CodeGenHLSL/batch/misc/min12int_to_int.hlsl
  21. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/namespace-global-debug.hlsl
  22. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/resPhi.hlsl
  23. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/resPhi2.hlsl
  24. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/shader-compat-suite/lib_ret_res.hlsl
  25. 0 10
      tools/clang/test/CodeGenHLSL/batch/misc/signature_dbg_info.hlsl
  26. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/staticGlobals2.hlsl
  27. 0 30
      tools/clang/test/CodeGenHLSL/batch/misc/static_global_copy2.hlsl
  28. 1 1
      tools/clang/test/CodeGenHLSL/batch/misc/unroll_dbg.hlsl
  29. 1 1
      tools/clang/test/CodeGenHLSL/batch/shader_stages/library/lib_select_res.hlsl
  30. 11 10
      tools/clang/test/CodeGenHLSL/batch/shader_stages/library/lib_select_res_x.hlsl
  31. 8 4
      tools/clang/test/CodeGenHLSL/debug/array_piece.hlsl
  32. 0 0
      tools/clang/test/CodeGenHLSL/debug/dilocation/duplicate_difile_regression.hlsl
  33. 6 3
      tools/clang/test/CodeGenHLSL/debug/dilocation/ignore_line_directives.hlsl
  34. 5 5
      tools/clang/test/CodeGenHLSL/debug/dilocation/local_resource_createhandle.hlsl
  35. 4 2
      tools/clang/test/CodeGenHLSL/debug/dilocation/static_init_inline.hlsl
  36. 4 1
      tools/clang/test/CodeGenHLSL/debug/full_var_no_bitpiece.hlsl
  37. 2 2
      tools/clang/test/CodeGenHLSL/debug/misc/inline_dbginfo.hlsl
  38. 2 0
      tools/clang/test/CodeGenHLSL/debug/misc/intrinsic4_dbg.hlsl
  39. 3 1
      tools/clang/test/CodeGenHLSL/debug/misc/share_mem_dbg.hlsl
  40. 6 3
      tools/clang/test/CodeGenHLSL/debug/nested_struct.hlsl
  41. 3 1
      tools/clang/test/CodeGenHLSL/debug/nested_struct_arg.hlsl
  42. 4 2
      tools/clang/test/CodeGenHLSL/debug/scalar_inf_loop.hlsl
  43. 6 2
      tools/clang/test/CodeGenHLSL/debug/struct_piece.hlsl
  44. 1 1
      tools/clang/test/CodeGenHLSL/local_resource2.hlsl
  45. 1 1
      tools/clang/test/CodeGenHLSL/local_resource3.hlsl
  46. 1 1
      tools/clang/test/CodeGenHLSL/local_resource5_dbg.hlsl
  47. 1 1
      tools/clang/test/CodeGenHLSL/local_resource6_dbg.hlsl
  48. 1 1
      tools/clang/test/CodeGenHLSL/optForNoOpt3.hlsl
  49. 1 1
      tools/clang/test/CodeGenHLSL/optForNoOpt4.hlsl
  50. 4 4
      tools/clang/test/CodeGenHLSL/val-wave-failures-ps.hlsl
  51. 1 1
      tools/clang/test/CodeGenHLSL/validation/SimpleHs1.hlsl
  52. 1 1
      tools/clang/test/CodeGenHLSL/validation/clip_planes.hlsl
  53. 1 1
      tools/clang/test/CodeGenHLSL/validation/eval.hlsl
  54. 0 6
      tools/clang/test/CodeGenHLSL/validation/resCopy.hlsl
  55. 9 0
      tools/clang/test/HLSL/mintypes-promotion-warnings.hlsl
  56. 5 0
      tools/clang/unittests/HLSL/VerifierTest.cpp

+ 1 - 1
tools/clang/test/CodeGenHLSL/Samples/MiniEngine/FXAAPass1_Luma_CS.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T cs_6_0 /Zi %s | FileCheck %s
+// RUN: %dxc -E main -T cs_6_0 %s | FileCheck %s
 
 
 // CHECK: threadIdInGroup
 // CHECK: threadIdInGroup
 // CHECK: threadId
 // CHECK: threadId

+ 2 - 2
tools/clang/test/CodeGenHLSL/batch/declarations/resources/nonglobal/misc/local_res_fail_map_error_msg.hlsl

@@ -1,8 +1,8 @@
-// RUN: %dxc -E main -T ps_6_0 -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
 
 
 // Make sure line number is show for resource failed to map.
 // Make sure line number is show for resource failed to map.
 
 
-// CHECK:local_res_fail_map_error_msg.hlsl:11:10: local resource not guaranteed to map to unique global resource
+// CHECK: local resource not guaranteed to map to unique global resource
 
 
 SamplerState samp1 : register(s5);
 SamplerState samp1 : register(s5);
 
 

+ 0 - 85
tools/clang/test/CodeGenHLSL/batch/misc/BasicHLSL11_PS2.hlsl

@@ -1,85 +0,0 @@
-// RUN: %dxc -E main -T ps_6_0 -Zi /Od %s | FileCheck %s
-
-// CHECK: DepthOutput=0
-// CHECK: SampleFrequency=1
-
-// CHECK: NORMAL                   0                 sample
-// CHECK: TEXCOORD                 0          noperspective
-
-// CHECK: g_txDiffuse_texture_2d
-// CHECK: g_samLinear_sampler
-
-
-// CHECK: llvm.dbg.declare(metadata [4 x float]* %vDiffuse
-// CHECK: llvm.dbg.declare(metadata float* %fLighting
-
-// Output.c
-// CHECK: llvm.dbg.declare(metadata <4 x float>* %2
-// Output.d
-// CHECK: llvm.dbg.declare(metadata float* %3
-
-// CHECK: DILocalVariable(tag: DW_TAG_auto_variable, name: "vDiffuse"
-// CHECK: DILocalVariable(tag: DW_TAG_auto_variable, name: "fLighting"
-
-
-//--------------------------------------------------------------------------------------
-// File: BasicHLSL11_PS.hlsl
-//
-// The pixel shader file for the BasicHLSL11 sample.
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//--------------------------------------------------------------------------------------
-
-//--------------------------------------------------------------------------------------
-// Globals
-//--------------------------------------------------------------------------------------
-cbuffer cbPerObject : register( b0 )
-{
-    float4    g_vObjectColor    : packoffset( c0 );
-};
-
-cbuffer cbPerFrame : register( b1 )
-{
-    float3    g_vLightDir    : packoffset( c0 );
-    float    g_fAmbient    : packoffset( c0.w );
-};
-
-//--------------------------------------------------------------------------------------
-// Textures and Samplers
-//--------------------------------------------------------------------------------------
-Texture2D    g_txDiffuse : register( t0 );
-SamplerState    g_samLinear : register( s0 );
-
-//--------------------------------------------------------------------------------------
-// Input / Output structures
-//--------------------------------------------------------------------------------------
-struct PS_INPUT
-{
-  sample          float3 vNormal    : NORMAL;
-  noperspective   float2 vTexcoord  : TEXCOORD0;
-};
-
-struct PS_OUTPUT
-{
-  float4 c : SV_TARGET;
-  float  d : SV_DEPTH;
-};
-
-
-//--------------------------------------------------------------------------------------
-// Pixel Shader
-//--------------------------------------------------------------------------------------
-
-PS_OUTPUT main( PS_INPUT Input) : SV_TARGET
-{
-    float4 vDiffuse = g_txDiffuse.Sample( g_samLinear, Input.vTexcoord );
-
-    float fLighting = saturate( dot( g_vLightDir, Input.vNormal ) );
-    fLighting = max( fLighting, g_fAmbient );
-
-struct PS_OUTPUT Output;
-    Output.c = vDiffuse * fLighting;
-    Output.d = fLighting;
-    return Output;
-}
-

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/MinimalTraverseShaderLib-pp.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 -Zi -HV 2017 -O3 -Zpr -default-linkage external %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -HV 2017 -O3 -Zpr -default-linkage external %s | FileCheck %s
 
 
 // CHECK: define void @"\01?Fallback_TraceRay
 // CHECK: define void @"\01?Fallback_TraceRay
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/PatchLength1.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T hs_6_0 -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T hs_6_0 %s | FileCheck %s
 
 
 // CHECK: @dx.op.storePatchConstant.f32(i32 106, i32 0, i32 2, i8 0, float 3.000000e+00)
 // CHECK: @dx.op.storePatchConstant.f32(i32 106, i32 0, i32 2, i8 0, float 3.000000e+00)
 // CHECK: @dx.op.storePatchConstant.f32(i32 106, i32 1, i32 0, i8 0, float 3.000000e+00)
 // CHECK: @dx.op.storePatchConstant.f32(i32 106, i32 1, i32 0, i8 0, float 3.000000e+00)

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/SimpleHs1.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T hs_6_0 -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T hs_6_0 %s | FileCheck %s
 
 
 // CHECK: SV_RenderTargetArrayIndex or SV_ViewportArrayIndex from any shader feeding rasterizer
 // CHECK: SV_RenderTargetArrayIndex or SV_ViewportArrayIndex from any shader feeding rasterizer
 // CHECK: InputControlPointCount=3
 // CHECK: InputControlPointCount=3

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/SimpleHs6.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T hs_6_0 -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T hs_6_0 %s | FileCheck %s
 
 
 // CHECK: may only have one InputPatch parameter
 // CHECK: may only have one InputPatch parameter
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/SimpleHs7.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T hs_6_0 -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T hs_6_0 %s | FileCheck %s
 
 
 // CHECK: InputPatch should not be out/inout parameter
 // CHECK: InputPatch should not be out/inout parameter
 // CHECK: OutputPatch should not be out/inout parameter
 // CHECK: OutputPatch should not be out/inout parameter

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/clip_planes.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T vs_6_0 -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T vs_6_0 %s | FileCheck %s
 
 
 // TODO: validate the debug info for clip plane.
 // TODO: validate the debug info for clip plane.
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/eval.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T ps_6_0 -Od -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
 
 
 // CHECK: evalCentroid
 // CHECK: evalCentroid
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/input1.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T ps_6_0 -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
 
 
 // For IsFrontFace.
 // For IsFrontFace.
 // CHECK: icmp ne
 // CHECK: icmp ne

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/local_resource1.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -Zi -Od -T ps_6_0 %s | FileCheck %s
+// RUN: %dxc -E main -Od -T ps_6_0 %s | FileCheck %s
 
 
 // CHECK: main
 // CHECK: main
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/local_resource4.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -Zi -Od -T ps_6_0 %s | FileCheck %s
+// RUN: %dxc -E main -Od -T ps_6_0 %s | FileCheck %s
 
 
 // CHECK: main
 // CHECK: main
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/local_resource7_dbg.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -Zi -Od -T ps_6_0 %s | FileCheck %s
+// RUN: %dxc -E main -Od -T ps_6_0 %s | FileCheck %s
 
 
 // CHECK: main
 // CHECK: main
 
 

+ 0 - 20
tools/clang/test/CodeGenHLSL/batch/misc/lower-memcpy-gep-test.hlsl

@@ -1,20 +0,0 @@
-// RUN: %dxc /Tps_6_2 /Eps_main /Zpc /O3 /Zi > %s | FileCheck %s
-// CHECK: define void @main()
-// CHECK: entry
-
-struct MyStruct1 
-{     
-    float var [ 1 ] ; 
-} ; 
-
-struct MyStruct2 
-{ 
-    MyStruct1 internal [ 1 ] ; 
-} ; 
-
-void ps_main ( ) 
-{ 
-    MyStruct1 mystruct1 [ 1 ] ;
-    MyStruct2 mystruct2 ;
-    mystruct2.internal = mystruct1 ;
-} 

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/matElt.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T cs_6_0 -Zi -Od %s | FileCheck %s
+// RUN: %dxc -E main -T cs_6_0 -Od %s | FileCheck %s
 
 
 
 
 // CHECK: @dx.op.cbufferLoadLegacy.f32(i32 59
 // CHECK: @dx.op.cbufferLoadLegacy.f32(i32 59

+ 0 - 11
tools/clang/test/CodeGenHLSL/batch/misc/min10float.hlsl

@@ -1,11 +0,0 @@
-// RUN: %dxc -E main -T ps_6_0 -Zi %s | FileCheck %s
-
-// CHECK: warning: min10float is promoted to min16float
-// CHECK: define void @main
-// CHECK: ret void
-
-[RootSignature("")]
-min10float main( min10float mf:P ) : SV_Target
-{
-    return  mf * 2;
-}

+ 0 - 21
tools/clang/test/CodeGenHLSL/batch/misc/min10float_to_float.hlsl

@@ -1,21 +0,0 @@
-// RUN: %dxc -E main -T ps_6_0 -Zi %s | FileCheck %s
-
-// CHECK: warning: min10float is promoted to min16float
-// CHECK: define void @main
-// CHECK: ret void
-
-[RootSignature("")]
-float2 main( min10float mf:P , int s:Q) : SV_Target
-{
-    if(s > 1)
-    {
-        min10float new_mf = mf * mf;
-        new_mf = new_mf / 2.0;
-        float f = float(new_mf);
-        f = (f * 4.0) / 3.3;
-        min10float new_mf1 = min10float(f);
-        new_mf1 = new_mf1 + new_mf;
-        return float2(new_mf1, new_mf1);
-    }
-    return float2(1.0, 1.0);
-}

+ 0 - 11
tools/clang/test/CodeGenHLSL/batch/misc/min12int.hlsl

@@ -1,11 +0,0 @@
-// RUN: %dxc -E main -T ps_6_0 -Zi %s | FileCheck %s
-
-// CHECK: warning: min12int is promoted to min16int
-// CHECK: define void @main
-// CHECK: ret void
-
-[RootSignature("")]
-min12int main( min12int mi:P ) : SV_Target
-{
-    return  mi * 2;
-}

+ 0 - 21
tools/clang/test/CodeGenHLSL/batch/misc/min12int_to_int.hlsl

@@ -1,21 +0,0 @@
-// RUN: %dxc -E main -T ps_6_0 -Zi %s | FileCheck %s
-
-// CHECK: warning: min12int is promoted to min16int
-// CHECK: define void @main
-// CHECK: ret void
-
-[RootSignature("")]
-int2 main( min12int mi:P , int s:Q) : SV_Target
-{
-    if(s > 1)
-    {
-        min12int new_mi = mi * mi;
-        new_mi = min12int(new_mi * 2);
-        int f = int(new_mi);
-        f = (f * 4) / 3;
-        min12int new_mi1 = min12int(f);
-        new_mi1 = new_mi1 + new_mi;
-        return int2(new_mi1, new_mi1);
-    }
-    return int2(1, 1);
-}

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/namespace-global-debug.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T vs_6_0 -Zi -Od %s | FileCheck %s
+// RUN: %dxc -E main -T vs_6_0 -Od %s | FileCheck %s
 
 
 // CHECK: sc_Arr2D@foo{{.*}} = internal constant [9 x float] [float
 // CHECK: sc_Arr2D@foo{{.*}} = internal constant [9 x float] [float
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/resPhi.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T cs_6_0 -Zi -Od %s | FileCheck %s
+// RUN: %dxc -E main -T cs_6_0 -Od %s | FileCheck %s
 
 
 // CHECK: @main
 // CHECK: @main
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/resPhi2.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T ps_6_0 -Zi -Od %s | FileCheck %s
+// RUN: %dxc -E main -T ps_6_0 -Od %s | FileCheck %s
 
 
 // CHECK: main
 // CHECK: main
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/shader-compat-suite/lib_ret_res.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 -Zi -auto-binding-space 11 -default-linkage external %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 -default-linkage external %s | FileCheck %s
 
 
 // resources in return/params disallowed for lib_6_3
 // resources in return/params disallowed for lib_6_3
 // CHECK: error: Exported function
 // CHECK: error: Exported function

+ 0 - 10
tools/clang/test/CodeGenHLSL/batch/misc/signature_dbg_info.hlsl

@@ -1,10 +0,0 @@
-// RUN: %dxc -E main -T ps_6_0 -Od -Zi  %s | FileCheck %s
-
-// Make sure debug info for inp exist.
-// CHECK: !DILocalVariable(tag: DW_TAG_arg_variable, name: "inp"
-
-
-float4 main(float4 inp : COLOR) : SV_TARGET0 {
-    float4 a = inp;
-    return a;
-}

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/staticGlobals2.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main  -Zi -T ps_6_0 %s | FileCheck %s
+// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
 
 
 // TODO: create execution test.
 // TODO: create execution test.
 
 

+ 0 - 30
tools/clang/test/CodeGenHLSL/batch/misc/static_global_copy2.hlsl

@@ -1,30 +0,0 @@
-// RUN: %dxc -E main -T ps_6_0 -Zi %s | FileCheck %s
-
-
-// Make sure debug info works for flattened alloca.
-// CHECK:call void @llvm.dbg.declare(metadata [2 x float]* %a2.1, 
-
-struct X {
-   float a;
-   int b;
-};
-
-struct A {
-  X x[25];
-  float y[2];
-};
-
-A a;
-float b;
-
-void set(A aa) {
-   aa = a;
-   aa.y[0] = b;
-   aa.y[1] = 3;
-}
-
-float4 main(uint l:L) : SV_Target {
-  A a2;
-  set(a2);
-  return a2.x[l].a + a2.y[l];
-}

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/misc/unroll_dbg.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T vs_6_0  -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T vs_6_0 %s | FileCheck %s
 
 
 // CHECK: @main
 // CHECK: @main
 struct X {
 struct X {

+ 1 - 1
tools/clang/test/CodeGenHLSL/batch/shader_stages/library/lib_select_res.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 -Zi -auto-binding-space 11 -default-linkage external %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 -default-linkage external %s | FileCheck %s
 
 
 // resource uses must resolve to a single resource global variable (single rangeID)
 // resource uses must resolve to a single resource global variable (single rangeID)
 // CHECK: local resource not guaranteed to map to unique global resource
 // CHECK: local resource not guaranteed to map to unique global resource

+ 11 - 10
tools/clang/test/CodeGenHLSL/batch/shader_stages/library/lib_select_res_x.hlsl

@@ -1,18 +1,19 @@
-// RUN: %dxc -T lib_6_x -Od -Zi -auto-binding-space 11 %s | FileCheck %s
+// RUN: %dxc -T lib_6_x -Od %s | FileCheck %s
 
 
 // lib_6_x allows phi on resource, targeting offline linking only.
 // lib_6_x allows phi on resource, targeting offline linking only.
 // CHECK: phi %struct.ByteAddressBuffer
 // CHECK: phi %struct.ByteAddressBuffer
 
 
-RWByteAddressBuffer outputBuffer : register(u0);
-ByteAddressBuffer ReadBuffer : register(t0);
-ByteAddressBuffer ReadBuffer1 : register(t1);
+ByteAddressBuffer firstBuffer, secondBuffer;
+uint firstBufferSize;
 
 
-void test( uint cond)
+uint load(uint offset)
 {
 {
-	ByteAddressBuffer buffer = ReadBuffer;
-        if (cond > 2)
-           buffer = ReadBuffer1;
+    ByteAddressBuffer buffer = firstBuffer;
+    if (offset > firstBufferSize) {
+        // If we just do this assignment, we'll generate a select instead of a phi
+        buffer = secondBuffer;
+        offset -= firstBufferSize;
+    }
 
 
-	uint v= buffer.Load(0);
-    outputBuffer.Store(0, v);
+    return buffer.Load(offset);
 }
 }

+ 8 - 4
tools/clang/test/CodeGenHLSL/debug/array_piece.hlsl

@@ -1,10 +1,14 @@
 // RUN: %dxc -Zi -E main -T ps_6_0 %s | FileCheck %s
 // RUN: %dxc -Zi -E main -T ps_6_0 %s | FileCheck %s
 
 
 // Make sure the bit pieces have the offset in bits
 // Make sure the bit pieces have the offset in bits
-// CHECK-DAG: !{{[0-9]+}} = !DIExpression(DW_OP_bit_piece, 0, 32)
-// CHECK-DAG: !{{[0-9]+}} = !DIExpression(DW_OP_bit_piece, 32, 32)
-// CHECK-DAG: !{{[0-9]+}} = !DIExpression(DW_OP_bit_piece, 64, 32)
-// CHECK-DAG: !{{[0-9]+}} = !DIExpression(DW_OP_bit_piece, 96, 32)
+
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
+
+// CHECK-DAG: !DIExpression(DW_OP_bit_piece, 0, 32)
+// CHECK-DAG: !DIExpression(DW_OP_bit_piece, 32, 32)
+// CHECK-DAG: !DIExpression(DW_OP_bit_piece, 64, 32)
+// CHECK-DAG: !DIExpression(DW_OP_bit_piece, 96, 32)
 
 
 float main(float a : A, float b : B, float c : C, float d : D, float e : E) : SV_Target {
 float main(float a : A, float b : B, float c : C, float d : D, float e : E) : SV_Target {
   float s[4] = {
   float s[4] = {

+ 0 - 0
tools/clang/test/CodeGenHLSL/debug/duplicate_difile_regression.hlsl → tools/clang/test/CodeGenHLSL/debug/dilocation/duplicate_difile_regression.hlsl


+ 6 - 3
tools/clang/test/CodeGenHLSL/debug/ignore_line_directives.hlsl → tools/clang/test/CodeGenHLSL/debug/dilocation/ignore_line_directives.hlsl

@@ -1,10 +1,13 @@
 // RUN: %dxc -T lib_6_3 -auto-binding-space 11 -default-linkage external -Zi  -ignore-line-directives %s | FileCheck %s
 // RUN: %dxc -T lib_6_3 -auto-binding-space 11 -default-linkage external -Zi  -ignore-line-directives %s | FileCheck %s
 
 
 // Make sure only 1 DIFile exist in debug info when NoLineDirectives is enabled.
 // Make sure only 1 DIFile exist in debug info when NoLineDirectives is enabled.
-// CHECK: !DIFile
+
+// CHECK: !DIFile(filename: "{{.*}}ignore_line_directives.hlsl"
 // CHECK-NOT: !DIFile
 // CHECK-NOT: !DIFile
-// CHECK: ignore_line_directives.hlsl"
-// CHECK: ignore_line_directives.hlsl"}
+
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
+
 // CHECK-NOT: !DIFile
 // CHECK-NOT: !DIFile
 
 
 #line 0 "test.h"
 #line 0 "test.h"

+ 5 - 5
tools/clang/test/CodeGenHLSL/batch/misc/resCopy.hlsl → tools/clang/test/CodeGenHLSL/debug/dilocation/local_resource_createhandle.hlsl

@@ -1,17 +1,17 @@
-// RUN: %dxc -E main -Zi -Od -T cs_6_0 %s | FileCheck %s
+// RUN: %dxc -E main -Zi -Od -T vs_6_0 %s | FileCheck %s
 
 
 // Make sure createHandle has debug info.
 // Make sure createHandle has debug info.
+
 // CHECK: @dx.op.createHandle(i32 59, i8 1, i32 0, i32 0, i1 false), !dbg
 // CHECK: @dx.op.createHandle(i32 59, i8 1, i32 0, i32 0, i1 false), !dbg
 // CHECK: @dx.op.createHandle(i32 59, i8 1, i32 1, i32 1, i1 false), !dbg
 // CHECK: @dx.op.createHandle(i32 59, i8 1, i32 1, i32 1, i1 false), !dbg
 
 
 RWBuffer<uint> uav1;
 RWBuffer<uint> uav1;
 RWBuffer<uint> uav2;
 RWBuffer<uint> uav2;
 
 
-[ numthreads( 64, 2, 2 ) ]
-void main( uint GI : SV_GroupIndex)
+void main()
 {
 {
     RWBuffer<uint> u = uav1;
     RWBuffer<uint> u = uav1;
-    u[GI] = u[GI] + 1;
+    u[0] = 0;
     u = uav2;
     u = uav2;
-    u[GI] = GI+1;
+    u[0] = 0;
 }
 }

+ 4 - 2
tools/clang/test/CodeGenHLSL/debug/static_init_inline.hlsl → tools/clang/test/CodeGenHLSL/debug/dilocation/static_init_inline.hlsl

@@ -3,12 +3,14 @@
 // Make sure when there is non-trivial global variable initialization, the
 // Make sure when there is non-trivial global variable initialization, the
 // inlined initialization instructions have "inlinedAt" property
 // inlined initialization instructions have "inlinedAt" property
 
 
-// CHECK: !{{[0-9]+}} = !DILocation(line: {{[0-9]+}}, column: {{[0-9]+}}, scope: !{{[0-9]+}}, inlinedAt:
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
+
+// CHECK: !DILocation(line: {{[0-9]+}}, column: {{[0-9]+}}, scope: !{{[0-9]+}}, inlinedAt:
 
 
 static float4 my_value = float4(1,2,3,4);
 static float4 my_value = float4(1,2,3,4);
 static float4 my_value2 = my_value*2;
 static float4 my_value2 = my_value*2;
 
 
-[RootSignature("")]
 float4 main() : SV_Target {
 float4 main() : SV_Target {
   return my_value2;
   return my_value2;
 }
 }

+ 4 - 1
tools/clang/test/CodeGenHLSL/debug/full_var_no_bitpiece.hlsl

@@ -3,7 +3,10 @@
 // Make sure there's no bit piece debug expression when
 // Make sure there's no bit piece debug expression when
 // the element covers the whole variable.
 // the element covers the whole variable.
 
 
-// CHECK-NOT: !{{[0-9]+}} = !DIExpression(DW_OP_bit_piece
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
+
+// CHECK-NOT: !DIExpression(DW_OP_bit_piece
 
 
 float main(float a : A, float b : B) : SV_Target {
 float main(float a : A, float b : B) : SV_Target {
   float s[1] = {
   float s[1] = {

+ 2 - 2
tools/clang/test/CodeGenHLSL/batch/misc/inline_dbginfo.hlsl → tools/clang/test/CodeGenHLSL/debug/misc/inline_dbginfo.hlsl

@@ -3,8 +3,8 @@
 // Make sure llvm.dbg.value exist.
 // Make sure llvm.dbg.value exist.
 // CHECK: call void @llvm.dbg.value
 // CHECK: call void @llvm.dbg.value
 
 
-// Make sure vector is a vector in debug info.
-// CHECK: DIFlagVector
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
 
 
 typedef float4 MyCoolFloat4;
 typedef float4 MyCoolFloat4;
 
 

+ 2 - 0
tools/clang/test/CodeGenHLSL/batch/misc/intrinsic4_dbg.hlsl → tools/clang/test/CodeGenHLSL/debug/misc/intrinsic4_dbg.hlsl

@@ -24,6 +24,8 @@
 // CHECK: llvm.dbg.declare(metadata i32* %dim
 // CHECK: llvm.dbg.declare(metadata i32* %dim
 // CHECK: getDimensions
 // CHECK: getDimensions
 
 
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
 
 
 SamplerState samp1 : register(s5);
 SamplerState samp1 : register(s5);
 Texture2D<float4> text1 : register(t3);
 Texture2D<float4> text1 : register(t3);

+ 3 - 1
tools/clang/test/CodeGenHLSL/batch/misc/share_mem_dbg.hlsl → tools/clang/test/CodeGenHLSL/debug/misc/share_mem_dbg.hlsl

@@ -16,8 +16,10 @@
 // CHECK: DIDerivedType(tag: DW_TAG_member, name: "d"
 // CHECK: DIDerivedType(tag: DW_TAG_member, name: "d"
 // CHECK: DIDerivedType(tag: DW_TAG_member, name: "b"
 // CHECK: DIDerivedType(tag: DW_TAG_member, name: "b"
 
 
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
+
 // Make sure source info contents exist.
 // Make sure source info contents exist.
-// CHECK: share_mem_dbg.hlsl", !"// RUN: %dxc
 // CHECK: !{!"DefineA=1", !"DefineB=0"}
 // CHECK: !{!"DefineA=1", !"DefineB=0"}
 // CHECK: share_mem_dbg.hlsl"}
 // CHECK: share_mem_dbg.hlsl"}
 // CHECK: !{!"-E", !"main", !"-T", !"cs_6_0", !"-Zi", !"-Od", !"-D", !"DefineA", !"-D", !"DefineB=0"}
 // CHECK: !{!"-E", !"main", !"-T", !"cs_6_0", !"-Zi", !"-Od", !"-D", !"DefineA", !"-D", !"DefineB=0"}

+ 6 - 3
tools/clang/test/CodeGenHLSL/debug/nested_struct.hlsl

@@ -3,9 +3,12 @@
 // Make sure all elements of the struct (even when there are nested structs)
 // Make sure all elements of the struct (even when there are nested structs)
 // are at distinct offsets.
 // are at distinct offsets.
 
 
-// CHECK-DAG: !{{[0-9]+}} = !DIExpression(DW_OP_bit_piece, 0, 32)
-// CHECK-DAG: !{{[0-9]+}} = !DIExpression(DW_OP_bit_piece, 32, 32)
-// CHECK-DAG: !{{[0-9]+}} = !DIExpression(DW_OP_bit_piece, 64, 32)
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
+
+// CHECK-DAG: !DIExpression(DW_OP_bit_piece, 0, 32)
+// CHECK-DAG: !DIExpression(DW_OP_bit_piece, 32, 32)
+// CHECK-DAG: !DIExpression(DW_OP_bit_piece, 64, 32)
 
 
 struct K {
 struct K {
   float foo;
   float foo;

+ 3 - 1
tools/clang/test/CodeGenHLSL/debug/nested_struct_arg.hlsl

@@ -3,8 +3,10 @@
 // Make sure all elements of the struct in an arg (even when there are nested
 // Make sure all elements of the struct in an arg (even when there are nested
 // structs) are at distinct offsets.
 // structs) are at distinct offsets.
 
 
-// CHECK-DAG: DW_OP_bit_piece
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
 
 
+// CHECK-DAG: DW_OP_bit_piece
 
 
 struct K_ARG {
 struct K_ARG {
   float foo : KFOO;
   float foo : KFOO;

+ 4 - 2
tools/clang/test/CodeGenHLSL/debug/scalar_inf_loop.hlsl

@@ -1,9 +1,11 @@
 // RUN: %dxc -T ps_6_0 -E main -Zi -O3 %s | FileCheck %s
 // RUN: %dxc -T ps_6_0 -E main -Zi -O3 %s | FileCheck %s
 
 
-// CHECK: @main
-
 // Test for an infinite loop in scalarizer when generating
 // Test for an infinite loop in scalarizer when generating
 
 
+// CHECK: @main
+
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
 
 
 float3 fn(float3 a, float3 b, float3 c) {
 float3 fn(float3 a, float3 b, float3 c) {
   float3 x = (a - b) * a;
   float3 x = (a - b) * a;

+ 6 - 2
tools/clang/test/CodeGenHLSL/debug/struct_piece.hlsl

@@ -1,8 +1,12 @@
 // RUN: %dxc -Od -Zi -E main -T ps_6_0 %s | FileCheck %s
 // RUN: %dxc -Od -Zi -E main -T ps_6_0 %s | FileCheck %s
 
 
 // Make sure the bit pieces have the offset in bits
 // Make sure the bit pieces have the offset in bits
-// CHECK-DAG: !{{[0-9]+}} = !DIExpression(DW_OP_bit_piece, 0, 32)
-// CHECK-DAG: !{{[0-9]+}} = !DIExpression(DW_OP_bit_piece, 32, 32)
+
+// Exclude quoted source file (see readme)
+// CHECK-LABEL: {{!"[^"]*\\0A[^"]*"}}
+
+// CHECK-DAG: !DIExpression(DW_OP_bit_piece, 0, 32)
+// CHECK-DAG: !DIExpression(DW_OP_bit_piece, 32, 32)
 
 
 struct S {
 struct S {
   float foo;
   float foo;

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

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -Zi -Od -T ps_6_0 %s | FileCheck %s
+// RUN: %dxc -E main -Od -T ps_6_0 %s | FileCheck %s
 
 
 // CHECK: local resource not guaranteed to map to unique global resource
 // CHECK: local resource not guaranteed to map to unique global resource
 
 

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

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -Zi -Od -T ps_6_0 %s | FileCheck %s
+// RUN: %dxc -E main -Od -T ps_6_0 %s | FileCheck %s
 
 
 // CHECK: local resource not guaranteed to map to unique global resource
 // CHECK: local resource not guaranteed to map to unique global resource
 
 

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

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -Zi -Od -T ps_6_0 %s | FileCheck %s
+// RUN: %dxc -E main -Od -T ps_6_0 %s | FileCheck %s
 
 
 // CHECK: local resource not guaranteed to map to unique global resource
 // CHECK: local resource not guaranteed to map to unique global resource
 
 

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

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -Zi -Od -T ps_6_0 %s | FileCheck %s
+// RUN: %dxc -E main -Od -T ps_6_0 %s | FileCheck %s
 
 
 // CHECK: local resource not guaranteed to map to unique global resource
 // CHECK: local resource not guaranteed to map to unique global resource
 
 

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

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T ps_6_0  -Zi -Od %s | FileCheck %s
+// RUN: %dxc -E main -T ps_6_0 -Od %s | FileCheck %s
 
 
 // CHECK: Offsets for Sample* must be immediated value
 // CHECK: Offsets for Sample* must be immediated value
 
 

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

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T ps_6_0  -Zi -Od %s | FileCheck %s
+// RUN: %dxc -E main -T ps_6_0 -Od %s | FileCheck %s
 
 
 // CHECK: Offsets for Sample* must be immediated value
 // CHECK: Offsets for Sample* must be immediated value
 
 

+ 4 - 4
tools/clang/test/CodeGenHLSL/val-wave-failures-ps.hlsl

@@ -1,8 +1,8 @@
-// RUN: %dxc -E main -T ps_6_0 %s /Zi | FileCheck %s
+// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
 
 
-// CHECK: val-wave-failures-ps.hlsl:10:9  Gradient operations are not affected by wave-sensitive data or control flow.
-// CHECK: val-wave-failures-ps.hlsl:30:12 Gradient operations are not affected by wave-sensitive data or control flow.
-// CHECK: val-wave-failures-ps.hlsl:40:12 Gradient operations are not affected by wave-sensitive data or control flow.
+// CHECK: Gradient operations are not affected by wave-sensitive data or control flow.
+// CHECK: Gradient operations are not affected by wave-sensitive data or control flow.
+// CHECK: Gradient operations are not affected by wave-sensitive data or control flow.
 
 
 float4 main(float4 p: SV_Position) : SV_Target {
 float4 main(float4 p: SV_Position) : SV_Target {
   // cannot feed into ddx
   // cannot feed into ddx

+ 1 - 1
tools/clang/test/CodeGenHLSL/validation/SimpleHs1.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T hs_6_0 -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T hs_6_0 %s | FileCheck %s
 
 
 // CHECK: SV_RenderTargetArrayIndex or SV_ViewportArrayIndex from any shader feeding rasterizer
 // CHECK: SV_RenderTargetArrayIndex or SV_ViewportArrayIndex from any shader feeding rasterizer
 // CHECK: InputControlPointCount=3
 // CHECK: InputControlPointCount=3

+ 1 - 1
tools/clang/test/CodeGenHLSL/validation/clip_planes.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T vs_6_0 -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T vs_6_0 %s | FileCheck %s
 
 
 // TODO: validate the debug info for clip plane.
 // TODO: validate the debug info for clip plane.
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/validation/eval.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -E main -T ps_6_0 -Od -Zi %s | FileCheck %s
+// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
 
 
 // CHECK: evalCentroid
 // CHECK: evalCentroid
 
 

+ 0 - 6
tools/clang/test/CodeGenHLSL/validation/resCopy.hlsl

@@ -1,9 +1,3 @@
-// RUN: %dxc -E main -Zi -Od -T cs_6_0 %s | FileCheck %s
-
-// Make sure createHandle has debug info.
-// CHECK: @dx.op.createHandle(i32 59, i8 1, i32 0, i32 0, i1 false), !dbg
-// CHECK: @dx.op.createHandle(i32 59, i8 1, i32 1, i32 1, i1 false), !dbg
-
 RWBuffer<uint> uav1;
 RWBuffer<uint> uav1;
 RWBuffer<uint> uav2;
 RWBuffer<uint> uav2;
 
 

+ 9 - 0
tools/clang/test/HLSL/mintypes-promotion-warnings.hlsl

@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -Wno-unused-value -fsyntax-only -ffreestanding -verify -verify-ignore-unexpected=note %s
+
+// Verify minfloat/minint promotion warnings for shader input/outputs
+
+void main(
+  min10float in_f10, // expected-warning {{min10float is promoted to min16float}}
+  min12int in_i12, // expected-warning {{min12int is promoted to min16int}} 
+  out min10float out_f10, // expected-warning {{min10float is promoted to min16float}}
+  out min12int out_i12) {} // expected-warning {{min12int is promoted to min16int}} 

+ 5 - 0
tools/clang/unittests/HLSL/VerifierTest.cpp

@@ -54,6 +54,7 @@ public:
   TEST_METHOD(RunMatrixAssignments)
   TEST_METHOD(RunMatrixAssignments)
   TEST_METHOD(RunMatrixSyntax)
   TEST_METHOD(RunMatrixSyntax)
   TEST_METHOD(RunMatrixSyntaxExactPrecision)
   TEST_METHOD(RunMatrixSyntaxExactPrecision)
+  TEST_METHOD(RunMintypesPromotionWarnings)
   TEST_METHOD(RunMoreOperators)
   TEST_METHOD(RunMoreOperators)
   TEST_METHOD(RunObjectOperators)
   TEST_METHOD(RunObjectOperators)
   TEST_METHOD(RunPackReg)
   TEST_METHOD(RunPackReg)
@@ -221,6 +222,10 @@ TEST_F(VerifierTest, RunMatrixSyntaxExactPrecision) {
   CheckVerifiesHLSL(L"matrix-syntax-exact-precision.hlsl");
   CheckVerifiesHLSL(L"matrix-syntax-exact-precision.hlsl");
 }
 }
 
 
+TEST_F(VerifierTest, RunMintypesPromotionWarnings) {
+  CheckVerifiesHLSL(L"mintypes-promotion-warnings.hlsl");
+}
+
 TEST_F(VerifierTest, RunMoreOperators) {
 TEST_F(VerifierTest, RunMoreOperators) {
   CheckVerifiesHLSL(L"more-operators.hlsl");
   CheckVerifiesHLSL(L"more-operators.hlsl");
 }
 }