[docs] Fix build-docs.sh
[llvm-project.git] / compiler-rt / test / orc / TestCases / Darwin / x86-64 / jit-re-dlopen-data-reset.S
blob8582c9ecad752bbc970ad2871daa2d79e2ba1b31
1 // Test that __orc_rt_macho_jit_dlopen resets the state of the data sections.
2 //
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
18         .p2align        4, 0x90
19 _initializer:
20         movq    _X(%rip), %rsi
21         addq    $1, %rsi
22         movq    %rsi, _X(%rip)
23         movq    _Y(%rip), %rdx
24         addq    $1, %rdx
25         movq    %rdx, _Y(%rip)
26         leaq    L_.str(%rip), %rdi
27         xorl    %eax, %eax
28         jmp     _printf
30         .section        __TEXT,__cstring,cstring_literals
31 L_.str:
32         .asciz  "X = %zu, Y = %zu\n"
34         .globl  _X                              ## @X
35 .zerofill __DATA,__common,_X,8,3
36         .section        __DATA,__data
37         .globl  _Y                              ## @Y
38         .p2align        3
39 _Y:
40         .quad   1                               ## 0x1
42         .section        __DATA,__mod_init_func,mod_init_funcs
43         .p2align        3
44         .quad   _initializer
46 .subsections_via_symbols