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

Side by Side Diff: test/NaCl/X86/nacl-read-tp-intrinsic.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 9 months 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
« no previous file with comments | « test/NaCl/X86/nacl-calls.ll ('k') | test/NaCl/X86/nacl-setlongjmp-intrinsics.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ; RUN: pnacl-llc -mtriple=i386-unknown-nacl -filetype=asm %s -o - \
2 ; RUN: | FileCheck -check-prefix=X32 %s
3
4 ; RUN: pnacl-llc -mtriple=i386-unknown-nacl -filetype=asm -mtls-use-call %s -o - \
5 ; RUN: | FileCheck -check-prefix=USE_CALL %s
6
7 ; RUN: pnacl-llc -mtriple=x86_64-unknown-nacl -filetype=asm %s -o - \
8 ; RUN: | FileCheck -check-prefix=USE_CALL %s
9
10 ; "-mtls-use-call" should not make any difference on x86-64.
11 ; RUN: pnacl-llc -mtriple=x86_64-unknown-nacl -filetype=asm -mtls-use-call %s -o - \
12 ; RUN: | FileCheck -check-prefix=USE_CALL %s
13
14
15 declare i8* @llvm.nacl.read.tp()
16
17 define i8* @get_thread_pointer() {
18 %tp = call i8* @llvm.nacl.read.tp()
19 ret i8* %tp
20 }
21
22 ; X32: get_thread_pointer:
23 ; X32: movl %gs:0, %eax
24
25 ; USE_CALL: get_thread_pointer:
26 ; USE_CALL: call{{[lq]?}} __nacl_read_tp
27
28
29 ; Make sure that we do not generate:
30 ; movl $1000, %eax
31 ; addl %gs:0, %eax
32 ; The x86-32 NaCl validator only accepts %gs with "mov", not with
33 ; "add". Note that we had to use a large immediate to trigger the bug
34 ; and generate the code above.
35 define i8* @get_thread_pointer_add() {
36 %tp = call i8* @llvm.nacl.read.tp()
37 %result = getelementptr i8* %tp, i32 1000
38 ret i8* %result
39 }
40
41 ; X32: get_thread_pointer_add:
42 ; X32: movl %gs:0, %eax
43 ; X32: addl $1000, %eax
OLDNEW
« no previous file with comments | « test/NaCl/X86/nacl-calls.ll ('k') | test/NaCl/X86/nacl-setlongjmp-intrinsics.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698