File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
offload/unittests/Conformance/include/mathtest Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,19 @@ template <> class parser<TestConfigsArg> : public basic_parser<TestConfigsArg> {
6363 Val.Explicit .clear ();
6464
6565 for (StringRef Pair : Pairs) {
66- size_t Pos = Pair.find (' :' );
67- if (Pos == StringRef::npos)
66+ llvm::SmallVector<StringRef, 2 > Parts;
67+ Pair.split (Parts, ' :' );
68+
69+ if (Parts.size () != 2 )
6870 return O.error (" Expected '<provider>:<platform>', got '" + Pair + " '" );
6971
70- StringRef Provider = Pair.take_front (Pos);
71- StringRef Platform = Pair.drop_front (Pos + 1 );
72+ StringRef Provider = Parts[0 ].trim ();
73+ StringRef Platform = Parts[1 ].trim ();
74+
75+ if (Provider.empty () || Platform.empty ())
76+ return O.error (" Provider and platform must not be empty in '" + Pair +
77+ " '" );
78+
7279 mathtest::TestConfig Config = {Provider.str (), Platform.str ()};
7380 if (!isAllowed (Config))
7481 return O.error (" Invalid pair '" + Pair + " '" );
You can’t perform that action at this time.
0 commit comments