OLD | NEW |
1 ; RUN: opt < %s -nacl-expand-tls -S | FileCheck %s | 1 ; RUN: opt < %s -nacl-expand-tls -S | FileCheck %s |
2 | 2 |
3 ; All thread-local variables should be removed | 3 ; All thread-local variables should be removed |
4 ; RUN: opt < %s -nacl-expand-tls -S | not grep thread_local | 4 ; RUN: opt < %s -nacl-expand-tls -S | FileCheck %s -check-prefix=NO_TLS |
5 | 5 |
| 6 ; NO_TLS-NOT: thread_local |
6 | 7 |
7 @tvar1 = thread_local global i64 123 | 8 @tvar1 = thread_local global i64 123 |
8 @tvar2 = thread_local global i32 456 | 9 @tvar2 = thread_local global i32 456 |
9 | 10 |
10 | 11 |
11 ; CHECK: %tls_init_template = type <{ i64, i32 }> | 12 ; CHECK: %tls_init_template = type <{ i64, i32 }> |
12 ; CHECK: %tls_struct = type <{ %tls_init_template, %tls_bss_template }> | 13 ; CHECK: %tls_struct = type <{ %tls_init_template, %tls_bss_template }> |
13 ; CHECK: %tls_bss_template = type <{ [4 x i8] }> | 14 ; CHECK: %tls_bss_template = type <{ [4 x i8] }> |
14 | 15 |
15 | 16 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 declare i32 @llvm.nacl.tp.tls.offset(i32) | 67 declare i32 @llvm.nacl.tp.tls.offset(i32) |
67 declare i32 @llvm.nacl.tp.tdb.offset(i32) | 68 declare i32 @llvm.nacl.tp.tdb.offset(i32) |
68 | 69 |
69 define i32 @test_get_tp_tls_offset(i32 %tls_size) { | 70 define i32 @test_get_tp_tls_offset(i32 %tls_size) { |
70 %offset = call i32 @llvm.nacl.tp.tls.offset(i32 %tls_size) | 71 %offset = call i32 @llvm.nacl.tp.tls.offset(i32 %tls_size) |
71 ret i32 %offset | 72 ret i32 %offset |
72 } | 73 } |
73 ; Uses of the intrinsic are replaced with uses of a regular function. | 74 ; Uses of the intrinsic are replaced with uses of a regular function. |
74 ; CHECK: define i32 @test_get_tp_tls_offset | 75 ; CHECK: define i32 @test_get_tp_tls_offset |
75 ; CHECK: call i32 @nacl_tp_tls_offset | 76 ; CHECK: call i32 @nacl_tp_tls_offset |
76 ; RUN: opt < %s -nacl-expand-tls -S | not grep llvm.nacl.tp.tls.offset | 77 ; NO_TLS-NOT: llvm.nacl.tp.tls.offset |
77 | 78 |
78 define i32 @test_get_tp_tdb_offset(i32 %tdb_size) { | 79 define i32 @test_get_tp_tdb_offset(i32 %tdb_size) { |
79 %offset = call i32 @llvm.nacl.tp.tdb.offset(i32 %tdb_size) | 80 %offset = call i32 @llvm.nacl.tp.tdb.offset(i32 %tdb_size) |
80 ret i32 %offset | 81 ret i32 %offset |
81 } | 82 } |
82 ; Uses of the intrinsic are replaced with uses of a regular function. | 83 ; Uses of the intrinsic are replaced with uses of a regular function. |
83 ; CHECK: define i32 @test_get_tp_tdb_offset | 84 ; CHECK: define i32 @test_get_tp_tdb_offset |
84 ; CHECK: call i32 @nacl_tp_tdb_offset | 85 ; CHECK: call i32 @nacl_tp_tdb_offset |
85 ; RUN: opt < %s -nacl-expand-tls -S | not grep llvm.nacl.tp.tdb.offset | 86 ; NO_TLS-NOT: llvm.nacl.tp.tdb.offset |
OLD | NEW |