summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-03-16 23:52:03 +0000
committerJustin Bogner <mail@justinbogner.com>2015-03-16 23:52:03 +0000
commit3faa76bfab41067743d92dbf5648f02180d1fd1b (patch)
treec5e3b8d3c1d53923c07565319690cf3127b83b7f /llvm/test/Transforms
parent933f853030ea34f2c718afea260572de2c4c9a31 (diff)
downloadbcm5719-llvm-3faa76bfab41067743d92dbf5648f02180d1fd1b.tar.gz
bcm5719-llvm-3faa76bfab41067743d92dbf5648f02180d1fd1b.zip
GCOV: Make the exit block placement from r223193 optional
By default we want our gcov emission to stay 4.2 compatible, which means we need to continue emit the exit block last by default. We add an option to emit it before the body for users that need it. llvm-svn: 232438
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/GCOVProfiling/return-block.ll23
1 files changed, 16 insertions, 7 deletions
diff --git a/llvm/test/Transforms/GCOVProfiling/return-block.ll b/llvm/test/Transforms/GCOVProfiling/return-block.ll
index 8954157f548..0fafc559f5d 100644
--- a/llvm/test/Transforms/GCOVProfiling/return-block.ll
+++ b/llvm/test/Transforms/GCOVProfiling/return-block.ll
@@ -1,8 +1,14 @@
; Inject metadata to set the .gcno file location
; RUN: echo '!19 = !{!"%/T/return-block.ll", !0}' > %t1
; RUN: cat %s %t1 > %t2
+
+; By default, the return block is last.
; RUN: opt -insert-gcov-profiling -disable-output %t2
-; RUN: llvm-cov gcov -n -dump %T/return-block.gcno 2>&1 | FileCheck %s
+; RUN: llvm-cov gcov -n -dump %T/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-LAST %s
+
+; But we can optionally emit it second, to match newer gcc versions.
+; RUN: opt -insert-gcov-profiling -gcov-exit-block-before-body -disable-output %t2
+; RUN: llvm-cov gcov -n -dump %T/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-SECOND %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@@ -58,9 +64,12 @@ attributes #2 = { nounwind }
!17 = distinct !MDLexicalBlock(line: 7, column: 7, file: !1, scope: !4)
!18 = !MDLocation(line: 9, column: 1, scope: !4)
-; There should be no destination edges for block 1.
-; CHECK: Block : 0 Counter : 0
-; CHECK-NEXT: Destination Edges : 2 (0),
-; CHECK-NEXT: Block : 1 Counter : 0
-; CHECK-NEXT: Source Edges : 4 (0),
-; CHECK-NEXT: Block : 2 Counter : 0
+; There should be no destination edges for the exit block.
+; CHECK: Block : 1 Counter : 0
+; RETURN-LAST: Destination Edges
+; RETURN-SECOND-NOT: Destination Edges
+; CHECK: Block : 2 Counter : 0
+; CHECK: Block : 4 Counter : 0
+; RETURN-LAST-NOT: Destination Edges
+; RETURN-SECOND: Destination Edges
+; CHECK-NOT: Block :
OpenPOWER on IntegriCloud