annotate test/CodeGen/BPF/rodata_1.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 ; RUN: llc < %s -march=bpfel -verify-machineinstrs | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ; RUN: llc < %s -march=bpfeb -verify-machineinstrs | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ; Source code:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; struct test_t1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 ; char a, b, c;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 ; };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 ; struct test_t2 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 ; int a, b, c, d, e;
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 g1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 ; struct test_t2 g2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 ; int test()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 ; {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 ; struct test_t1 t1 = {.c = 1};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 ; struct test_t2 t2 = {.c = 1};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 ; g1 = t1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 ; g2 = t2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 ; return 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 ; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 %struct.test_t1 = type { i8, i8, i8 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 %struct.test_t2 = type { i32, i32, i32, i32, i32 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 @test.t1 = private unnamed_addr constant %struct.test_t1 { i8 0, i8 0, i8 1 }, align 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 @test.t2 = private unnamed_addr constant %struct.test_t2 { i32 0, i32 0, i32 1, i32 0, i32 0 }, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 @g1 = common local_unnamed_addr global %struct.test_t1 zeroinitializer, align 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 @g2 = common local_unnamed_addr global %struct.test_t2 zeroinitializer, align 4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 ; Function Attrs: nounwind
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 define i32 @test() local_unnamed_addr #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 ; CHECK-LABEL: test:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds (%struct.test_t1, %struct.test_t1* @g1, i64 0, i32 0), i8* getelementptr inbounds (%struct.test_t1, %struct.test_t1* @test.t1, i64 0, i32 0), i64 3, i32 1, i1 false)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.test_t2* @g2 to i8*), i8* bitcast (%struct.test_t2* @test.t2 to i8*), i64 20, i32 4, i1 false)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 ; CHECK: r1 = g1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 ; CHECK: r2 = 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 ; CHECK: *(u8 *)(r1 + 1) = r2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 ; CHECK: r3 = 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 ; CHECK: *(u8 *)(r1 + 2) = r3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 ; CHECK: r1 = g2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 ; CHECK: *(u32 *)(r1 + 8) = r3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 ret i32 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ; CHECK: .section .rodata,"a",@progbits
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 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
50
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 attributes #0 = { nounwind }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 attributes #1 = { argmemonly nounwind }