annotate test/CodeGen/BPF/rodata_3.ll @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; REQUIRES: x86_64-linux
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ; RUN: llc < %s -march=bpfel -verify-machineinstrs | FileCheck --check-prefix=CHECK-EL %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 ; RUN: llc < %s -march=bpfeb -verify-machineinstrs | FileCheck --check-prefix=CHECK-EB %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; This test requires little-endian host, so we specific x86_64-linux here.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 ; Source code:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 ; struct test_t1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 ; char a;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 ; int b, c, d;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 ; };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 ; struct test_t1 g;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 ; int test()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 ; {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 ; struct test_t1 t1 = {.a = 1};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 ; g = t1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 ; return 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 ; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 %struct.test_t1 = type { i8, i32, i32, i32 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 @test.t1 = private unnamed_addr constant %struct.test_t1 { i8 1, i32 0, i32 0, i32 0 }, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 @g = common local_unnamed_addr global %struct.test_t1 zeroinitializer, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 ; Function Attrs: nounwind
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 define i32 @test() local_unnamed_addr #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds (%struct.test_t1, %struct.test_t1* @g, i64 0, i32 0), i8* getelementptr inbounds (%struct.test_t1, %struct.test_t1* @test.t1, i64 0, i32 0), i64 16, i32 4, i1 false)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 ; CHECK-EL: r2 = 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 ; CHECK-EL: *(u32 *)(r1 + 0) = r2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 ; CHECK-EB: r2 = 16777216
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 ; CHECK-EB: *(u32 *)(r1 + 0) = r2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 ret i32 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 ; CHECK-EL: .section .rodata.cst16,"aM",@progbits,16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 ; CHECK-EB: .section .rodata.cst16,"aM",@progbits,16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1) #1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 attributes #0 = { nounwind }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 attributes #1 = { argmemonly nounwind }