comparison 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
comparison
equal deleted inserted replaced
172:9fbae9c8bf63 173:0572611fdcc8
1 // Test coverage flag. 1 // RUN: %clang -### -S -ftest-coverage %s 2>&1 | FileCheck --check-prefix=TEST-COVERAGE %s
2 // REQUIRES: system-windows 2 // RUN: %clang -### -S -ftest-coverage -fno-test-coverage %s 2>&1 | FileCheck --check-prefix=NO-TEST-COVERAGE %s
3 // 3
4 // RUN: %clang_cl -Wno-msvc-not-found -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s 4 // TEST-COVERAGE: "-femit-coverage-notes"
5 // CLANG-CL-COVERAGE-NOT: error: 5 // TEST-COVERAGE: "-coverage-notes-file" "{{.*}}{{/|\\\\}}coverage.gcno"
6 // CLANG-CL-COVERAGE-NOT: warning: 6 // NO-TEST-COVERAGE-NOT: "-coverage-notes-file"
7 // CLANG-CL-COVERAGE-NOT: argument unused 7
8 // CLANG-CL-COVERAGE-NOT: unknown argument 8 // RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck --check-prefix=PROFILE-ARCS %s
9 // RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs %s 2>&1 | FileCheck --check-prefix=NO-PROFILE-ARCS %s
10
11 // PROFILE-ARCS: "-femit-coverage-data"
12 // PROFILE-ARCS: "-coverage-notes-file" "{{.*}}{{/|\\\\}}coverage.c"
13 // NO-PROFILE-ARCS-NOT: "-femit-coverage-data"
14
15 // RUN: %clang -### -S -fprofile-arcs %s -o /foo/bar.o 2>&1 | FileCheck --check-prefix=GCNO-LOCATION %s
16 // RUN: %clang_cl -### /c --coverage /Fo/foo/bar.obj -- %s 2>&1 | FileCheck --check-prefix=GCNO-LOCATION %s
17 // RUN: %clang -### -c -fprofile-arcs %s -o foo/bar.o 2>&1 | FileCheck --check-prefix=GCNO-LOCATION-REL %s
18
19 // GCNO-LOCATION: "-coverage-notes-file" "{{.*}}/foo/bar.gcno"
20 // GCNO-LOCATION-REL: "-coverage-notes-file" "{{.*}}{{/|\\\\}}foo/bar.gcno"
21
22 /// Don't warn -Wunused-command-line-argument.
23 // RUN: %clang -E -Werror --coverage -ftest-coverage -fprofile-arcs %s
24
25 /// Test -fprofile-dir=
26 // RUN: not %clang -S -Werror -fprofile-dir=abc %s
27 // RUN: not %clang -S -Werror -ftest-coverage -fprofile-dir=abc %s
28 // RUN: %clang -### -S -fprofile-arcs -fprofile-dir=abc %s 2>&1 | FileCheck --check-prefix=PROFILE-DIR %s
29 // RUN: %clang -### -S --coverage -fprofile-dir=abc %s 2>&1 | FileCheck --check-prefix=PROFILE-DIR %s
30
31 // PROFILE-DIR: "-coverage-data-file" "abc
32
33 /// These should only get passed if any of --coverage, -ftest-coverage, or
34 /// -fprofile-arcs is passed.
35 // RUN: %clang -### -c %s 2>&1 | FileCheck --check-prefix=NO-COV %s
36 // NO-COV-NOT: "-coverage-notes-file"
37 // NO-COV-NOT: "-coverage-data-file"