From dac585ffb19ffaaa52718f33e3c2600d97d89c2b Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 16 Oct 2017 10:48:01 -0400 Subject: [PATCH] [spirv] Refactoring: renaming test files to keep consistency (#710) --- ...ak-stmt.mixed.hlsl => cf.break.mixed.hlsl} | 0 .../{do-stmt.break.hlsl => cf.do.break.hlsl} | 0 ...stmt.continue.hlsl => cf.do.continue.hlsl} | 0 ...{do-stmt.nested.hlsl => cf.do.nested.hlsl} | 0 .../{do-stmt.plain.hlsl => cf.do.plain.hlsl} | 0 ...{for-stmt.break.hlsl => cf.for.break.hlsl} | 0 ...tmt.continue.hlsl => cf.for.continue.hlsl} | 0 ...or-stmt.nested.hlsl => cf.for.nested.hlsl} | 0 ...{for-stmt.plain.hlsl => cf.for.plain.hlsl} | 0 ....const-cond.hlsl => cf.if.const-cond.hlsl} | 0 ...{if-stmt.nested.hlsl => cf.if.nested.hlsl} | 0 .../{if-stmt.plain.hlsl => cf.if.plain.hlsl} | 0 ...stmt.ifstmt.hlsl => cf.switch.ifstmt.hlsl} | 0 ....opswitch.hlsl => cf.switch.opswitch.hlsl} | 0 ...le-stmt.break.hlsl => cf.while.break.hlsl} | 0 ...t.continue.hlsl => cf.while.continue.hlsl} | 0 ...-stmt.nested.hlsl => cf.while.nested.hlsl} | 0 ...le-stmt.plain.hlsl => cf.while.plain.hlsl} | 0 ...hlsl => method.buffer.get-dimensions.hlsl} | 0 ...ffer.load.hlsl => method.buffer.load.hlsl} | 0 ...l => method.rwtexture.get-dimensions.hlsl} | 0 ...e.load.hlsl => method.rwtexture.load.hlsl} | 0 ...fer.write.hlsl => op.rwbuffer.access.hlsl} | 0 ...ess.hlsl => op.rwtexture.access.read.hlsl} | 0 ...te.hlsl => op.rwtexture.access.write.hlsl} | 0 .../unittests/SPIRV/CodeGenSPIRVTest.cpp | 63 ++++++++++--------- 26 files changed, 32 insertions(+), 31 deletions(-) rename tools/clang/test/CodeGenSPIRV/{break-stmt.mixed.hlsl => cf.break.mixed.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{do-stmt.break.hlsl => cf.do.break.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{do-stmt.continue.hlsl => cf.do.continue.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{do-stmt.nested.hlsl => cf.do.nested.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{do-stmt.plain.hlsl => cf.do.plain.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{for-stmt.break.hlsl => cf.for.break.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{for-stmt.continue.hlsl => cf.for.continue.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{for-stmt.nested.hlsl => cf.for.nested.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{for-stmt.plain.hlsl => cf.for.plain.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{if-stmt.const-cond.hlsl => cf.if.const-cond.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{if-stmt.nested.hlsl => cf.if.nested.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{if-stmt.plain.hlsl => cf.if.plain.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{switch-stmt.ifstmt.hlsl => cf.switch.ifstmt.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{switch-stmt.opswitch.hlsl => cf.switch.opswitch.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{while-stmt.break.hlsl => cf.while.break.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{while-stmt.continue.hlsl => cf.while.continue.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{while-stmt.nested.hlsl => cf.while.nested.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{while-stmt.plain.hlsl => cf.while.plain.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{buffer.get-dimensions.hlsl => method.buffer.get-dimensions.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{buffer.load.hlsl => method.buffer.load.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{rwtexture.get-dimensions.hlsl => method.rwtexture.get-dimensions.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{rwtexture.load.hlsl => method.rwtexture.load.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{buffer.write.hlsl => op.rwbuffer.access.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{op.rwtexture.access.hlsl => op.rwtexture.access.read.hlsl} (100%) rename tools/clang/test/CodeGenSPIRV/{rwtexture.write.hlsl => op.rwtexture.access.write.hlsl} (100%) diff --git a/tools/clang/test/CodeGenSPIRV/break-stmt.mixed.hlsl b/tools/clang/test/CodeGenSPIRV/cf.break.mixed.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/break-stmt.mixed.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.break.mixed.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/do-stmt.break.hlsl b/tools/clang/test/CodeGenSPIRV/cf.do.break.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/do-stmt.break.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.do.break.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/do-stmt.continue.hlsl b/tools/clang/test/CodeGenSPIRV/cf.do.continue.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/do-stmt.continue.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.do.continue.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/do-stmt.nested.hlsl b/tools/clang/test/CodeGenSPIRV/cf.do.nested.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/do-stmt.nested.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.do.nested.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/do-stmt.plain.hlsl b/tools/clang/test/CodeGenSPIRV/cf.do.plain.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/do-stmt.plain.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.do.plain.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/for-stmt.break.hlsl b/tools/clang/test/CodeGenSPIRV/cf.for.break.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/for-stmt.break.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.for.break.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/for-stmt.continue.hlsl b/tools/clang/test/CodeGenSPIRV/cf.for.continue.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/for-stmt.continue.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.for.continue.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/for-stmt.nested.hlsl b/tools/clang/test/CodeGenSPIRV/cf.for.nested.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/for-stmt.nested.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.for.nested.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/for-stmt.plain.hlsl b/tools/clang/test/CodeGenSPIRV/cf.for.plain.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/for-stmt.plain.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.for.plain.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/if-stmt.const-cond.hlsl b/tools/clang/test/CodeGenSPIRV/cf.if.const-cond.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/if-stmt.const-cond.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.if.const-cond.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/if-stmt.nested.hlsl b/tools/clang/test/CodeGenSPIRV/cf.if.nested.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/if-stmt.nested.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.if.nested.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/if-stmt.plain.hlsl b/tools/clang/test/CodeGenSPIRV/cf.if.plain.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/if-stmt.plain.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.if.plain.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/switch-stmt.ifstmt.hlsl b/tools/clang/test/CodeGenSPIRV/cf.switch.ifstmt.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/switch-stmt.ifstmt.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.switch.ifstmt.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/switch-stmt.opswitch.hlsl b/tools/clang/test/CodeGenSPIRV/cf.switch.opswitch.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/switch-stmt.opswitch.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.switch.opswitch.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/while-stmt.break.hlsl b/tools/clang/test/CodeGenSPIRV/cf.while.break.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/while-stmt.break.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.while.break.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/while-stmt.continue.hlsl b/tools/clang/test/CodeGenSPIRV/cf.while.continue.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/while-stmt.continue.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.while.continue.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/while-stmt.nested.hlsl b/tools/clang/test/CodeGenSPIRV/cf.while.nested.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/while-stmt.nested.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.while.nested.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/while-stmt.plain.hlsl b/tools/clang/test/CodeGenSPIRV/cf.while.plain.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/while-stmt.plain.hlsl rename to tools/clang/test/CodeGenSPIRV/cf.while.plain.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/buffer.get-dimensions.hlsl b/tools/clang/test/CodeGenSPIRV/method.buffer.get-dimensions.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/buffer.get-dimensions.hlsl rename to tools/clang/test/CodeGenSPIRV/method.buffer.get-dimensions.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/buffer.load.hlsl b/tools/clang/test/CodeGenSPIRV/method.buffer.load.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/buffer.load.hlsl rename to tools/clang/test/CodeGenSPIRV/method.buffer.load.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/rwtexture.get-dimensions.hlsl b/tools/clang/test/CodeGenSPIRV/method.rwtexture.get-dimensions.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/rwtexture.get-dimensions.hlsl rename to tools/clang/test/CodeGenSPIRV/method.rwtexture.get-dimensions.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/rwtexture.load.hlsl b/tools/clang/test/CodeGenSPIRV/method.rwtexture.load.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/rwtexture.load.hlsl rename to tools/clang/test/CodeGenSPIRV/method.rwtexture.load.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/buffer.write.hlsl b/tools/clang/test/CodeGenSPIRV/op.rwbuffer.access.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/buffer.write.hlsl rename to tools/clang/test/CodeGenSPIRV/op.rwbuffer.access.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/op.rwtexture.access.hlsl b/tools/clang/test/CodeGenSPIRV/op.rwtexture.access.read.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/op.rwtexture.access.hlsl rename to tools/clang/test/CodeGenSPIRV/op.rwtexture.access.read.hlsl diff --git a/tools/clang/test/CodeGenSPIRV/rwtexture.write.hlsl b/tools/clang/test/CodeGenSPIRV/op.rwtexture.access.write.hlsl similarity index 100% rename from tools/clang/test/CodeGenSPIRV/rwtexture.write.hlsl rename to tools/clang/test/CodeGenSPIRV/op.rwtexture.access.write.hlsl diff --git a/tools/clang/unittests/SPIRV/CodeGenSPIRVTest.cpp b/tools/clang/unittests/SPIRV/CodeGenSPIRVTest.cpp index 1b6314288..f40ed2d19 100644 --- a/tools/clang/unittests/SPIRV/CodeGenSPIRVTest.cpp +++ b/tools/clang/unittests/SPIRV/CodeGenSPIRVTest.cpp @@ -196,7 +196,7 @@ TEST_F(FileTest, TernaryOpConditionalOp) { // For vector accessing/swizzling operators TEST_F(FileTest, OpVectorSwizzle) { runFileTest("op.vector.swizzle.hlsl"); } -TEST_F(FileTest, OpVectorSize1Swizzle) { +TEST_F(FileTest, OpVectorSwizzle1) { runFileTest("op.vector.swizzle.size1.hlsl"); } TEST_F(FileTest, OpVectorAccess) { runFileTest("op.vector.access.hlsl"); } @@ -221,6 +221,7 @@ TEST_F(FileTest, OpArrayAccess) { runFileTest("op.array.access.hlsl"); } // For buffer accessing operator TEST_F(FileTest, OpBufferAccess) { runFileTest("op.buffer.access.hlsl"); } +TEST_F(FileTest, OpRWBufferAccess) { runFileTest("op.rwbuffer.access.hlsl"); } TEST_F(FileTest, OpCBufferAccess) { runFileTest("op.cbuffer.access.hlsl"); } TEST_F(FileTest, OpConstantBufferAccess) { runFileTest("op.constant-buffer.access.hlsl"); @@ -234,7 +235,12 @@ TEST_F(FileTest, OpRWStructuredBufferAccess) { // For Texture/RWTexture accessing operator (operator[]) TEST_F(FileTest, OpTextureAccess) { runFileTest("op.texture.access.hlsl"); } -TEST_F(FileTest, OpRWTextureAccess) { runFileTest("op.rwtexture.access.hlsl"); } +TEST_F(FileTest, OpRWTextureAccessRead) { + runFileTest("op.rwtexture.access.read.hlsl"); +} +TEST_F(FileTest, OpRWTextureAccessWrite) { + runFileTest("op.rwtexture.access.write.hlsl"); +} // For Texture.mips[][] operator TEST_F(FileTest, OpTextureMipsAccess) { @@ -262,51 +268,47 @@ TEST_F(FileTest, CastSplatVector) { runFileTest("cast.vector.splat.hlsl"); } TEST_F(FileTest, CastSplatMatrix) { runFileTest("cast.matrix.splat.hlsl"); } // For if statements -TEST_F(FileTest, IfStmtPlainAssign) { runFileTest("if-stmt.plain.hlsl"); } -TEST_F(FileTest, IfStmtNestedIfStmt) { runFileTest("if-stmt.nested.hlsl"); } -TEST_F(FileTest, IfStmtConstCondition) { - runFileTest("if-stmt.const-cond.hlsl"); -} +TEST_F(FileTest, IfStmtPlainAssign) { runFileTest("cf.if.plain.hlsl"); } +TEST_F(FileTest, IfStmtNestedIfStmt) { runFileTest("cf.if.nested.hlsl"); } +TEST_F(FileTest, IfStmtConstCondition) { runFileTest("cf.if.const-cond.hlsl"); } // For switch statements TEST_F(FileTest, SwitchStmtUsingOpSwitch) { - runFileTest("switch-stmt.opswitch.hlsl"); + runFileTest("cf.switch.opswitch.hlsl"); } TEST_F(FileTest, SwitchStmtUsingIfStmt) { - runFileTest("switch-stmt.ifstmt.hlsl"); + runFileTest("cf.switch.ifstmt.hlsl"); } // For for statements -TEST_F(FileTest, ForStmtPlainAssign) { runFileTest("for-stmt.plain.hlsl"); } -TEST_F(FileTest, ForStmtNestedForStmt) { runFileTest("for-stmt.nested.hlsl"); } -TEST_F(FileTest, ForStmtContinue) { runFileTest("for-stmt.continue.hlsl"); } -TEST_F(FileTest, ForStmtBreak) { runFileTest("for-stmt.break.hlsl"); } +TEST_F(FileTest, ForStmtPlainAssign) { runFileTest("cf.for.plain.hlsl"); } +TEST_F(FileTest, ForStmtNestedForStmt) { runFileTest("cf.for.nested.hlsl"); } +TEST_F(FileTest, ForStmtContinue) { runFileTest("cf.for.continue.hlsl"); } +TEST_F(FileTest, ForStmtBreak) { runFileTest("cf.for.break.hlsl"); } // For while statements -TEST_F(FileTest, WhileStmtPlain) { runFileTest("while-stmt.plain.hlsl"); } -TEST_F(FileTest, WhileStmtNested) { runFileTest("while-stmt.nested.hlsl"); } -TEST_F(FileTest, WhileStmtContinue) { runFileTest("while-stmt.continue.hlsl"); } -TEST_F(FileTest, WhileStmtBreak) { runFileTest("while-stmt.break.hlsl"); } +TEST_F(FileTest, WhileStmtPlain) { runFileTest("cf.while.plain.hlsl"); } +TEST_F(FileTest, WhileStmtNested) { runFileTest("cf.while.nested.hlsl"); } +TEST_F(FileTest, WhileStmtContinue) { runFileTest("cf.while.continue.hlsl"); } +TEST_F(FileTest, WhileStmtBreak) { runFileTest("cf.while.break.hlsl"); } // For do statements -TEST_F(FileTest, DoStmtPlain) { runFileTest("do-stmt.plain.hlsl"); } -TEST_F(FileTest, DoStmtNested) { runFileTest("do-stmt.nested.hlsl"); } -TEST_F(FileTest, DoStmtContinue) { runFileTest("do-stmt.continue.hlsl"); } -TEST_F(FileTest, DoStmtBreak) { runFileTest("do-stmt.break.hlsl"); } +TEST_F(FileTest, DoStmtPlain) { runFileTest("cf.do.plain.hlsl"); } +TEST_F(FileTest, DoStmtNested) { runFileTest("cf.do.nested.hlsl"); } +TEST_F(FileTest, DoStmtContinue) { runFileTest("cf.do.continue.hlsl"); } +TEST_F(FileTest, DoStmtBreak) { runFileTest("cf.do.break.hlsl"); } // For break statements (mix of breaks in loops and switch) -TEST_F(FileTest, BreakStmtMixed) { runFileTest("break-stmt.mixed.hlsl"); } +TEST_F(FileTest, BreakStmtMixed) { runFileTest("cf.break.mixed.hlsl"); } // For discard statement TEST_F(FileTest, Discard) { runFileTest("cf.discard.hlsl"); } -// For early returns +// For return statement TEST_F(FileTest, EarlyReturn) { runFileTest("cf.return.early.hlsl"); } TEST_F(FileTest, EarlyReturnFloat4) { runFileTest("cf.return.early.float4.hlsl"); } - -// For returning a structure TEST_F(FileTest, ReturnStruct) { runFileTest("cf.return.struct.hlsl"); } // For control flows @@ -449,6 +451,7 @@ TEST_F(FileTest, TextureArraySampleCmpLevelZero) { runFileTest("texture.array.sample-cmp-level-zero.hlsl"); } +// For structured buffer methods TEST_F(FileTest, StructuredBufferLoad) { runFileTest("method.structured-buffer.load.hlsl"); } @@ -483,17 +486,15 @@ TEST_F(FileTest, RWByteAddressBufferAtomicMethods) { } // For Buffer/RWBuffer methods -TEST_F(FileTest, BufferLoad) { runFileTest("buffer.load.hlsl"); } -TEST_F(FileTest, BufferWrite) { runFileTest("buffer.write.hlsl"); } +TEST_F(FileTest, BufferLoad) { runFileTest("method.buffer.load.hlsl"); } TEST_F(FileTest, BufferGetDimensions) { - runFileTest("buffer.get-dimensions.hlsl"); + runFileTest("method.buffer.get-dimensions.hlsl"); } // For RWTexture methods -TEST_F(FileTest, RWTextureLoad) { runFileTest("rwtexture.load.hlsl"); } -TEST_F(FileTest, RWTextureWrite) { runFileTest("rwtexture.write.hlsl"); } +TEST_F(FileTest, RWTextureLoad) { runFileTest("method.rwtexture.load.hlsl"); } TEST_F(FileTest, RWTextureGetDimensions) { - runFileTest("rwtexture.get-dimensions.hlsl"); + runFileTest("method.rwtexture.get-dimensions.hlsl"); } // For intrinsic functions