summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/debug-line-1.c
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-04-10 18:20:19 +0000
committerEric Christopher <echristo@apple.com>2012-04-10 18:20:19 +0000
commit0241e32304d290768662748b221146ea7e8380f1 (patch)
treeee6074fa5814680456d6820dc32315585dfafdb4 /clang/test/CodeGen/debug-line-1.c
parentb10973af64888be2dc3ebabd34a266bc04bba457 (diff)
downloadbcm5719-llvm-0241e32304d290768662748b221146ea7e8380f1.tar.gz
bcm5719-llvm-0241e32304d290768662748b221146ea7e8380f1.zip
For debug and coverage analysis if we're not optimizing go ahead
and emit a relatively empty block for a plain break statement. This enables us to track where we went through a switch. PR9796 & rdar://11215207 llvm-svn: 154420
Diffstat (limited to 'clang/test/CodeGen/debug-line-1.c')
-rw-r--r--clang/test/CodeGen/debug-line-1.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGen/debug-line-1.c b/clang/test/CodeGen/debug-line-1.c
new file mode 100644
index 00000000000..b31de55c8c1
--- /dev/null
+++ b/clang/test/CodeGen/debug-line-1.c
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple x86_64-unk-unk -o - -emit-llvm -g %s | FileCheck %s
+// PR9796
+
+// Check to make sure that we emit the block for the break so that we can count the line.
+// CHECK: sw.bb: ; preds = %entry
+// CHECK: br label %sw.epilog, !dbg !21
+
+extern int atoi(const char *);
+
+int f(char* arg) {
+ int x = atoi(arg);
+
+ switch(x) {
+ case 1:
+ break;
+ }
+
+ return 0;
+}
OpenPOWER on IntegriCloud