[compiler-rt] 238bbd4 - Revert abd45154b "[Coverage] Add comment to skipped regions"
Hans Wennborg via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 22 08:09:39 PDT 2020
Author: Hans Wennborg
Date: 2020-07-22T17:09:20+02:00
New Revision: 238bbd48c5a5f84deca36e5df980241578f7c1df
URL: https://github.com/llvm/llvm-project/commit/238bbd48c5a5f84deca36e5df980241578f7c1df
DIFF: https://github.com/llvm/llvm-project/commit/238bbd48c5a5f84deca36e5df980241578f7c1df.diff
LOG: Revert abd45154b "[Coverage] Add comment to skipped regions"
This casued assertions during Chromium builds. See comment on the code review
> Bug filled here: https://bugs.llvm.org/show_bug.cgi?id=45757.
> Add comment to skipped regions so we don't track execution count for lines containing only comments.
>
> Differential Revision: https://reviews.llvm.org/D84208
This reverts commit abd45154bdb6b76c5b480455eacc8c75b08242aa and the
follow-up 87d725473380652bbe845fd2fbd9c0507a55172f.
Added:
Modified:
clang/include/clang/Lex/Preprocessor.h
clang/lib/CodeGen/CodeGenAction.cpp
clang/lib/CodeGen/CoverageMappingGen.cpp
clang/lib/CodeGen/CoverageMappingGen.h
clang/lib/Lex/Preprocessor.cpp
clang/test/CoverageMapping/break.c
clang/test/CoverageMapping/builtinmacro.c
clang/test/CoverageMapping/classtemplate.cpp
clang/test/CoverageMapping/comment-in-macro.c
clang/test/CoverageMapping/continue.c
clang/test/CoverageMapping/coroutine.cpp
clang/test/CoverageMapping/deferred-region.cpp
clang/test/CoverageMapping/if.cpp
clang/test/CoverageMapping/includehell.cpp
clang/test/CoverageMapping/label.cpp
clang/test/CoverageMapping/logical.cpp
clang/test/CoverageMapping/loops.cpp
clang/test/CoverageMapping/macro-expressions.cpp
clang/test/CoverageMapping/macroparams2.c
clang/test/CoverageMapping/macros.c
clang/test/CoverageMapping/macroscopes.cpp
clang/test/CoverageMapping/moremacros.c
clang/test/CoverageMapping/objc.m
clang/test/CoverageMapping/pr32679.cpp
clang/test/CoverageMapping/preprocessor.c
clang/test/CoverageMapping/return.c
clang/test/CoverageMapping/switch.cpp
clang/test/CoverageMapping/switchmacro.c
clang/test/CoverageMapping/test.c
clang/test/CoverageMapping/trycatch.cpp
clang/test/CoverageMapping/unreachable-macro.c
clang/test/CoverageMapping/while.c
clang/test/lit.cfg.py
compiler-rt/test/profile/Inputs/instrprof-comdat.h
compiler-rt/test/profile/instrprof-set-file-object-merging.c
Removed:
compiler-rt/test/profile/coverage_comments.cpp
################################################################################
diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h
index b0dd363555ab..5cd017fa925f 100644
--- a/clang/include/clang/Lex/Preprocessor.h
+++ b/clang/include/clang/Lex/Preprocessor.h
@@ -419,9 +419,6 @@ class Preprocessor {
/// The number of (LexLevel 0) preprocessor tokens.
unsigned TokenCount = 0;
- /// Preprocess every token regardless of LexLevel.
- bool PreprocessToken = false;
-
/// The maximum number of (LexLevel 0) tokens before issuing a -Wmax-tokens
/// warning, or zero for unlimited.
unsigned MaxTokens = 0;
@@ -1041,8 +1038,6 @@ class Preprocessor {
OnToken = std::move(F);
}
- void setPreprocessToken(bool Preprocess) { PreprocessToken = Preprocess; }
-
bool isMacroDefined(StringRef Id) {
return isMacroDefined(&Identifiers.get(Id));
}
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 5a6ce0f5dbd5..55925110708e 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -990,9 +990,11 @@ CodeGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
CoverageSourceInfo *CoverageInfo = nullptr;
// Add the preprocessor callback only when the coverage mapping is generated.
- if (CI.getCodeGenOpts().CoverageMapping)
- CoverageInfo = CodeGen::CoverageMappingModuleGen::setUpCoverageCallbacks(
- CI.getPreprocessor());
+ if (CI.getCodeGenOpts().CoverageMapping) {
+ CoverageInfo = new CoverageSourceInfo;
+ CI.getPreprocessor().addPPCallbacks(
+ std::unique_ptr<PPCallbacks>(CoverageInfo));
+ }
std::unique_ptr<BackendConsumer> Result(new BackendConsumer(
BA, CI.getDiagnostics(), CI.getHeaderSearchOpts(),
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp
index 6729c7f381f5..78b268f423cb 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -35,40 +35,8 @@ using namespace clang;
using namespace CodeGen;
using namespace llvm::coverage;
-CoverageSourceInfo *
-CoverageMappingModuleGen::setUpCoverageCallbacks(Preprocessor &PP) {
- CoverageSourceInfo *CoverageInfo = new CoverageSourceInfo;
- PP.addPPCallbacks(std::unique_ptr<PPCallbacks>(CoverageInfo));
- PP.addCommentHandler(CoverageInfo);
- PP.setPreprocessToken(true);
- PP.setTokenWatcher([CoverageInfo](clang::Token Tok) {
- // Update previous token location.
- CoverageInfo->PrevTokLoc = Tok.getLocation();
- CoverageInfo->updateNextTokLoc(Tok.getLocation());
- });
- return CoverageInfo;
-}
-
void CoverageSourceInfo::SourceRangeSkipped(SourceRange Range, SourceLocation) {
- SkippedRanges.push_back({Range});
-}
-
-bool CoverageSourceInfo::HandleComment(Preprocessor &PP, SourceRange Range) {
- if (PrevTokLoc.isValid() && PrevTokLoc == BeforeCommentLoc)
- SkippedRanges.back().Range.setEnd(Range.getEnd());
- else {
- SkippedRanges.push_back({Range, PrevTokLoc});
- BeforeCommentLoc = PrevTokLoc;
- }
- LastCommentIndex = SkippedRanges.size() - 1;
- return false;
-}
-
-void CoverageSourceInfo::updateNextTokLoc(SourceLocation Loc) {
- if (LastCommentIndex) {
- SkippedRanges[LastCommentIndex.getValue()].NextTokLoc = Loc;
- LastCommentIndex = None;
- }
+ SkippedRanges.push_back(Range);
}
namespace {
@@ -306,34 +274,8 @@ class CoverageMappingBuilder {
return None;
}
- /// This shrinks the skipped range if it spans a line that contains a
- /// non-comment token. If shrinking the skipped range would make it empty,
- /// this returns None.
- Optional<SpellingRegion> adjustSkippedRange(SourceManager &SM,
- SpellingRegion SR,
- SourceLocation PrevTokLoc,
- SourceLocation NextTokLoc) {
- // If Range begin location is invalid, it's not a comment region.
- if (PrevTokLoc.isInvalid())
- return SR;
- unsigned PrevTokLine = SM.getSpellingLineNumber(PrevTokLoc);
- unsigned NextTokLine = SM.getSpellingLineNumber(NextTokLoc);
- SpellingRegion newSR(SR);
- if (SR.LineStart == PrevTokLine) {
- newSR.LineStart = SR.LineStart + 1;
- newSR.ColumnStart = 1;
- }
- if (SR.LineEnd == NextTokLine) {
- newSR.LineEnd = SR.LineEnd - 1;
- newSR.ColumnEnd = 1;
- }
- if (newSR.isInSourceOrder())
- return newSR;
- return None;
- }
-
/// Gather all the regions that were skipped by the preprocessor
- /// using the constructs like #if or comments.
+ /// using the constructs like #if.
void gatherSkippedRegions() {
/// An array of the minimum lineStarts and the maximum lineEnds
/// for mapping regions from the appropriate source files.
@@ -349,10 +291,9 @@ class CoverageMappingBuilder {
}
auto SkippedRanges = CVM.getSourceInfo().getSkippedRanges();
- for (auto &I : SkippedRanges) {
- SourceRange Range = I.Range;
- auto LocStart = Range.getBegin();
- auto LocEnd = Range.getEnd();
+ for (const auto &I : SkippedRanges) {
+ auto LocStart = I.getBegin();
+ auto LocEnd = I.getEnd();
assert(SM.isWrittenInSameFile(LocStart, LocEnd) &&
"region spans multiple files");
@@ -360,11 +301,6 @@ class CoverageMappingBuilder {
if (!CovFileID)
continue;
SpellingRegion SR{SM, LocStart, LocEnd};
- if (Optional<SpellingRegion> res =
- adjustSkippedRange(SM, SR, I.PrevTokLoc, I.NextTokLoc))
- SR = res.getValue();
- else
- continue;
auto Region = CounterMappingRegion::makeSkipped(
*CovFileID, SR.LineStart, SR.ColumnStart, SR.LineEnd, SR.ColumnEnd);
// Make sure that we only collect the regions that are inside
diff --git a/clang/lib/CodeGen/CoverageMappingGen.h b/clang/lib/CodeGen/CoverageMappingGen.h
index be94c30b4f31..5d79d1e65670 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.h
+++ b/clang/lib/CodeGen/CoverageMappingGen.h
@@ -16,7 +16,6 @@
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Lex/PPCallbacks.h"
-#include "clang/Lex/Preprocessor.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/Support/raw_ostream.h"
@@ -30,42 +29,15 @@ class Preprocessor;
class Decl;
class Stmt;
-struct SkippedRange {
- SourceRange Range;
- // The location of token before the skipped source range.
- SourceLocation PrevTokLoc;
- // The location of token after the skipped source range.
- SourceLocation NextTokLoc;
-
- SkippedRange(SourceRange Range, SourceLocation PrevTokLoc = SourceLocation(),
- SourceLocation NextTokLoc = SourceLocation())
- : Range(Range), PrevTokLoc(PrevTokLoc), NextTokLoc(NextTokLoc) {}
-};
-
/// Stores additional source code information like skipped ranges which
/// is required by the coverage mapping generator and is obtained from
/// the preprocessor.
-class CoverageSourceInfo : public PPCallbacks, public CommentHandler {
- // A vector of skipped source ranges and PrevTokLoc with NextTokLoc.
- std::vector<SkippedRange> SkippedRanges;
- Optional<unsigned> LastCommentIndex = None;
-
+class CoverageSourceInfo : public PPCallbacks {
+ std::vector<SourceRange> SkippedRanges;
public:
- // Location of the token parsed before HandleComment is called. This is
- // updated every time Preprocessor::Lex lexes a new token.
- SourceLocation PrevTokLoc;
- // The location of token before comment.
- SourceLocation BeforeCommentLoc;
-
- std::vector<SkippedRange> &getSkippedRanges() {
- return SkippedRanges;
- }
+ ArrayRef<SourceRange> getSkippedRanges() const { return SkippedRanges; }
void SourceRangeSkipped(SourceRange Range, SourceLocation EndifLoc) override;
-
- bool HandleComment(Preprocessor &PP, SourceRange Range) override;
-
- void updateNextTokLoc(SourceLocation Loc);
};
namespace CodeGen {
@@ -94,8 +66,6 @@ class CoverageMappingModuleGen {
uint64_t FilenamesRef);
public:
- static CoverageSourceInfo *setUpCoverageCallbacks(Preprocessor &PP);
-
CoverageMappingModuleGen(CodeGenModule &CGM, CoverageSourceInfo &SourceInfo)
: CGM(CGM), SourceInfo(SourceInfo) {}
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 5e8dfda1a6fc..160e2b6ed884 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -969,8 +969,7 @@ void Preprocessor::Lex(Token &Result) {
LastTokenWasAt = Result.is(tok::at);
--LexLevel;
- if ((LexLevel == 0 || PreprocessToken) &&
- !Result.getFlag(Token::IsReinjected)) {
+ if (LexLevel == 0 && !Result.getFlag(Token::IsReinjected)) {
++TokenCount;
if (OnToken)
OnToken(Result);
diff --git a/clang/test/CoverageMapping/break.c b/clang/test/CoverageMapping/break.c
index 191f34765a65..08461d7ed2de 100644
--- a/clang/test/CoverageMapping/break.c
+++ b/clang/test/CoverageMapping/break.c
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name break.c %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name break.c %s | FileCheck %s
int main() { // CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = #0
int cnt = 0; // CHECK-NEXT: File 0, [[@LINE+1]]:9 -> [[@LINE+1]]:18 = #0
diff --git a/clang/test/CoverageMapping/builtinmacro.c b/clang/test/CoverageMapping/builtinmacro.c
index 0de0e8e6a125..63f5584d40c2 100644
--- a/clang/test/CoverageMapping/builtinmacro.c
+++ b/clang/test/CoverageMapping/builtinmacro.c
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name builtinmacro.c %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name builtinmacro.c %s | FileCheck %s
// Test the coverage mapping generation for built-in macroes.
diff --git a/clang/test/CoverageMapping/classtemplate.cpp b/clang/test/CoverageMapping/classtemplate.cpp
index 9250069e04f6..0dbb0c0ede84 100644
--- a/clang/test/CoverageMapping/classtemplate.cpp
+++ b/clang/test/CoverageMapping/classtemplate.cpp
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name classtemplate.cpp %t.stripped.cpp > %tmapping
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name classtemplate.cpp %s > %tmapping
// RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-CONSTRUCTOR
// RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-GETTER
// RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-SETTER
diff --git a/clang/test/CoverageMapping/comment-in-macro.c b/clang/test/CoverageMapping/comment-in-macro.c
index 86b554f8bd50..06e8adbc41ee 100644
--- a/clang/test/CoverageMapping/comment-in-macro.c
+++ b/clang/test/CoverageMapping/comment-in-macro.c
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s | FileCheck %s
#define x1 "" // ...
#define x2 return 0
@@ -8,5 +7,5 @@ int main() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> [[@LINE+3]]:2 = #0
x1; // CHECK-NEXT: Expansion,File 0, [[@LINE]]:3 -> [[@LINE]]:5 = #0
x2; // CHECK-NEXT: Expansion,File 0, [[@LINE]]:3 -> [[@LINE]]:5 = #0
}
-// CHECK-NEXT: File 1, 4:12 -> 4:14 = #0
-// CHECK-NEXT: File 2, 5:12 -> 5:20 = #0
+// CHECK-NEXT: File 1, 3:12 -> 3:14 = #0
+// CHECK-NEXT: File 2, 4:12 -> 4:20 = #0
diff --git a/clang/test/CoverageMapping/continue.c b/clang/test/CoverageMapping/continue.c
index 774fe2ee6fff..9864c912f239 100644
--- a/clang/test/CoverageMapping/continue.c
+++ b/clang/test/CoverageMapping/continue.c
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name continue.c %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name continue.c %s | FileCheck %s
int main() { // CHECK: File 0, [[@LINE]]:12 -> [[@LINE+21]]:2 = #0
int j = 0; // CHECK-NEXT: File 0, [[@LINE+2]]:18 -> [[@LINE+2]]:24 = (#0 + #1)
diff --git a/clang/test/CoverageMapping/coroutine.cpp b/clang/test/CoverageMapping/coroutine.cpp
index a614e6e8ea40..dc9473348fc9 100644
--- a/clang/test/CoverageMapping/coroutine.cpp
+++ b/clang/test/CoverageMapping/coroutine.cpp
@@ -1,7 +1,6 @@
// fixme: the following line is added to cleanup bots, will be removed in weeks.
// RUN: rm -f %S/coroutine.ll
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcoroutines-ts -std=c++14 -emit-llvm -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping %t.stripped.cpp -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcoroutines-ts -std=c++14 -emit-llvm -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping %s -o - | FileCheck %s
namespace std::experimental {
template <typename... T>
diff --git a/clang/test/CoverageMapping/deferred-region.cpp b/clang/test/CoverageMapping/deferred-region.cpp
index 8db6119472db..45113e46f02b 100644
--- a/clang/test/CoverageMapping/deferred-region.cpp
+++ b/clang/test/CoverageMapping/deferred-region.cpp
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -std=c++11 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fexceptions -fcxx-exceptions -emit-llvm-only -triple %itanium_abi_triple -main-file-name deferred-region.cpp -I %S/Inputs %t.stripped.cpp | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fexceptions -fcxx-exceptions -emit-llvm-only -triple %itanium_abi_triple -main-file-name deferred-region.cpp -I %S/Inputs %s | FileCheck %s
#define IF if
#define STMT(S) S
diff --git a/clang/test/CoverageMapping/if.cpp b/clang/test/CoverageMapping/if.cpp
index 8ffc09d29a3c..e3d6f4e25e57 100644
--- a/clang/test/CoverageMapping/if.cpp
+++ b/clang/test/CoverageMapping/if.cpp
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++1z -triple %itanium_abi_triple -main-file-name if.cpp %t.stripped.cpp | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++1z -triple %itanium_abi_triple -main-file-name if.cpp %s | FileCheck %s
int nop() { return 0; }
diff --git a/clang/test/CoverageMapping/includehell.cpp b/clang/test/CoverageMapping/includehell.cpp
index c92f12e5e80d..fd08d6af7f3d 100644
--- a/clang/test/CoverageMapping/includehell.cpp
+++ b/clang/test/CoverageMapping/includehell.cpp
@@ -51,7 +51,6 @@ int main() {
// CHECK-START: File [[START3]], 4:29 -> 5:1 = #9
// CHECK-CODE: File [[CODE1:[0-9]]], 1:1 -> 14:1 = #1
-// CHECK-CODE: Skipped,File [[CODE1]], 1:1 -> 1:41 = 0
// CHECK-CODE-NEXT: File [[CODE1]], 4:5 -> 4:11 = #1
// CHECK-CODE: File [[CODE1]], 4:13 -> 6:2 = #2
// CHECK-CODE: File [[CODE1]], 6:8 -> 8:2 = (#1 - #2)
@@ -59,7 +58,6 @@ int main() {
// CHECK-CODE: File [[CODE1]], 9:11 -> 11:2 = #3
// CHECK-CODE: File [[CODE1]], 11:8 -> 13:2 = (#1 - #3)
// CHECK-CODE: File [[CODE2:[0-9]]], 1:1 -> 14:1 = #5
-// CHECK-CODE: Skipped,File [[CODE2]], 1:1 -> 1:41 = 0
// CHECK-CODE-NEXT: File [[CODE2]], 4:5 -> 4:11 = #5
// CHECK-CODE: File [[CODE2]], 4:13 -> 6:2 = #6
// CHECK-CODE: File [[CODE2]], 6:8 -> 8:2 = (#5 - #6)
diff --git a/clang/test/CoverageMapping/label.cpp b/clang/test/CoverageMapping/label.cpp
index e77372d325e5..995835ad6b2f 100644
--- a/clang/test/CoverageMapping/label.cpp
+++ b/clang/test/CoverageMapping/label.cpp
@@ -1,7 +1,6 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name label.cpp %t.stripped.cpp | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name label.cpp %s | FileCheck %s
-// CHECK: func
+ // CHECK: func
void func() { // CHECK-NEXT: File 0, [[@LINE]]:13 -> {{[0-9]+}}:2 = #0
int i = 0; // CHECK-NEXT: File 0, [[@LINE+2]]:14 -> [[@LINE+2]]:20 = (#0 + #3)
// CHECK-NEXT: File 0, [[@LINE+1]]:22 -> [[@LINE+1]]:25 = #3
diff --git a/clang/test/CoverageMapping/logical.cpp b/clang/test/CoverageMapping/logical.cpp
index cca03377c98a..bc7c785b7b55 100644
--- a/clang/test/CoverageMapping/logical.cpp
+++ b/clang/test/CoverageMapping/logical.cpp
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name logical.cpp %t.stripped.cpp | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name logical.cpp %s | FileCheck %s
int main() { // CHECK: File 0, [[@LINE]]:12 -> [[@LINE+15]]:2 = #0
bool bt = true;
diff --git a/clang/test/CoverageMapping/loops.cpp b/clang/test/CoverageMapping/loops.cpp
index 498d214e69d9..ff7aafd66d94 100644
--- a/clang/test/CoverageMapping/loops.cpp
+++ b/clang/test/CoverageMapping/loops.cpp
@@ -1,7 +1,6 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -std=c++11 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name loops.cpp %t.stripped.cpp | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name loops.cpp %s | FileCheck %s
-// CHECK: rangedFor
+ // CHECK: rangedFor
void rangedFor() { // CHECK-NEXT: File 0, [[@LINE]]:18 -> {{[0-9]+}}:2 = #0
int arr[] = { 1, 2, 3, 4, 5 };
int sum = 0; // CHECK: Gap,File 0, [[@LINE+1]]:20 -> [[@LINE+1]]:21 = #1
diff --git a/clang/test/CoverageMapping/macro-expressions.cpp b/clang/test/CoverageMapping/macro-expressions.cpp
index 60afc5238b9e..26d70c67fca0 100644
--- a/clang/test/CoverageMapping/macro-expressions.cpp
+++ b/clang/test/CoverageMapping/macro-expressions.cpp
@@ -1,5 +1,5 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -std=c++11 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macro-expressions.cpp -w %t.stripped.cpp | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macro-expressions.cpp -w %s | FileCheck %s
+
#define EXPR(x) (x)
#define NEXPR(x) (!x)
#define DECL(T, x) T x
diff --git a/clang/test/CoverageMapping/macroparams2.c b/clang/test/CoverageMapping/macroparams2.c
index 30ce25d9accd..4e04581b725e 100644
--- a/clang/test/CoverageMapping/macroparams2.c
+++ b/clang/test/CoverageMapping/macroparams2.c
@@ -1,5 +1,5 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macroparams2.c %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macroparams2.c %s | FileCheck %s
+
#define MACRO(REFS, CALLS) (4 * (CALLS) < (REFS))
struct S {
diff --git a/clang/test/CoverageMapping/macros.c b/clang/test/CoverageMapping/macros.c
index 83e2029be561..39cd190b2a88 100644
--- a/clang/test/CoverageMapping/macros.c
+++ b/clang/test/CoverageMapping/macros.c
@@ -1,5 +1,5 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macros.c %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macros.c %s | FileCheck %s
+
#define MACRO return; bar()
#define MACRO_2 bar()
#define MACRO_1 return; MACRO_2
diff --git a/clang/test/CoverageMapping/macroscopes.cpp b/clang/test/CoverageMapping/macroscopes.cpp
index 62f5dbe77981..3f5f65e5ad7b 100644
--- a/clang/test/CoverageMapping/macroscopes.cpp
+++ b/clang/test/CoverageMapping/macroscopes.cpp
@@ -1,5 +1,5 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macroscopes.cpp %t.stripped.cpp | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macroscopes.cpp %s | FileCheck %s
+
#define starts_a_scope for (int i = 0; i < 2; ++i) {
#define ends_a_scope \
diff --git a/clang/test/CoverageMapping/moremacros.c b/clang/test/CoverageMapping/moremacros.c
index ed89dcafd672..5e0d4a6abf25 100644
--- a/clang/test/CoverageMapping/moremacros.c
+++ b/clang/test/CoverageMapping/moremacros.c
@@ -1,5 +1,5 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macro-expansion.c %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macro-expansion.c %s | FileCheck %s
+
#define LBRAC {
#define RBRAC }
diff --git a/clang/test/CoverageMapping/objc.m b/clang/test/CoverageMapping/objc.m
index 008d291aee31..4e4c184f0a88 100644
--- a/clang/test/CoverageMapping/objc.m
+++ b/clang/test/CoverageMapping/objc.m
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.m
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name objc.m -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -w %t.stripped.m | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name objc.m -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -w %s | FileCheck %s
@interface A
- (void)bork:(int)msg;
diff --git a/clang/test/CoverageMapping/pr32679.cpp b/clang/test/CoverageMapping/pr32679.cpp
index c93133f8c2f2..eac3afb6efb6 100644
--- a/clang/test/CoverageMapping/pr32679.cpp
+++ b/clang/test/CoverageMapping/pr32679.cpp
@@ -1,6 +1,5 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -cc1 -triple i686-pc-windows-msvc19.0.0 -emit-obj -fprofile-instrument=clang -std=c++14 -fdelayed-template-parsing -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name pr32679.cpp -o - %t.stripped.cpp | FileCheck %s -check-prefix=MSABI -implicit-check-not=f2
-// RUN: %clang_cc1 -cc1 -triple %itanium_abi_triple -emit-obj -fprofile-instrument=clang -std=c++14 -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name pr32679.cpp -o - %t.stripped.cpp | FileCheck %s -check-prefix=ITANIUM -implicit-check-not=f2
+// RUN: %clang_cc1 -cc1 -triple i686-pc-windows-msvc19.0.0 -emit-obj -fprofile-instrument=clang -std=c++14 -fdelayed-template-parsing -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name pr32679.cpp -o - %s | FileCheck %s -check-prefix=MSABI -implicit-check-not=f2
+// RUN: %clang_cc1 -cc1 -triple %itanium_abi_triple -emit-obj -fprofile-instrument=clang -std=c++14 -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name pr32679.cpp -o - %s | FileCheck %s -check-prefix=ITANIUM -implicit-check-not=f2
template <typename T, int S1>
struct CreateSpecialization;
diff --git a/clang/test/CoverageMapping/preprocessor.c b/clang/test/CoverageMapping/preprocessor.c
index b68aa2e0e93c..9225c9f162a2 100644
--- a/clang/test/CoverageMapping/preprocessor.c
+++ b/clang/test/CoverageMapping/preprocessor.c
@@ -1,7 +1,6 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name preprocessor.c %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name preprocessor.c %s | FileCheck %s
-// CHECK: func
+ // CHECK: func
void func() { // CHECK: File 0, [[@LINE]]:13 -> [[@LINE+5]]:2 = #0
int i = 0;
#ifdef MACRO // CHECK-NEXT: Skipped,File 0, [[@LINE]]:1 -> [[@LINE+2]]:7 = 0
@@ -12,7 +11,7 @@ void func() { // CHECK: File 0, [[@LINE]]:13 -> [[@LINE+5]]:2 = #0
// CHECK: main
int main() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = #0
int i = 0;
-#if 0 // CHECK-NEXT: Skipped,File 0, [[@LINE]]:1 -> [[@LINE+4]]:9 = 0
+# if 0 // CHECK-NEXT: Skipped,File 0, [[@LINE]]:1 -> [[@LINE+4]]:29 = 0
if(i == 0) {
i = 1;
}
@@ -30,7 +29,7 @@ int main() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = #0
}
#endif
- // CHECK-NEXT: Skipped,File 0, [[@LINE+1]]:1 -> [[@LINE+4]]:8
+ // CHECK-NEXT: Skipped,File 0, [[@LINE+1]]:1 -> [[@LINE+4]]:24
#\
if 0
#\
@@ -60,7 +59,7 @@ int main() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = #0
#\
endif
- // CHECK-NEXT: Skipped,File 0, [[@LINE+1]]:1 -> [[@LINE+6]]:10
+ // CHECK-NEXT: Skipped,File 0, [[@LINE+1]]:1 -> [[@LINE+6]]:26
#\
ifdef NOT_DEFINED
#\
diff --git a/clang/test/CoverageMapping/return.c b/clang/test/CoverageMapping/return.c
index e6107bc1925b..440acb569b8f 100644
--- a/clang/test/CoverageMapping/return.c
+++ b/clang/test/CoverageMapping/return.c
@@ -1,7 +1,6 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name return.c %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name return.c %s | FileCheck %s
-// CHECK: func
+ // CHECK: func
void func() { // CHECK: File 0, [[@LINE]]:13 -> [[@LINE+3]]:2 = #0
return;
int i = 0; // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:2 = 0
diff --git a/clang/test/CoverageMapping/switch.cpp b/clang/test/CoverageMapping/switch.cpp
index 1a8db09b3ff1..25ea4053f4e2 100644
--- a/clang/test/CoverageMapping/switch.cpp
+++ b/clang/test/CoverageMapping/switch.cpp
@@ -1,7 +1,6 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++1z -triple %itanium_abi_triple -main-file-name switch.cpp %t.stripped.cpp | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++1z -triple %itanium_abi_triple -main-file-name switch.cpp %s | FileCheck %s
-// CHECK: foo
+ // CHECK: foo
void foo(int i) { // CHECK-NEXT: File 0, [[@LINE]]:17 -> [[@LINE+8]]:2 = #0
switch(i) { // CHECK-NEXT: Gap,File 0, [[@LINE]]:13 -> [[@LINE+4]]:10 = 0
case 1: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:11 = #2
diff --git a/clang/test/CoverageMapping/switchmacro.c b/clang/test/CoverageMapping/switchmacro.c
index 5c6a37e77f94..fc0392fb91e5 100644
--- a/clang/test/CoverageMapping/switchmacro.c
+++ b/clang/test/CoverageMapping/switchmacro.c
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name switchmacro.c %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name switchmacro.c %s | FileCheck %s
#define FOO(x) (void)x
diff --git a/clang/test/CoverageMapping/test.c b/clang/test/CoverageMapping/test.c
index 559036a3be9b..ae73fcb3bbab 100644
--- a/clang/test/CoverageMapping/test.c
+++ b/clang/test/CoverageMapping/test.c
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name test.c %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name test.c %s | FileCheck %s
void bar();
static void static_func();
diff --git a/clang/test/CoverageMapping/trycatch.cpp b/clang/test/CoverageMapping/trycatch.cpp
index ba1b26b7acee..5d284daaca01 100644
--- a/clang/test/CoverageMapping/trycatch.cpp
+++ b/clang/test/CoverageMapping/trycatch.cpp
@@ -1,5 +1,4 @@
-// RUN: %strip_comments > %t.stripped.cpp
-// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -fexceptions -fcxx-exceptions -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name trycatch.cpp %t.stripped.cpp | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -fexceptions -fcxx-exceptions -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name trycatch.cpp %s | FileCheck %s
class Error {
};
diff --git a/clang/test/CoverageMapping/unreachable-macro.c b/clang/test/CoverageMapping/unreachable-macro.c
index b84acca33f93..b9d4f3616ffa 100644
--- a/clang/test/CoverageMapping/unreachable-macro.c
+++ b/clang/test/CoverageMapping/unreachable-macro.c
@@ -1,5 +1,5 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s | FileCheck %s
+
#define WHILE while (0) {}
// CHECK: counters_in_macro_following_unreachable
diff --git a/clang/test/CoverageMapping/while.c b/clang/test/CoverageMapping/while.c
index e0c3ca35537f..616ecf69020d 100644
--- a/clang/test/CoverageMapping/while.c
+++ b/clang/test/CoverageMapping/while.c
@@ -1,7 +1,6 @@
-// RUN: %strip_comments > %t.stripped.c
-// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name loops.cpp %t.stripped.c | FileCheck %s
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name loops.cpp %s | FileCheck %s
-// CHECK: main
+ // CHECK: main
int main() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> [[@LINE+8]]:2 = #0
int j = 0; // CHECK-NEXT: File 0, [[@LINE+1]]:9 -> [[@LINE+1]]:14 = (#0 + #1)
while(j < 5) ++j; // CHECK-NEXT: File 0, [[@LINE]]:15 -> [[@LINE]]:16 = #1
diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 6c677eda9a09..dacda6894a04 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -91,11 +91,6 @@
('%hmaptool', "'%s' %s" % (config.python_executable,
os.path.join(config.clang_tools_dir, 'hmaptool'))))
-# Strip C++ comments "//"" from tests
-config.substitutions.append(
- ('%strip_comments', "sed 's/[ \t]*\/\/.*//' %s")
-)
-
# Plugins (loadable modules)
if config.has_plugins and config.llvm_plugin_ext:
config.available_features.add('plugins')
diff --git a/compiler-rt/test/profile/Inputs/instrprof-comdat.h b/compiler-rt/test/profile/Inputs/instrprof-comdat.h
index 956496ee1361..61e283cc878e 100644
--- a/compiler-rt/test/profile/Inputs/instrprof-comdat.h
+++ b/compiler-rt/test/profile/Inputs/instrprof-comdat.h
@@ -18,6 +18,6 @@ template <class T> T FOO<T>::DoIt(T ti) { // HEADER: [[@LINE]]| 2|template
if (I > ti / 2) // HEADER: [[@LINE]]| 20| if (I > ti
t -= 1; // HEADER: [[@LINE]]| 8| t -= 1;
} // HEADER: [[@LINE]]| 10| }
- // HEADER: [[@LINE]]| |
+ // HEADER: [[@LINE]]| 1|
return t; // HEADER: [[@LINE]]| 1| return t;
}
diff --git a/compiler-rt/test/profile/coverage_comments.cpp b/compiler-rt/test/profile/coverage_comments.cpp
deleted file mode 100644
index 0cf78add7913..000000000000
--- a/compiler-rt/test/profile/coverage_comments.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-// RUN: %clangxx_profgen -fcoverage-mapping -Wno-comment -o %t %s
-// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
-// RUN: llvm-profdata merge -o %t.profdata %t.profraw
-// RUN: llvm-cov show %t -instr-profile %t.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s
-
-int main() { // CHECK: [[# @LINE]]| 1|int main() {
- /* comment */ int x = 0; // CHECK-NEXT: [[# @LINE]]| 1|
- int y = 0; /* comment */ // CHECK-NEXT: [[# @LINE]]| 1|
- int z = 0; // comment // CHECK-NEXT: [[# @LINE]]| 1|
- // comment // CHECK-NEXT: [[# @LINE]]| |
- // CHECK-NEXT: [[# @LINE]]| |
- x = 0; /* // CHECK-NEXT: [[# @LINE]]| 1|
- comment // CHECK-NEXT: [[# @LINE]]| |
- */ // CHECK-NEXT: [[# @LINE]]| |
- // CHECK-NEXT: [[# @LINE]]| |
- /* // CHECK-NEXT: [[# @LINE]]| |
- comment // CHECK-NEXT: [[# @LINE]]| |
- */ x = 0; // CHECK-NEXT: [[# @LINE]]| 1|
- // CHECK-NEXT: [[# @LINE]]| |
- /* comment */ // CHECK-NEXT: [[# @LINE]]| |
- // comment // CHECK-NEXT: [[# @LINE]]| |
- /* comment */ // CHECK-NEXT: [[# @LINE]]| |
- z = // CHECK-NEXT: [[# @LINE]]| 1|
- x // comment // CHECK-NEXT: [[# @LINE]]| 1|
- // comment // CHECK-NEXT: [[# @LINE]]| |
- + /* // CHECK-NEXT: [[# @LINE]]| 1|
- comment // CHECK-NEXT: [[# @LINE]]| |
- */ // CHECK-NEXT: [[# @LINE]]| |
- /* // CHECK-NEXT: [[# @LINE]]| |
- comment // CHECK-NEXT: [[# @LINE]]| |
- */y; // CHECK-NEXT: [[# @LINE]]| 1|
- // CHECK-NEXT: [[# @LINE]]| |
- // Comments inside directives. // CHECK-NEXT: [[# @LINE]]| |
- #if 0 //comment // CHECK-NEXT: [[# @LINE]]| |
- /* comment */ x = 0; // CHECK-NEXT: [[# @LINE]]| |
- y = 0; /* comment */ // CHECK-NEXT: [[# @LINE]]| |
- z = 0; // comment // CHECK-NEXT: [[# @LINE]]| |
- // comment // CHECK-NEXT: [[# @LINE]]| |
- // CHECK-NEXT: [[# @LINE]]| |
- x = 0; /* // CHECK-NEXT: [[# @LINE]]| |
- comment // CHECK-NEXT: [[# @LINE]]| |
- */ // CHECK-NEXT: [[# @LINE]]| |
- // CHECK-NEXT: [[# @LINE]]| |
- /* // CHECK-NEXT: [[# @LINE]]| |
- comment // CHECK-NEXT: [[# @LINE]]| |
- */ x = 0; // CHECK-NEXT: [[# @LINE]]| |
- // CHECK-NEXT: [[# @LINE]]| |
- /* comment */ // CHECK-NEXT: [[# @LINE]]| |
- // comment // CHECK-NEXT: [[# @LINE]]| |
- /* comment */ // CHECK-NEXT: [[# @LINE]]| |
- #endif // comment // CHECK-NEXT: [[# @LINE]]| |
- #if 1 // comment // CHECK-NEXT: [[# @LINE]]| 1|
- /* comment */ x = 0; // CHECK-NEXT: [[# @LINE]]| 1|
- y = 0; /* comment */ // CHECK-NEXT: [[# @LINE]]| 1|
- z = 0; // comment // CHECK-NEXT: [[# @LINE]]| 1|
- // comment // CHECK-NEXT: [[# @LINE]]| |
- // CHECK-NEXT: [[# @LINE]]| |
- x = 0; /* // CHECK-NEXT: [[# @LINE]]| 1|
- comment // CHECK-NEXT: [[# @LINE]]| |
- */ // CHECK-NEXT: [[# @LINE]]| |
- // CHECK-NEXT: [[# @LINE]]| |
- /* // CHECK-NEXT: [[# @LINE]]| |
- comment // CHECK-NEXT: [[# @LINE]]| |
- */ x = 0; // CHECK-NEXT: [[# @LINE]]| 1|
- // CHECK-NEXT: [[# @LINE]]| |
- /* comment */ // CHECK-NEXT: [[# @LINE]]| |
- // comment // CHECK-NEXT: [[# @LINE]]| |
- /* comment */ // CHECK-NEXT: [[# @LINE]]| |
- #endif //comment // CHECK-NEXT: [[# @LINE]]| 1|
- return 0; // CHECK-NEXT: [[# @LINE]]| 1|
-} // CHECK-NEXT: [[# @LINE]]| 1|
diff --git a/compiler-rt/test/profile/instrprof-set-file-object-merging.c b/compiler-rt/test/profile/instrprof-set-file-object-merging.c
index 35e9becf228f..0ca5f6ff9ed9 100644
--- a/compiler-rt/test/profile/instrprof-set-file-object-merging.c
+++ b/compiler-rt/test/profile/instrprof-set-file-object-merging.c
@@ -34,7 +34,7 @@ int main(int argc, const char *argv[]) {
// CHECK: 17| 2|
// CHECK: 18| 2| FILE *F = fopen(argv[1], "r+b");
// CHECK: 19| 2| if (!F) {
-// CHECK: 20| | // File might not exist, try opening with truncation
+// CHECK: 20| 1| // File might not exist, try opening with truncation
// CHECK: 21| 1| F = fopen(argv[1], "w+b");
// CHECK: 22| 1| }
// CHECK: 23| 2| __llvm_profile_set_file_object(F, 1);
More information about the llvm-commits
mailing list