<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59739>59739</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLVMExegesisTests fails (but unable to suppress) on VM
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          chapuni
      </td>
    </tr>
</table>

<pre>
    LLVM can be built but `check-llvm` fails.

* `HAVE_LIBPFM` (`libpfm4-dev` is installed on Ubuntu amd64 or aarch64)
* `LLVM_ENABLE_LIBPFM=OFF` is **not specified**
* `LLVM_ENABLE_ASSERTIONS=ON`
* In the VM that doesn't allow accessing performance counters (I can see on AWS c6a and c7g)

```
[ RUN      ] PerfHelperTest.FunctionalTest
--
  | Unable to open event. ERRNO: Permission denied. Make sure your kernel allows user space perf monitoring.
  | You may want to try:
  | $ sudo sh -c 'echo -1 > /proc/sys/kernel/perf_event_paranoid'
  | llvm_exegesis_tests: external/llvm-project/llvm/tools/llvm-exegesis/lib/PerfHelper.cpp:111: llvm::exegesis::pfm::Counter::Counter(llvm::exegesis::pfm::PerfEvent &&): Assertion `FileDescriptor != -1 && "Unable to open event"' failed.
```

Could we have an option to detect incompatibilities and skip this test? I would like just to build and ship binaries with `HAVE_LIBPFM`.

See also https://github.com/llvm/llvm-project/commit/f92ae6dd300794b5ca6796290716436675be8007
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVFFP4zoT_TXuy6hV4qRJ_dCHQBstErArWPj0PVWOM2m8OHbkcWD591dOC4jLXl3dKrI6zpzjmfHJkUT6aBG3bH3B1ruFnELv_Fb1cpysXjSufd1eXz_egJIWGoRm0iZAMwVgRaJ6VE9LY54HViTQSW1oxZIdS6rzyquY9q163B-ury5-1Dcxj_ENKxKjm7Eb8mWLz3FTE2hLQRqDLTgLD81kwwRyaIscnAcpveq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