diff options
Diffstat (limited to 'test/CoverageMapping')
| -rw-r--r-- | test/CoverageMapping/default-method.cpp | 17 | ||||
| -rw-r--r-- | test/CoverageMapping/macros.c | 10 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/CoverageMapping/default-method.cpp b/test/CoverageMapping/default-method.cpp new file mode 100644 index 000000000000..6b5428306b71 --- /dev/null +++ b/test/CoverageMapping/default-method.cpp @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++17 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name default-method.cpp -w %s | FileCheck %s -implicit-check-not="->" + +namespace PR39822 { + struct unique_ptr { + unique_ptr &operator=(unique_ptr &); + }; + + class foo { + foo &operator=(foo &); + unique_ptr convertable_values_[2]; + }; + + // CHECK: _ZN7PR398223fooaSERS0_: + // CHECK-NEXT: File 0, [[@LINE+1]]:28 -> [[@LINE+1]]:29 = #0 + foo &foo::operator=(foo &) = default; +} // namespace PR39822 + diff --git a/test/CoverageMapping/macros.c b/test/CoverageMapping/macros.c index 95fe37ed7e8d..39cd190b2a88 100644 --- a/test/CoverageMapping/macros.c +++ b/test/CoverageMapping/macros.c @@ -4,6 +4,7 @@ #define MACRO_2 bar() #define MACRO_1 return; MACRO_2 #define MACRO_3 MACRO_2 +#define GOTO goto void bar() {} @@ -56,6 +57,15 @@ void func5() { // CHECK-NEXT: File 0, [[@LINE]]:14 -> [[@LINE+4]]:2 = #0 // CHECK-NEXT: Expansion,File 1, 6:17 -> 6:24 = #1 // CHECK-NEXT: File 2, 4:17 -> 4:22 = #1 +// CHECK-NEXT: func6 +void func6(unsigned count) { // CHECK-NEXT: File 0, [[@LINE]]:28 -> [[@LINE+4]]:2 = #0 +begin: // CHECK-NEXT: File 0, [[@LINE]]:1 -> [[@LINE+3]]:2 = #1 + if (count--) // CHECK-NEXT: File 0, [[@LINE]]:9 -> [[@LINE]]:16 = #1 + GOTO begin; // CHECK-NEXT: File 0, [[@LINE]]:9 -> [[@LINE]]:19 = #2 +} +// CHECK-NEXT: Expansion,File 0, [[@LINE-2]]:9 -> [[@LINE-2]]:13 = #2 +// CHECK-NEXT: File 1, 7:14 -> 7:18 = #2 + int main(int argc, const char *argv[]) { func(); func2(); |
