llvm.org GIT mirror llvm / 05af933
Revert r262092, caught LLD tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262093 91177308-0d34-0410-b5e6-96231b3b80d8 Paul Robinson 3 years ago
2 changed file(s) with 1 addition(s) and 46 deletion(s). Raw diff Collapse all Expand all
+0
-28
test/FileCheck/no-multi-suffixes.txt less more
None ; RUN: not FileCheck -check-prefix=DAGNOT -input-file %s %s 2>&1 | FileCheck -check-prefix=ERROR -check-prefix=DAGNOT-ERROR %s
1 ; RUN: not FileCheck -check-prefix=NOTDAG -input-file %s %s 2>&1 | FileCheck -check-prefix=ERROR -check-prefix=NOTDAG-ERROR %s
2 ; RUN: not FileCheck -check-prefix=NEXTNOT -input-file %s %s 2>&1 | FileCheck -check-prefix=ERROR -check-prefix=NEXTNOT-ERROR %s
3 ; RUN: not FileCheck -check-prefix=NOTNEXT -input-file %s %s 2>&1 | FileCheck -check-prefix=ERROR -check-prefix=NOTNEXT-ERROR %s
4 ; RUN: not FileCheck -check-prefix=SAMENOT -input-file %s %s 2>&1 | FileCheck -check-prefix=ERROR -check-prefix=SAMENOT-ERROR %s
5 ; RUN: not FileCheck -check-prefix=NOTSAME -input-file %s %s 2>&1 | FileCheck -check-prefix=ERROR -check-prefix=NOTSAME-ERROR %s
6
7 foo
8 ; DAGNOT: foo
9 ; DAGNOT-DAG-NOT: bar
10 ; NOTDAG: foo
11 ; NOTDAG-NOT-DAG: bar
12 ; NEXTNOT: foo
13 ; NEXTNOT-NEXT-NOT: bar
14 ; NOTNEXT: foo
15 ; NOTNEXT-NOT-NEXT: bar
16 ; SAMENOT: foo
17 ; SAMENOT-SAME-NOT: bar
18 ; NOTSAME: foo
19 ; NOTSAME-NOT-SAME: bar
20
21 ; ERROR: error: unsupported -NOT combo on prefix
22 ; DAGNOT-ERROR-SAME: 'DAGNOT'
23 ; NOTDAG-ERROR-SAME: 'NOTDAG'
24 ; NEXTNOT-ERROR-SAME: 'NEXTNOT'
25 ; NOTNEXT-ERROR-SAME: 'NOTNEXT'
26 ; SAMENOT-ERROR-SAME: 'SAMENOT'
27 ; NOTSAME-ERROR-SAME: 'NOTSAME'
8585
8686 /// MatchEOF - When set, this pattern only matches the end of file. This is
8787 /// used for trailing CHECK-NOTs.
88 CheckEOF,
89 /// CheckBadNot - Found -NOT combined with another CHECK suffix.
90 CheckBadNot
88 CheckEOF
9189 };
9290 }
9391
694692 static size_t CheckTypeSize(Check::CheckType Ty) {
695693 switch (Ty) {
696694 case Check::CheckNone:
697 case Check::CheckBadNot:
698695 return 0;
699696
700697 case Check::CheckPlain:
747744
748745 if (Rest.startswith("LABEL:"))
749746 return Check::CheckLabel;
750
751 // You can't combine -NOT with another suffix.
752 if (Rest.startswith("DAG-NOT:") || Rest.startswith("NOT-DAG:") ||
753 Rest.startswith("NEXT-NOT:") || Rest.startswith("NOT-NEXT:") ||
754 Rest.startswith("SAME-NOT:") || Rest.startswith("NOT-SAME:"))
755 return Check::CheckBadNot;
756747
757748 return Check::CheckNone;
758749 }
921912
922913 // PrefixLoc is to the start of the prefix. Skip to the end.
923914 Buffer = Buffer.drop_front(UsedPrefix.size() + CheckTypeSize(CheckTy));
924
925 // Complain about useful-looking but unsupported suffixes.
926 if (CheckTy == Check::CheckBadNot) {
927 SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()),
928 SourceMgr::DK_Error,
929 "unsupported -NOT combo on prefix '" + UsedPrefix + "'");
930 return true;
931 }
932915
933916 // Okay, we found the prefix, yay. Remember the rest of the line, but ignore
934917 // leading and trailing whitespace.