1 // UNSUPPORTED: target=aarch64{{.*}}, target=arm64{{.*}}
2 // RUN: mlir-cpu-runner %s -e entry -entry-point-result=void \
3 // RUN: -shared-libs=%mlir_c_runner_utils | \
6 // Test that the `ctor` executes before `entry` and that `dtor` executes last.
8 llvm.func @printNewline()
9 llvm.func @printI64(i64)
10 llvm.mlir.global_ctors {ctors = [@ctor], priorities = [0 : i32]}
11 llvm.mlir.global_dtors {dtors = [@dtor], priorities = [0 : i32]}
13 %0 = llvm.mlir.constant(1 : i64) : i64
14 llvm.call @printI64(%0) : (i64) -> ()
15 llvm.call @printNewline() : () -> ()
20 %0 = llvm.mlir.constant(2 : i64) : i64
21 llvm.call @printI64(%0) : (i64) -> ()
22 llvm.call @printNewline() : () -> ()
27 %0 = llvm.mlir.constant(3 : i64) : i64
28 llvm.call @printI64(%0) : (i64) -> ()
29 llvm.call @printNewline() : () -> ()