<p>Fyi, the convention for FileCheck labels is hyphen-separated caps LIKE-THIS</p>
<p><blockquote type="cite">On Nov 27, 2013 5:17 PM, "Diego Novillo" <<a href="mailto:dnovillo@google.com">dnovillo@google.com</a>> wrote:<br><br>Hi chandlerc,<br>
<br>
<br>
The profile file parser needed some tests for its parsing actions.<br>
This adds tests for each of the error messages emitted by the parser.<br>
<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D2282" target="_blank">http://llvm-reviews.chandlerc.com/D2282</a><br>
<br>
Files:<br>
  test/Transforms/SampleProfile/Inputs/bad_fn_header.prof<br>
  test/Transforms/SampleProfile/Inputs/bad_sample_line.prof<br>
  test/Transforms/SampleProfile/Inputs/missing_num_syms.prof<br>
  test/Transforms/SampleProfile/Inputs/missing_samples.prof<br>
  test/Transforms/SampleProfile/Inputs/missing_symtab.prof<br>
  test/Transforms/SampleProfile/Inputs/syntax.prof<br>
  test/Transforms/SampleProfile/syntax.ll<br>
<br>
Index: test/Transforms/SampleProfile/Inputs/bad_fn_header.prof<br>
===================================================================<br>
--- /dev/null<br>
+++ test/Transforms/SampleProfile/Inputs/bad_fn_header.prof<br>
@@ -0,0 +1,6 @@<br>
+symbol table<br>
+1<br>
+empty<br>
+empty:100:BAD<br>
+0: 0<br>
+1: 100<br>
Index: test/Transforms/SampleProfile/Inputs/bad_sample_line.prof<br>
===================================================================<br>
--- /dev/null<br>
+++ test/Transforms/SampleProfile/Inputs/bad_sample_line.prof<br>
@@ -0,0 +1,6 @@<br>
+symbol table<br>
+1<br>
+empty<br>
+empty:100:0:1<br>
+0: 0<br>
+1: BAD<br>
Index: test/Transforms/SampleProfile/Inputs/missing_num_syms.prof<br>
===================================================================<br>
--- /dev/null<br>
+++ test/Transforms/SampleProfile/Inputs/missing_num_syms.prof<br>
@@ -0,0 +1,5 @@<br>
+symbol table<br>
+empty<br>
+empty:100:0:1<br>
+0: 0<br>
+1: 100<br>
Index: test/Transforms/SampleProfile/Inputs/missing_samples.prof<br>
===================================================================<br>
--- /dev/null<br>
+++ test/Transforms/SampleProfile/Inputs/missing_samples.prof<br>
@@ -0,0 +1,6 @@<br>
+symbol table<br>
+1<br>
+empty<br>
+empty:100:0:10<br>
+0: 0<br>
+1: 100<br>
Index: test/Transforms/SampleProfile/Inputs/missing_symtab.prof<br>
===================================================================<br>
--- /dev/null<br>
+++ test/Transforms/SampleProfile/Inputs/missing_symtab.prof<br>
@@ -0,0 +1,5 @@<br>
+1<br>
+empty<br>
+empty:100:0:1<br>
+0: 0<br>
+1: 100<br>
Index: test/Transforms/SampleProfile/Inputs/syntax.prof<br>
===================================================================<br>
--- /dev/null<br>
+++ test/Transforms/SampleProfile/Inputs/syntax.prof<br>
@@ -0,0 +1,6 @@<br>
+symbol table<br>
+1<br>
+empty<br>
+empty:100:0:2<br>
+0: 0<br>
+1: 100<br>
Index: test/Transforms/SampleProfile/syntax.ll<br>
===================================================================<br>
--- /dev/null<br>
+++ test/Transforms/SampleProfile/syntax.ll<br>
@@ -0,0 +1,19 @@<br>
+; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/syntax.prof 2>&1 | FileCheck -check-prefix=NO_DEBUG %s<br>
+; RUN: not opt < %s -sample-profile -sample-profile-file=missing.prof 2>&1 | FileCheck -check-prefix=MISSING_FILE %s<br>
+; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/missing_symtab.prof 2>&1 | FileCheck -check-prefix=MISSING_SYMTAB %s<br>
+; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/missing_num_syms.prof 2>&1 | FileCheck -check-prefix=MISSING_NUM_SYMS %s<br>
+; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/bad_fn_header.prof 2>&1 | FileCheck -check-prefix=BAD_FN_HEADER %s<br>
+; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/bad_sample_line.prof 2>&1 | FileCheck -check-prefix=BAD_SAMPLE_LINE %s<br>
+; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/missing_samples.prof 2>&1 | FileCheck -check-prefix=MISSING_SAMPLES %s<br>
+<br>
+define void @empty() {<br>
+entry:<br>
+  ret void<br>
+}<br>
+; NO_DEBUG: LLVM ERROR: No debug information found in function empty<br>
+; MISSING_FILE: LLVM ERROR: Could not open profile file missing.prof: No such file or directory<br>
+; MISSING_SYMTAB: LLVM ERROR: {{.*}}missing_symtab.prof:1: Expected 'symbol table', found 1<br>
+; MISSING_NUM_SYMS: LLVM ERROR: {{.*}}missing_num_syms.prof:2: Expected a number, found empty<br>
+; BAD_FN_HEADER: LLVM ERROR: {{.*}}bad_fn_header.prof:4: Expected 'mangled_name:NUM:NUM:NUM', found empty:100:BAD<br>
+; BAD_SAMPLE_LINE: LLVM ERROR: {{.*}}bad_sample_line.prof:6: Expected 'mangled_name:NUM:NUM:NUM', found 1: BAD<br>
+; MISSING_SAMPLES: LLVM ERROR: {{.*}}missing_samples.prof:6: Unexpected end of file<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></p>