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

Side by Side Diff: test/NaCl/X86/no-global-in-disp-x86-64.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 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/negative-addend.ll ('k') | test/NaCl/X86/pic-nacl-x8632.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 -O2 -mtriple=x86_64-none-nacl < %s | \
2 ; RUN: FileCheck %s --check-prefix=NACLON
3 ; RUN: pnacl-llc -O2 -mtriple=x86_64-linux < %s | \
4 ; RUN: FileCheck %s --check-prefix=NACLOFF
5
6 ; This test is derived from the following C code:
7 ;
8 ; int myglobal[100];
9 ; void test(int arg)
10 ; {
11 ; myglobal[arg] = arg;
12 ; myglobal[arg+1] = arg;
13 ; }
14 ; int main(int argc, char **argv)
15 ; {
16 ; test(argc);
17 ; }
18 ;
19 ; The goal is NOT to produce an instruction with "myglobal" as the
20 ; displacement value in any addressing mode, e.g. this (bad) instruction:
21 ;
22 ; movl %eax, %nacl:myglobal(%r15,%rax,4)
23 ;
24 ; The NACLOFF test is a canary that tries to ensure that the NACLON test is
25 ; testing the right thing. If the NACLOFF test starts failing, it's likely
26 ; that the LLVM -O2 optimizations are no longer generating the problematic
27 ; pattern that NACLON tests for. In that case, the test should be modified.
28
29
30 @myglobal = global [100 x i32] zeroinitializer, align 4
31
32 define void @test(i32 %arg) #0 {
33 entry:
34 ; NACLON: test:
35 ; NACLON-NOT: mov{{.*}}nacl:myglobal(
36 ; NACLOFF: test:
37 ; NACLOFF: mov{{.*}}myglobal(
38 %arg.addr = alloca i32, align 4
39 store i32 %arg, i32* %arg.addr, align 4
40 %0 = load i32* %arg.addr, align 4
41 %1 = load i32* %arg.addr, align 4
42 %arrayidx = getelementptr inbounds [100 x i32]* @myglobal, i32 0, i32 %1
43 store i32 %0, i32* %arrayidx, align 4
44 %2 = load i32* %arg.addr, align 4
45 %3 = load i32* %arg.addr, align 4
46 %add = add nsw i32 %3, 1
47 %arrayidx1 = getelementptr inbounds [100 x i32]* @myglobal, i32 0, i32 %add
48 store i32 %2, i32* %arrayidx1, align 4
49 ret void
50 }
OLDNEW
« no previous file with comments | « test/NaCl/X86/negative-addend.ll ('k') | test/NaCl/X86/pic-nacl-x8632.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698