<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - FileCheck failure for a C-based unit test case"
   href="https://bugs.llvm.org/show_bug.cgi?id=32941">32941</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>FileCheck failure for a C-based unit test case
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ys114321@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I tried to write a C-based unit test case for BPF source debugging.
But it failed as follows.

[~/work/llvm/test/CodeGen/BPF] clang -O2 -target bpf -g -c debug_source.c &&
llvm-objdump -S debug_source.o                                                  

debug_source.o: file format ELF64-BPF

Disassembly of section .text:
test:
; int test(int *p) {
       0:       b7 02 00 00 02 00 00 00         r2 = 2
; *p = 2;
       1:       63 21 00 00 00 00 00 00         *(u32 *)(r1 + 0) = r2
; return 1;
       2:       b7 00 00 00 01 00 00 00         r0 = 1
       3:       95 00 00 00 00 00 00 00         exit
[~/work/llvm/test/CodeGen/BPF] ~/work/llvm/build/bin/llvm-lit -v debug_source.c
-- Testing: 1 tests, 1 threads --
FAIL: LLVM :: CodeGen/BPF/debug_source.c (1 of 1)
******************** TEST 'LLVM :: CodeGen/BPF/debug_source.c' FAILED
********************
Script:
--
clang -g -target bpfel -O2 -c -x c -o
/home/yhs/work/llvm/build/test/CodeGen/BPF/Output/debug_source.c.tmp - <
/home/yhs/work/llvm/test/CodeGen/BPF/debug_source.c
/home/yhs/work/llvm/build/./bin/llvm-objdump -S
/home/yhs/work/llvm/build/test/CodeGen/BPF/Output/debug_source.c.tmp |
/home/yhs/work/llvm/build/./bin/FileCheck /home/yhs/work/llvm
/test/CodeGen/BPF/debug_source.c
clang -g -target bpfeb -O2 -c -x c -o
/home/yhs/work/llvm/build/test/CodeGen/BPF/Output/debug_source.c.tmp - <
/home/yhs/work/llvm/test/CodeGen/BPF/debug_source.c
/home/yhs/work/llvm/build/./bin/llvm-objdump -S
/home/yhs/work/llvm/build/test/CodeGen/BPF/Output/debug_source.c.tmp |
/home/yhs/work/llvm/build/./bin/FileCheck /home/yhs/work/llvm
/test/CodeGen/BPF/debug_source.c
--
Exit Code: 1

Command Output (stderr):
--
/home/yhs/work/llvm/test/CodeGen/BPF/debug_source.c:6:11: error: expected
string not found in input
// CHECK: file format ELF64-BPF
          ^
<stdin>:2:1: note: scanning from here
/home/yhs/work/llvm/build/test/CodeGen/BPF/Output/debug_source.c.tmp: file
format ELF64-BPF
^
<stdin>:2:22: note: possible intended match here
/home/yhs/work/llvm/build/test/CodeGen/BPF/Output/debug_source.c.tmp: file
format ELF64-BPF
                     ^
/home/yhs/work/llvm/test/CodeGen/BPF/debug_source.c:8:11: error: expected
string not found in input
// CHECK: int test(int *p) {
          ^
<stdin>:2:31: note: scanning from here
/home/yhs/work/llvm/build/test/CodeGen/BPF/Output/debug_source.c.tmp: file
format ELF64-BPF
                              ^
<stdin>:4:11: note: possible intended match here
Disassembly of section .text:
          ^

--

********************
Testing Time: 0.12s
********************
Failing Tests (1):
    LLVM :: CodeGen/BPF/debug_source.c

  Unexpected Failures: 1
[~/work/llvm/test/CodeGen/BPF] cat debug_source.c
// RUN: clang -g -target bpfel -O2 -c -x c -o %t - < %s
// RUN: llvm-objdump -S %t | FileCheck %s
// RUN: clang -g -target bpfeb -O2 -c -x c -o %t - < %s
// RUN: llvm-objdump -S %t | FileCheck %s

// CHECK: file format ELF64-BPF
// CHECK-LABEL: test
// CHECK: int test(int *p) {
int test(int *p) {
// CHECK: *p = 2;
  *p = 2;
// CHECK: return 1;
  return 1;
}
[~/work/llvm/test/CodeGen/BPF]</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>