OLD | NEW |
1 ; We expect these symbol names to be removed: | 1 ; We expect these symbol names to be removed: |
2 ; RUN: opt < %s -nacl-expand-ctors -S | not grep llvm.global_ctors | 2 ; RUN: opt < %s -nacl-expand-ctors -S | FileCheck %s -check-prefix=NO_CTORS |
3 ; RUN: opt < %s -nacl-expand-ctors -S | not grep __init_array_end | 3 ; NO_CTORS-NOT: llvm.global.ctors |
4 ; RUN: opt < %s -nacl-expand-ctors -S | not grep __fini_array_end | 4 ; NO_CTORS-NOT: __init_array_end |
| 5 ; NO_CTORS-NOT: __fini_array_end |
5 | 6 |
6 ; RUN: opt < %s -nacl-expand-ctors -S | FileCheck %s | 7 ; RUN: opt < %s -nacl-expand-ctors -S | FileCheck %s |
7 | 8 |
8 @llvm.global_ctors = appending global [3 x { i32, void ()* }] | 9 @llvm.global_ctors = appending global [3 x { i32, void ()* }] |
9 [{ i32, void ()* } { i32 300, void ()* @init_func_A }, | 10 [{ i32, void ()* } { i32 300, void ()* @init_func_A }, |
10 { i32, void ()* } { i32 100, void ()* @init_func_B }, | 11 { i32, void ()* } { i32 100, void ()* @init_func_B }, |
11 { i32, void ()* } { i32 200, void ()* @init_func_C }] | 12 { i32, void ()* } { i32 200, void ()* @init_func_C }] |
12 | 13 |
13 @__init_array_start = extern_weak global [0 x void ()*] | 14 @__init_array_start = extern_weak global [0 x void ()*] |
14 @__init_array_end = extern_weak global [0 x void ()*] | 15 @__init_array_end = extern_weak global [0 x void ()*] |
(...skipping 12 matching lines...) Expand all Loading... |
27 ; CHECK: ret {{.*}} @__init_array_start | 28 ; CHECK: ret {{.*}} @__init_array_start |
28 | 29 |
29 define [0 x void ()*]* @get_array_end() { | 30 define [0 x void ()*]* @get_array_end() { |
30 ret [0 x void ()*]* @__init_array_end; | 31 ret [0 x void ()*]* @__init_array_end; |
31 } | 32 } |
32 | 33 |
33 ; @get_array_end() is converted to use a GetElementPtr that returns | 34 ; @get_array_end() is converted to use a GetElementPtr that returns |
34 ; the end of the generated array: | 35 ; the end of the generated array: |
35 ; CHECK: @get_array_end() | 36 ; CHECK: @get_array_end() |
36 ; CHECK: ret {{.*}} bitcast ([3 x void ()*]* getelementptr inbounds ([3 x void (
)*]* @__init_array_start, i32 1) | 37 ; CHECK: ret {{.*}} bitcast ([3 x void ()*]* getelementptr inbounds ([3 x void (
)*]* @__init_array_start, i32 1) |
OLD | NEW |