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

Side by Side Diff: tests_lit/llvm2ice_tests/mangle.ll

Issue 265703002: Add Om1 lowering with no optimizations (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Add frem test; add LOWERING.rst file Created 6 years, 7 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
OLDNEW
(Empty)
1 ; Tests the Subzero "name mangling" when using the "llvm2ice --prefix"
2 ; option.
3
4 ; RUN: %llvm2ice --verbose none %s | FileCheck %s
5 ; RUN: %llvm2ice --verbose none --prefix Subzero %s | FileCheck --check-prefix=M ANGLE %s
6 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s
7 ; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s
8
9 define internal void @FuncC(i32 %i) {
10 entry:
11 ret void
12 }
13 ; FuncC is a C symbol that isn't recognized as a C++ mangled symbol.
14 ; CHECK: FuncC:
15 ; MANGLE: SubzeroFuncC
16
17 define internal void @_ZN13TestNamespace4FuncEi(i32 %i) {
18 entry:
19 ret void
20 }
21 ; This is Func(int) nested inside namespace TestNamespace.
22 ; CHECK: _ZN13TestNamespace4FuncEi:
23 ; MANGLE: _ZN7Subzero13TestNamespace4FuncEi:
24
25 define internal void @_ZN13TestNamespace15NestedNamespace4FuncEi(i32 %i) {
26 entry:
27 ret void
28 }
29 ; This is Func(int) nested inside two namespaces.
30 ; CHECK: _ZN13TestNamespace15NestedNamespace4FuncEi:
31 ; MANGLE: _ZN7Subzero13TestNamespace15NestedNamespace4FuncEi:
32
33 define internal void @_Z13FuncCPlusPlusi(i32 %i) {
34 entry:
35 ret void
36 }
37 ; This is a non-nested, mangled C++ symbol.
38 ; CHECK: _Z13FuncCPlusPlusi:
39 ; MANGLE: _ZN7Subzero13FuncCPlusPlusEi:
40
41 define internal void @_ZN12_GLOBAL__N_18FuncAnonEi(i32 %i) {
42 entry:
43 ret void
44 }
45 ; This is FuncAnon(int) nested inside an anonymous namespace.
46 ; CHECK: _ZN12_GLOBAL__N_18FuncAnonEi:
47 ; MANGLE: _ZN7Subzero12_GLOBAL__N_18FuncAnonEi:
48
49 ; Now for the illegitimate examples.
50
51 ; Test for _ZN with no suffix. Don't crash, prepend Subzero.
52 define internal void @_ZN(i32 %i) {
53 entry:
54 ret void
55 }
56 ; MANGLE: Subzero_ZN:
57
58 ; Test for _Z<len><str> where <len> is smaller than it should be.
59 define internal void @_Z12FuncCPlusPlusi(i32 %i) {
60 entry:
61 ret void
62 }
63 ; MANGLE: _ZN7Subzero12FuncCPlusPluEsi:
64
65 ; Test for _Z<len><str> where <len> is slightly larger than it should be.
66 define internal void @_Z14FuncCPlusPlusi(i32 %i) {
67 entry:
68 ret void
69 }
70 ; MANGLE: _ZN7Subzero14FuncCPlusPlusiE:
71
72 ; Test for _Z<len><str> where <len> is much larger than it should be.
73 define internal void @_Z114FuncCPlusPlusi(i32 %i) {
74 entry:
75 ret void
76 }
77 ; MANGLE: Subzero_Z114FuncCPlusPlusi:
78
79 ; Test for _Z<len><str> where we try to overflow the uint32_t holding <len>.
80 define internal void @_Z4294967296FuncCPlusPlusi(i32 %i) {
81 entry:
82 ret void
83 }
84 ; MANGLE: Subzero_Z4294967296FuncCPlusPlusi:
85
86 ; Test for _Z<len><str> where <len> is 0.
87 define internal void @_Z0FuncCPlusPlusi(i32 %i) {
88 entry:
89 ret void
90 }
91 ; MANGLE: _ZN7Subzero0EFuncCPlusPlusi:
92
93 ; Test for _Z<len><str> where <len> is -1. LLVM explicitly allows the
94 ; '-' character in identifiers.
95
96 define internal void @_Z-1FuncCPlusPlusi(i32 %i) {
97 entry:
98 ret void
99 }
100 ; MANGLE: Subzero_Z-1FuncCPlusPlusi:
101
102 ; ERRORS-NOT: ICE translation error
103 ; DUMP-NOT: SZ
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698