diff clang/test/Driver/coverage.c @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children 2e18cbf3894f
line wrap: on
line diff
--- a/clang/test/Driver/coverage.c	Mon May 25 11:50:15 2020 +0900
+++ b/clang/test/Driver/coverage.c	Mon May 25 11:55:54 2020 +0900
@@ -1,8 +1,37 @@
-// Test coverage flag.
-// REQUIRES: system-windows
-//
-// RUN: %clang_cl -Wno-msvc-not-found -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s
-// CLANG-CL-COVERAGE-NOT: error:
-// CLANG-CL-COVERAGE-NOT: warning:
-// CLANG-CL-COVERAGE-NOT: argument unused
-// CLANG-CL-COVERAGE-NOT: unknown argument
+// RUN: %clang -### -S -ftest-coverage %s 2>&1 | FileCheck --check-prefix=TEST-COVERAGE %s
+// RUN: %clang -### -S -ftest-coverage -fno-test-coverage %s 2>&1 | FileCheck --check-prefix=NO-TEST-COVERAGE %s
+
+// TEST-COVERAGE: "-femit-coverage-notes"
+// TEST-COVERAGE: "-coverage-notes-file" "{{.*}}{{/|\\\\}}coverage.gcno"
+// NO-TEST-COVERAGE-NOT: "-coverage-notes-file"
+
+// RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck --check-prefix=PROFILE-ARCS %s
+// RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs %s 2>&1 | FileCheck --check-prefix=NO-PROFILE-ARCS %s
+
+// PROFILE-ARCS: "-femit-coverage-data"
+// PROFILE-ARCS: "-coverage-notes-file" "{{.*}}{{/|\\\\}}coverage.c"
+// NO-PROFILE-ARCS-NOT: "-femit-coverage-data"
+
+// RUN: %clang -### -S -fprofile-arcs %s -o /foo/bar.o 2>&1 | FileCheck --check-prefix=GCNO-LOCATION %s
+// RUN: %clang_cl -### /c --coverage /Fo/foo/bar.obj -- %s 2>&1 | FileCheck --check-prefix=GCNO-LOCATION %s
+// RUN: %clang -### -c -fprofile-arcs %s -o foo/bar.o 2>&1 | FileCheck --check-prefix=GCNO-LOCATION-REL %s
+
+// GCNO-LOCATION: "-coverage-notes-file" "{{.*}}/foo/bar.gcno"
+// GCNO-LOCATION-REL: "-coverage-notes-file" "{{.*}}{{/|\\\\}}foo/bar.gcno"
+
+/// Don't warn -Wunused-command-line-argument.
+// RUN: %clang -E -Werror --coverage -ftest-coverage -fprofile-arcs %s
+
+/// Test -fprofile-dir=
+// RUN: not %clang -S -Werror -fprofile-dir=abc %s
+// RUN: not %clang -S -Werror -ftest-coverage -fprofile-dir=abc %s
+// RUN: %clang -### -S -fprofile-arcs -fprofile-dir=abc %s 2>&1 | FileCheck --check-prefix=PROFILE-DIR %s
+// RUN: %clang -### -S --coverage -fprofile-dir=abc %s 2>&1 | FileCheck --check-prefix=PROFILE-DIR %s
+
+// PROFILE-DIR: "-coverage-data-file" "abc
+
+/// These should only get passed if any of --coverage, -ftest-coverage, or
+/// -fprofile-arcs is passed.
+// RUN: %clang -### -c %s 2>&1 | FileCheck --check-prefix=NO-COV %s
+// NO-COV-NOT: "-coverage-notes-file"
+// NO-COV-NOT: "-coverage-data-file"