29 lines · plain
1; RUN: rm -rf %t2; RUN: mkdir -p %t3; RUN: lli -jit-kind=orc-lazy -enable-cache-manager -object-cache-dir=%t %s4; RUN: lli -jit-kind=orc-lazy -enable-cache-manager -object-cache-dir=%t %s5;6; Verify that LLJIT Platforms respect static initializers in cached objects.7; This IR file contains a static initializer that must execute for main to exit8; with value zero. The first execution will populate an object cache for the9; second. The initializer in the cached objects must also be successfully run10; for the test to pass.11 12@HasError = global i8 1, align 113@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @resetHasError, ptr null }]14 15define void @resetHasError() {16entry:17 store i8 0, ptr @HasError, align 118 ret void19}20 21define i32 @main(i32 %argc, ptr %argv) #2 {22entry:23 %0 = load i8, ptr @HasError, align 124 %tobool = trunc i8 %0 to i125 %conv = zext i1 %tobool to i3226 ret i32 %conv27}28 29