@@ -620,6 +620,94 @@ TEST(ParseArchString, RejectsConflictingExtensions) {
620
620
EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
621
621
" 'zcf' is only supported for 'rv32'" );
622
622
}
623
+
624
+ for (StringRef Input : {" rv64i_xwchc" }) {
625
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
626
+ " 'Xwchc' is only supported for 'rv32'" );
627
+ }
628
+
629
+ for (StringRef Input : {" rv32id_xwchc" }) {
630
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
631
+ " 'D' and 'Xwchc' extensions are incompatible" );
632
+ }
633
+
634
+ for (StringRef Input : {" rv32i_zcb_xwchc" }) {
635
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
636
+ " 'Xwchc' and 'Zcb' extensions are incompatible" );
637
+ }
638
+ }
639
+
640
+ TEST (ParseArchString, MissingDepency) {
641
+ for (StringRef Input : {" rv32i_zvl32b" , " rv64i_zvl128b" }) {
642
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
643
+ " 'zvl*b' requires 'v' or 'zve*' extension to also be specified" );
644
+ }
645
+
646
+ for (StringRef Input : {" rv32i_zvbb" }) {
647
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
648
+ " 'zvbb' requires 'v' or 'zve*' extension to also be specified" );
649
+ }
650
+
651
+ for (StringRef Input : {" rv32i_zvbc32e0p7" }) {
652
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
653
+ " 'zvbc32e' requires 'v' or 'zve*' extension to also be specified" );
654
+ }
655
+
656
+ for (StringRef Input : {" rv32i_zvbc" }) {
657
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
658
+ " 'zvbc' requires 'v' or 'zve64*' extension to also be specified" );
659
+ }
660
+
661
+ for (StringRef Input : {" rv32i_zvkb" }) {
662
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
663
+ " 'zvk*' requires 'v' or 'zve*' extension to also be specified" );
664
+ }
665
+
666
+ for (StringRef Input : {" rv32i_zvkg" }) {
667
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
668
+ " 'zvk*' requires 'v' or 'zve*' extension to also be specified" );
669
+ }
670
+
671
+ for (StringRef Input : {" rv32i_zvkgs0p7" }) {
672
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
673
+ " 'zvk*' requires 'v' or 'zve*' extension to also be specified" );
674
+ }
675
+
676
+ for (StringRef Input : {" rv32i_zvkned" }) {
677
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
678
+ " 'zvk*' requires 'v' or 'zve*' extension to also be specified" );
679
+ }
680
+
681
+ for (StringRef Input : {" rv32i_zvknha" }) {
682
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
683
+ " 'zvk*' requires 'v' or 'zve*' extension to also be specified" );
684
+ }
685
+
686
+ for (StringRef Input : {" rv32i_zvksed" }) {
687
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
688
+ " 'zvk*' requires 'v' or 'zve*' extension to also be specified" );
689
+ }
690
+
691
+ for (StringRef Input : {" rv32i_zvksh" }) {
692
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
693
+ " 'zvk*' requires 'v' or 'zve*' extension to also be specified" );
694
+ }
695
+
696
+ for (StringRef Input : {" rv32i_zvknhb" }) {
697
+ EXPECT_EQ (
698
+ toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
699
+ " 'zvknhb' requires 'v' or 'zve64*' extension to also be specified" );
700
+ }
701
+
702
+ for (StringRef Input : {" rv32i_zacas1p0" }) {
703
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
704
+ " 'zacas' requires 'a' or 'zaamo' extension to also be specified" );
705
+ }
706
+
707
+ for (StringRef Input : {" rv32i_zabha" }) {
708
+ EXPECT_EQ (toString (RISCVISAInfo::parseArchString (Input, true ).takeError ()),
709
+ " 'zabha' requires 'a' or 'zaamo' extension to also be specified" );
710
+ }
623
711
}
624
712
625
713
TEST (ParseArchString, RejectsUnrecognizedProfileNames) {
0 commit comments