@@ -1515,9 +1515,12 @@ TEST_F(ValidateConversion, BitcastPtrWrongInputType) {
1515
1515
1516
1516
CompileSuccessfully (GenerateKernelCode (body).c_str ());
1517
1517
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" ));
1521
1524
}
1522
1525
1523
1526
TEST_F (ValidateConversion, BitcastPtrWrongInputTypeSPV1p5) {
@@ -1528,9 +1531,12 @@ TEST_F(ValidateConversion, BitcastPtrWrongInputTypeSPV1p5) {
1528
1531
CompileSuccessfully (GenerateKernelCode (body).c_str (), SPV_ENV_UNIVERSAL_1_5);
1529
1532
ASSERT_EQ (SPV_ERROR_INVALID_DATA,
1530
1533
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" ));
1534
1540
}
1535
1541
1536
1542
TEST_F (ValidateConversion, BitcastPtrWrongInputTypePhysicalStorageBufferKHR) {
@@ -1543,9 +1549,12 @@ TEST_F(ValidateConversion, BitcastPtrWrongInputTypePhysicalStorageBufferKHR) {
1543
1549
" \n OpExtension \" SPV_KHR_physical_storage_buffer\" " )
1544
1550
.c_str ());
1545
1551
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" ));
1549
1558
}
1550
1559
1551
1560
TEST_F (ValidateConversion, BitcastPtrWrongInputTypeIntVectorSPV1p5) {
@@ -1556,9 +1565,12 @@ TEST_F(ValidateConversion, BitcastPtrWrongInputTypeIntVectorSPV1p5) {
1556
1565
CompileSuccessfully (GenerateKernelCode (body).c_str (), SPV_ENV_UNIVERSAL_1_5);
1557
1566
ASSERT_EQ (SPV_ERROR_INVALID_DATA,
1558
1567
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" ));
1562
1574
}
1563
1575
1564
1576
TEST_F (ValidateConversion,
@@ -1572,9 +1584,12 @@ TEST_F(ValidateConversion,
1572
1584
" \n OpExtension \" SPV_KHR_physical_storage_buffer\" " )
1573
1585
.c_str ());
1574
1586
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" ));
1578
1593
}
1579
1594
1580
1595
TEST_F (ValidateConversion, BitcastPtrWrongResultType) {
@@ -1585,7 +1600,9 @@ TEST_F(ValidateConversion, BitcastPtrWrongResultType) {
1585
1600
CompileSuccessfully (GenerateKernelCode (body).c_str ());
1586
1601
ASSERT_EQ (SPV_ERROR_INVALID_DATA, ValidateInstructions ());
1587
1602
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 "
1589
1606
" int scalar: Bitcast" ));
1590
1607
}
1591
1608
@@ -1597,9 +1614,13 @@ TEST_F(ValidateConversion, BitcastPtrWrongResultTypeSPV1p5) {
1597
1614
CompileSuccessfully (GenerateKernelCode (body).c_str (), SPV_ENV_UNIVERSAL_1_5);
1598
1615
ASSERT_EQ (SPV_ERROR_INVALID_DATA,
1599
1616
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" ));
1603
1624
}
1604
1625
1605
1626
TEST_F (ValidateConversion, BitcastPtrWrongResultTypePhysicalStorageBufferKHR) {
@@ -1612,9 +1633,13 @@ TEST_F(ValidateConversion, BitcastPtrWrongResultTypePhysicalStorageBufferKHR) {
1612
1633
" \n OpExtension \" SPV_KHR_physical_storage_buffer\" " )
1613
1634
.c_str ());
1614
1635
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" ));
1618
1643
}
1619
1644
1620
1645
TEST_F (ValidateConversion, BitcastPtrWrongResultTypeIntVectorSPV1p5) {
@@ -1625,9 +1650,13 @@ TEST_F(ValidateConversion, BitcastPtrWrongResultTypeIntVectorSPV1p5) {
1625
1650
CompileSuccessfully (GenerateKernelCode (body).c_str (), SPV_ENV_UNIVERSAL_1_5);
1626
1651
ASSERT_EQ (SPV_ERROR_INVALID_DATA,
1627
1652
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" ));
1631
1660
}
1632
1661
1633
1662
TEST_F (ValidateConversion,
@@ -1641,9 +1670,13 @@ TEST_F(ValidateConversion,
1641
1670
" \n OpExtension \" SPV_KHR_physical_storage_buffer\" " )
1642
1671
.c_str ());
1643
1672
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" ));
1647
1680
}
1648
1681
1649
1682
TEST_F (ValidateConversion, BitcastDifferentTotalBitWidth) {
0 commit comments