@@ -1515,9 +1515,12 @@ TEST_F(ValidateConversion, BitcastPtrWrongInputType) {
15151515
15161516 CompileSuccessfully (GenerateKernelCode (body).c_str ());
15171517 ASSERT_EQ (SPV_ERROR_INVALID_DATA, ValidateInstructions ());
1518- EXPECT_THAT (getDiagnosticString (),
1519- HasSubstr (" Expected input to be a pointer or int scalar if "
1520- " Result Type is pointer: Bitcast" ));
1518+ EXPECT_THAT (
1519+ getDiagnosticString (),
1520+ HasSubstr (" In SPIR-V 1.4 or earlier (and without "
1521+ " SPV_KHR_physical_storage_buffer), expected input to be a "
1522+ " pointer or int scalar if "
1523+ " Result Type is pointer: Bitcast" ));
15211524}
15221525
15231526TEST_F (ValidateConversion, BitcastPtrWrongInputTypeSPV1p5) {
@@ -1528,9 +1531,12 @@ TEST_F(ValidateConversion, BitcastPtrWrongInputTypeSPV1p5) {
15281531 CompileSuccessfully (GenerateKernelCode (body).c_str (), SPV_ENV_UNIVERSAL_1_5);
15291532 ASSERT_EQ (SPV_ERROR_INVALID_DATA,
15301533 ValidateInstructions (SPV_ENV_UNIVERSAL_1_5));
1531- EXPECT_THAT (getDiagnosticString (),
1532- HasSubstr (" Expected input to be a pointer, int scalar or 32-bit "
1533- " int vector if Result Type is pointer: Bitcast" ));
1534+ EXPECT_THAT (
1535+ getDiagnosticString (),
1536+ HasSubstr (" In SPIR-V 1.5 or later (or with "
1537+ " SPV_KHR_physical_storage_buffer), expected input to be a "
1538+ " pointer, int scalar or 32-bit "
1539+ " int vector if Result Type is pointer: Bitcast" ));
15341540}
15351541
15361542TEST_F (ValidateConversion, BitcastPtrWrongInputTypePhysicalStorageBufferKHR) {
@@ -1543,9 +1549,12 @@ TEST_F(ValidateConversion, BitcastPtrWrongInputTypePhysicalStorageBufferKHR) {
15431549 " \n OpExtension \" SPV_KHR_physical_storage_buffer\" " )
15441550 .c_str ());
15451551 ASSERT_EQ (SPV_ERROR_INVALID_DATA, ValidateInstructions ());
1546- EXPECT_THAT (getDiagnosticString (),
1547- HasSubstr (" Expected input to be a pointer, int scalar or 32-bit "
1548- " int vector if Result Type is pointer: Bitcast" ));
1552+ EXPECT_THAT (
1553+ getDiagnosticString (),
1554+ HasSubstr (" In SPIR-V 1.5 or later (or with "
1555+ " SPV_KHR_physical_storage_buffer), expected input to be a "
1556+ " pointer, int scalar or 32-bit "
1557+ " int vector if Result Type is pointer: Bitcast" ));
15491558}
15501559
15511560TEST_F (ValidateConversion, BitcastPtrWrongInputTypeIntVectorSPV1p5) {
@@ -1556,9 +1565,12 @@ TEST_F(ValidateConversion, BitcastPtrWrongInputTypeIntVectorSPV1p5) {
15561565 CompileSuccessfully (GenerateKernelCode (body).c_str (), SPV_ENV_UNIVERSAL_1_5);
15571566 ASSERT_EQ (SPV_ERROR_INVALID_DATA,
15581567 ValidateInstructions (SPV_ENV_UNIVERSAL_1_5));
1559- EXPECT_THAT (getDiagnosticString (),
1560- HasSubstr (" Expected input to be a pointer, int scalar or 32-bit "
1561- " int vector if Result Type is pointer: Bitcast" ));
1568+ EXPECT_THAT (
1569+ getDiagnosticString (),
1570+ HasSubstr (" In SPIR-V 1.5 or later (or with "
1571+ " SPV_KHR_physical_storage_buffer), expected input to be a "
1572+ " pointer, int scalar or 32-bit "
1573+ " int vector if Result Type is pointer: Bitcast" ));
15621574}
15631575
15641576TEST_F (ValidateConversion,
@@ -1572,9 +1584,12 @@ TEST_F(ValidateConversion,
15721584 " \n OpExtension \" SPV_KHR_physical_storage_buffer\" " )
15731585 .c_str ());
15741586 ASSERT_EQ (SPV_ERROR_INVALID_DATA, ValidateInstructions ());
1575- EXPECT_THAT (getDiagnosticString (),
1576- HasSubstr (" Expected input to be a pointer, int scalar or 32-bit "
1577- " int vector if Result Type is pointer: Bitcast" ));
1587+ EXPECT_THAT (
1588+ getDiagnosticString (),
1589+ HasSubstr (" In SPIR-V 1.5 or later (or with "
1590+ " SPV_KHR_physical_storage_buffer), expected input to be a "
1591+ " pointer, int scalar or 32-bit "
1592+ " int vector if Result Type is pointer: Bitcast" ));
15781593}
15791594
15801595TEST_F (ValidateConversion, BitcastPtrWrongResultType) {
@@ -1585,7 +1600,9 @@ TEST_F(ValidateConversion, BitcastPtrWrongResultType) {
15851600 CompileSuccessfully (GenerateKernelCode (body).c_str ());
15861601 ASSERT_EQ (SPV_ERROR_INVALID_DATA, ValidateInstructions ());
15871602 EXPECT_THAT (getDiagnosticString (),
1588- HasSubstr (" Pointer can only be converted to another pointer or "
1603+ HasSubstr (" In SPIR-V 1.4 or earlier (and without "
1604+ " SPV_KHR_physical_storage_buffer), pointer can only be "
1605+ " converted to another pointer or "
15891606 " int scalar: Bitcast" ));
15901607}
15911608
@@ -1597,9 +1614,13 @@ TEST_F(ValidateConversion, BitcastPtrWrongResultTypeSPV1p5) {
15971614 CompileSuccessfully (GenerateKernelCode (body).c_str (), SPV_ENV_UNIVERSAL_1_5);
15981615 ASSERT_EQ (SPV_ERROR_INVALID_DATA,
15991616 ValidateInstructions (SPV_ENV_UNIVERSAL_1_5));
1600- EXPECT_THAT (getDiagnosticString (),
1601- HasSubstr (" Pointer can only be converted to another pointer, int "
1602- " scalar or 32-bit int vector: Bitcast" ));
1617+ EXPECT_THAT (
1618+ getDiagnosticString (),
1619+ HasSubstr (
1620+ " In SPIR-V 1.5 or later (or with SPV_KHR_physical_storage_buffer), "
1621+ " pointer can only be converted "
1622+ " to another pointer, int "
1623+ " scalar or 32-bit int vector: Bitcast" ));
16031624}
16041625
16051626TEST_F (ValidateConversion, BitcastPtrWrongResultTypePhysicalStorageBufferKHR) {
@@ -1612,9 +1633,13 @@ TEST_F(ValidateConversion, BitcastPtrWrongResultTypePhysicalStorageBufferKHR) {
16121633 " \n OpExtension \" SPV_KHR_physical_storage_buffer\" " )
16131634 .c_str ());
16141635 ASSERT_EQ (SPV_ERROR_INVALID_DATA, ValidateInstructions ());
1615- EXPECT_THAT (getDiagnosticString (),
1616- HasSubstr (" Pointer can only be converted to another pointer, int "
1617- " scalar or 32-bit int vector: Bitcast" ));
1636+ EXPECT_THAT (
1637+ getDiagnosticString (),
1638+ HasSubstr (
1639+ " In SPIR-V 1.5 or later (or with SPV_KHR_physical_storage_buffer), "
1640+ " pointer can only be converted "
1641+ " to another pointer, int "
1642+ " scalar or 32-bit int vector: Bitcast" ));
16181643}
16191644
16201645TEST_F (ValidateConversion, BitcastPtrWrongResultTypeIntVectorSPV1p5) {
@@ -1625,9 +1650,13 @@ TEST_F(ValidateConversion, BitcastPtrWrongResultTypeIntVectorSPV1p5) {
16251650 CompileSuccessfully (GenerateKernelCode (body).c_str (), SPV_ENV_UNIVERSAL_1_5);
16261651 ASSERT_EQ (SPV_ERROR_INVALID_DATA,
16271652 ValidateInstructions (SPV_ENV_UNIVERSAL_1_5));
1628- EXPECT_THAT (getDiagnosticString (),
1629- HasSubstr (" Pointer can only be converted to another pointer, int "
1630- " scalar or 32-bit int vector: Bitcast" ));
1653+ EXPECT_THAT (
1654+ getDiagnosticString (),
1655+ HasSubstr (
1656+ " In SPIR-V 1.5 or later (or with SPV_KHR_physical_storage_buffer), "
1657+ " pointer can only be converted "
1658+ " to another pointer, int "
1659+ " scalar or 32-bit int vector: Bitcast" ));
16311660}
16321661
16331662TEST_F (ValidateConversion,
@@ -1641,9 +1670,13 @@ TEST_F(ValidateConversion,
16411670 " \n OpExtension \" SPV_KHR_physical_storage_buffer\" " )
16421671 .c_str ());
16431672 ASSERT_EQ (SPV_ERROR_INVALID_DATA, ValidateInstructions ());
1644- EXPECT_THAT (getDiagnosticString (),
1645- HasSubstr (" Pointer can only be converted to another pointer, int "
1646- " scalar or 32-bit int vector: Bitcast" ));
1673+ EXPECT_THAT (
1674+ getDiagnosticString (),
1675+ HasSubstr (
1676+ " In SPIR-V 1.5 or later (or with SPV_KHR_physical_storage_buffer), "
1677+ " pointer can only be converted "
1678+ " to another pointer, int "
1679+ " scalar or 32-bit int vector: Bitcast" ));
16471680}
16481681
16491682TEST_F (ValidateConversion, BitcastDifferentTotalBitWidth) {
0 commit comments