<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 - @llvm.global_dtors are ignored"
   href="https://bugs.llvm.org/show_bug.cgi?id=52030">52030</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>@llvm.global_dtors are ignored
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>OrcJIT
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>andrzej.warzynski@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>1101.debian@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

I'm trying to run the following code with `lli`. Basically, it's a call to
`@printf` wrapped in `@printf_wrapper` and appended to `@llvm.global_dtors`:

```input.ll
@CounterFor_main = common global i32 0, align 4
@ResultHeaderStrIR = global [18 x i8] c"SOME RANDOM TEXT\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void
()*, i8* } { i32 0, void ()* @printf_wrapper, i8* null }]

; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone ssp
uwtable willreturn
define i32 @main() local_unnamed_addr {
entry:
  ret i32 123
}

; Function Attrs: nounwind
declare i32 @printf(i8* nocapture readonly, ...)

define void @printf_wrapper() {
enter:
  %0 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x
i8]* @ResultHeaderStrIR, i32 0, i32 0))
  ret void
}
```

Here's what I get with MCJIT and which is consistent with what I expect:
```bash
$ lli -jit-kind=mcjit input.ll
SOME RANDOM TEXT
```
However, `lli` defaults to ORCJit and with ORCJit there is not output at all.

Tested on X86 and AArch64, with trunk: 87817bc523daba1d2bd0492144a5d6adba8a649c

Thank you for taking a look!
Andrzej</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>