1 ; RUN: llc --mtriple=loongarch64 --stop-after loongarch-prera-expand-pseudo \
2 ; RUN: --relocation-model=pic %s -o %t.mir
3 ; RUN: llc --mtriple=loongarch64 --run-pass loongarch-prera-expand-pseudo \
4 ; RUN: %t.mir -o - | FileCheck %s
6 ;; This tests the LoongArch-specific serialization and deserialization of
9 @g_e = external global i32
10 @g_i = internal global i32 0
11 @t_un = external thread_local global i32
12 @t_ld = external thread_local(localdynamic) global i32
13 @t_ie = external thread_local(initialexec) global i32
14 @t_le = external thread_local(localexec) global i32
16 declare void @callee1() nounwind
17 declare dso_local void @callee2() nounwind
19 define void @caller() nounwind {
20 ; CHECK-LABEL: name: caller
21 ; CHECK: target-flags(loongarch-got-pc-hi) @g_e
22 ; CHECK-NEXT: target-flags(loongarch-got-pc-lo) @g_e
23 ; CHECK: target-flags(loongarch-pcrel-hi) @g_i
24 ; CHECK-NEXT: target-flags(loongarch-pcrel-lo) @g_i
25 ; CHECK: target-flags(loongarch-gd-pc-hi) @t_un
26 ; CHECK-NEXT: target-flags(loongarch-got-pc-lo) @t_un
27 ; CHECK: target-flags(loongarch-ld-pc-hi) @t_ld
28 ; CHECK-NEXT: target-flags(loongarch-got-pc-lo) @t_ld
29 ; CHECK: target-flags(loongarch-ie-pc-hi) @t_ie
30 ; CHECK-NEXT: target-flags(loongarch-ie-pc-lo) @t_ie
31 ; CHECK: target-flags(loongarch-le-hi) @t_le
32 ; CHECK-NEXT: target-flags(loongarch-le-lo) @t_le
33 ; CHECK: target-flags(loongarch-call-plt) @callee1
34 ; CHECK: target-flags(loongarch-call) @callee2
35 %a = load volatile i32, ptr @g_e
36 %b = load volatile i32, ptr @g_i
37 %c = load volatile i32, ptr @t_un
38 %d = load volatile i32, ptr @t_ld
39 %e = load volatile i32, ptr @t_ie
40 %f = load volatile i32, ptr @t_le