1 // Test that __orc_rt_macho_jit_dlopen resets the state of the data sections.
3 // RUN: %clang -c -o %t.main.o %p/Inputs/dlopen-dlclose-x2.S
4 // RUN: %clang -c -o %t.inits.o %s
5 // RUN: %llvm_jitlink \
6 // RUN: -alias _dlopen=___orc_rt_macho_jit_dlopen \
7 // RUN: -alias _dlclose=___orc_rt_macho_jit_dlclose \
8 // RUN: %t.main.o -jd inits %t.inits.o -lmain | FileCheck %s
10 // CHECK: entering main
11 // CHECK-NEXT: X = 1, Y = 2
12 // CHECK-NEXT: X = 1, Y = 2
13 // CHECK-NEXT: leaving main
15 .section __TEXT,__text,regular,pure_instructions
16 .build_version macos, 13, 0 sdk_version 13, 0
17 .section __TEXT,__StaticInit,regular,pure_instructions
26 leaq L_.str(%rip), %rdi
30 .section __TEXT,__cstring,cstring_literals
32 .asciz "X = %zu, Y = %zu\n"
35 .zerofill __DATA,__common,_X,8,3
36 .section __DATA,__data
42 .section __DATA,__mod_init_func,mod_init_funcs
46 .subsections_via_symbols