blob: 676d6278576783ff549ace5357ea32d755634847 [file] [log] [blame]
Justin Bogner24ee64b2015-03-09 18:54:58 +00001// RUN: llvm-profdata merge %S/Inputs/regionMarkers.proftext -o %t.profdata
Alex Lorenze82d89c2014-08-22 22:56:03 +00002
Vedant Kumar933b37f2017-09-08 18:44:46 +00003int main() { // CHECK-NOT: Marker at [[@LINE]]:12
Alex Lorenze82d89c2014-08-22 22:56:03 +00004 int x = 0;
5
Vedant Kumar933b37f2017-09-08 18:44:46 +00006 if (x) { // CHECK-NOT: Marker at [[@LINE]]:10
Alex Lorenze82d89c2014-08-22 22:56:03 +00007 x = 0;
Vedant Kumar933b37f2017-09-08 18:44:46 +00008 } else { // CHECK-NOT: Marker at [[@LINE]]:10
Alex Lorenze82d89c2014-08-22 22:56:03 +00009 x = 1;
10 }
Vedant Kumar9cbd33f2017-10-18 18:52:29 +000011 // CHECK-NOT: Marker at [[@LINE+2]]:19
Justin Bognerd0ceebf2015-05-13 22:41:48 +000012 // CHECK: Marker at [[@LINE+1]]:28 = 111M
Vedant Kumar933b37f2017-09-08 18:44:46 +000013 for (int i = 0; i < 100; ++i) { // CHECK-NOT: Marker at [[@LINE]]:33
Alex Lorenze82d89c2014-08-22 22:56:03 +000014 x = 1;
15 }
Vedant Kumar9cbd33f2017-10-18 18:52:29 +000016 // CHECK-NOT: Marker at [[@LINE+1]]:16
Alex Lorenze82d89c2014-08-22 22:56:03 +000017 x = x < 10 ? x + 1 : x - 1; // CHECK: Marker at [[@LINE]]:24 = 0
18 x = x > 10 ?
Vedant Kumar933b37f2017-09-08 18:44:46 +000019 x - 1: // CHECK-NOT: Marker at [[@LINE]]:9
20 x + 1; // CHECK-NOT: Marker at [[@LINE]]:9
Alex Lorenze82d89c2014-08-22 22:56:03 +000021
22 return 0;
23}
Alex Lorenz7949a8b2014-08-23 00:47:24 +000024
Vedant Kumar7d642b72017-11-09 02:42:34 +000025// RUN: llvm-cov show %S/Inputs/regionMarkers.covmapping -instr-profile %t.profdata -show-regions -dump -path-equivalence=/tmp,%S/ %s 2>&1 | FileCheck %s
26// RUN: llvm-cov show %S/Inputs/regionMarkers.covmapping -instr-profile %t.profdata -show-regions -format=html -dump -path-equivalence=/tmp,%S %s 2>&1 | FileCheck %s
Vedant Kumar7101d732016-07-26 22:50:58 +000027
28// RUN: llvm-cov export %S/Inputs/regionMarkers.covmapping -instr-profile %t.profdata 2>&1 | FileCheck %S/Inputs/regionMarkers.json