Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: tests_lit/llvm2ice_tests/nacl-other-intrinsics.ll

Issue 1531623007: Add option to force filetype=asm for testing (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Formatting Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 ; This tests the NaCl intrinsics not related to atomic operations. 1 ; This tests the NaCl intrinsics not related to atomic operations.
2 2
3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
4 ; RUN: --target x8632 -i %s --args -O2 -sandbox \ 4 ; RUN: --target x8632 --sandbox -i %s --args -O2 \
5 ; RUN: -allow-externally-defined-symbols \ 5 ; RUN: -allow-externally-defined-symbols \
6 ; RUN: | %if --need=target_X8632 --command FileCheck %s 6 ; RUN: | %if --need=target_X8632 --command FileCheck %s
7 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 7 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
8 ; RUN: --target x8632 -i %s --args -Om1 -sandbox \ 8 ; RUN: --target x8632 --sandbox -i %s --args -Om1 \
9 ; RUN: -allow-externally-defined-symbols \ 9 ; RUN: -allow-externally-defined-symbols \
10 ; RUN: | %if --need=target_X8632 --command FileCheck %s 10 ; RUN: | %if --need=target_X8632 --command FileCheck %s
11 11
12 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1 12 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1
13 ; share the same "CHECK" prefix). This separate run helps check that 13 ; share the same "CHECK" prefix). This separate run helps check that
14 ; some code is optimized out. 14 ; some code is optimized out.
15 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 15 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
16 ; RUN: --target x8632 -i %s --args -O2 -sandbox \ 16 ; RUN: --target x8632 --sandbox -i %s --args -O2 \
17 ; RUN: -allow-externally-defined-symbols \ 17 ; RUN: -allow-externally-defined-symbols \
18 ; RUN: | %if --need=target_X8632 \ 18 ; RUN: | %if --need=target_X8632 \
19 ; RUN: --command FileCheck --check-prefix=CHECKO2REM %s 19 ; RUN: --command FileCheck --check-prefix=CHECKO2REM %s
20 20
21 ; Do O2 runs without -sandbox to make sure llvm.nacl.read.tp gets 21 ; Do O2 runs without -sandbox to make sure llvm.nacl.read.tp gets
22 ; lowered to __nacl_read_tp instead of gs:0x0. 22 ; lowered to __nacl_read_tp instead of gs:0x0.
23 ; We also know that because it's O2, it'll have the O2REM optimizations. 23 ; We also know that because it's O2, it'll have the O2REM optimizations.
24 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 24 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
25 ; RUN: --target x8632 -i %s --args -O2 \ 25 ; RUN: --target x8632 -i %s --args -O2 \
26 ; RUN: -allow-externally-defined-symbols \ 26 ; RUN: -allow-externally-defined-symbols \
(...skipping 28 matching lines...) Expand all
55 declare i8* @llvm.stacksave() 55 declare i8* @llvm.stacksave()
56 declare void @llvm.stackrestore(i8*) 56 declare void @llvm.stackrestore(i8*)
57 57
58 define internal i32 @test_nacl_read_tp() { 58 define internal i32 @test_nacl_read_tp() {
59 entry: 59 entry:
60 %ptr = call i8* @llvm.nacl.read.tp() 60 %ptr = call i8* @llvm.nacl.read.tp()
61 %__1 = ptrtoint i8* %ptr to i32 61 %__1 = ptrtoint i8* %ptr to i32
62 ret i32 %__1 62 ret i32 %__1
63 } 63 }
64 ; CHECK-LABEL: test_nacl_read_tp 64 ; CHECK-LABEL: test_nacl_read_tp
65 ; CHECK: mov e{{.*}},DWORD PTR gs:0x0 65 ; CHECK: mov e{{.*}},{{(DWORD PTR )?}}gs:0x0
66 ; CHECKO2REM-LABEL: test_nacl_read_tp 66 ; CHECKO2REM-LABEL: test_nacl_read_tp
67 ; CHECKO2REM: mov e{{.*}},DWORD PTR gs:0x0 67 ; CHECKO2REM: mov e{{.*}},{{(DWORD PTR )?}}gs:0x0
68 ; CHECKO2UNSANDBOXEDREM-LABEL: test_nacl_read_tp 68 ; CHECKO2UNSANDBOXEDREM-LABEL: test_nacl_read_tp
69 ; CHECKO2UNSANDBOXEDREM: call {{.*}} R_{{.*}} __nacl_read_tp 69 ; CHECKO2UNSANDBOXEDREM: call {{.*}} R_{{.*}} __nacl_read_tp
70 70
71 define internal i32 @test_nacl_read_tp_more_addressing() { 71 define internal i32 @test_nacl_read_tp_more_addressing() {
72 entry: 72 entry:
73 %ptr = call i8* @llvm.nacl.read.tp() 73 %ptr = call i8* @llvm.nacl.read.tp()
74 %__1 = ptrtoint i8* %ptr to i32 74 %__1 = ptrtoint i8* %ptr to i32
75 %x = add i32 %__1, %__1 75 %x = add i32 %__1, %__1
76 %__3 = inttoptr i32 %x to i32* 76 %__3 = inttoptr i32 %x to i32*
77 %v = load i32, i32* %__3, align 1 77 %v = load i32, i32* %__3, align 1
78 %v_add = add i32 %v, 1 78 %v_add = add i32 %v, 1
79 79
80 %ptr2 = call i8* @llvm.nacl.read.tp() 80 %ptr2 = call i8* @llvm.nacl.read.tp()
81 %__6 = ptrtoint i8* %ptr2 to i32 81 %__6 = ptrtoint i8* %ptr2 to i32
82 %y = add i32 %__6, 4 82 %y = add i32 %__6, 4
83 %__8 = inttoptr i32 %y to i32* 83 %__8 = inttoptr i32 %y to i32*
84 %v_add2 = add i32 %v, 4 84 %v_add2 = add i32 %v, 4
85 store i32 %v_add2, i32* %__8, align 1 85 store i32 %v_add2, i32* %__8, align 1
86 ret i32 %v 86 ret i32 %v
87 } 87 }
88 ; CHECK-LABEL: test_nacl_read_tp_more_addressing 88 ; CHECK-LABEL: test_nacl_read_tp_more_addressing
89 ; CHECK: mov e{{.*}},DWORD PTR gs:0x0 89 ; CHECK: mov e{{.*}},{{(DWORD PTR )?}}gs:0x0
90 ; CHECK: mov e{{.*}},DWORD PTR gs:0x0 90 ; CHECK: mov e{{.*}},{{(DWORD PTR )?}}gs:0x0
91 ; CHECKO2REM-LABEL: test_nacl_read_tp_more_addressing 91 ; CHECKO2REM-LABEL: test_nacl_read_tp_more_addressing
92 ; CHECKO2REM: mov e{{.*}},DWORD PTR gs:0x0 92 ; CHECKO2REM: mov e{{.*}},{{(DWORD PTR )?}}gs:0x0
93 ; CHECKO2REM: mov e{{.*}},DWORD PTR gs:0x0 93 ; CHECKO2REM: mov e{{.*}},{{(DWORD PTR )?}}gs:0x0
94 ; CHECKO2UNSANDBOXEDREM-LABEL: test_nacl_read_tp_more_addressing 94 ; CHECKO2UNSANDBOXEDREM-LABEL: test_nacl_read_tp_more_addressing
95 ; CHECKO2UNSANDBOXEDREM: call {{.*}} R_{{.*}} __nacl_read_tp 95 ; CHECKO2UNSANDBOXEDREM: call {{.*}} R_{{.*}} __nacl_read_tp
96 ; CHECKO2UNSANDBOXEDREM: call {{.*}} R_{{.*}} __nacl_read_tp 96 ; CHECKO2UNSANDBOXEDREM: call {{.*}} R_{{.*}} __nacl_read_tp
97 97
98 define internal i32 @test_nacl_read_tp_dead(i32 %a) { 98 define internal i32 @test_nacl_read_tp_dead(i32 %a) {
99 entry: 99 entry:
100 %ptr = call i8* @llvm.nacl.read.tp() 100 %ptr = call i8* @llvm.nacl.read.tp()
101 ; Not actually using the result of nacl read tp call. 101 ; Not actually using the result of nacl read tp call.
102 ; In O2 mode this should be DCE'ed. 102 ; In O2 mode this should be DCE'ed.
103 ret i32 %a 103 ret i32 %a
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 ; CHECK: lea {{.*}},[esp+0x10] 547 ; CHECK: lea {{.*}},[esp+0x10]
548 ; CHECK: lea {{.*}},[esp+0x10] 548 ; CHECK: lea {{.*}},[esp+0x10]
549 ; CHECK: call 549 ; CHECK: call
550 ; CHECK: mov esp,{{.*}} 550 ; CHECK: mov esp,{{.*}}
551 ; CHECK: mov esp,ebp 551 ; CHECK: mov esp,ebp
552 ; ARM32-LABEL: test_stacksave_multiple 552 ; ARM32-LABEL: test_stacksave_multiple
553 ; ARM32: mov {{.*}}, sp 553 ; ARM32: mov {{.*}}, sp
554 ; ARM32: mov {{.*}}, sp 554 ; ARM32: mov {{.*}}, sp
555 ; ARM32: mov {{.*}}, sp 555 ; ARM32: mov {{.*}}, sp
556 ; ARM32: mov sp, {{.*}} 556 ; ARM32: mov sp, {{.*}}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698