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

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: Merge changed from Karl's committed CL 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
« no previous file with comments | « tests_lit/llvm2ice_tests/load.ll ('k') | tests_lit/llvm2ice_tests/return-int-arg.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 ; 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: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s
8 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \
9 ; RUN: | FileCheck --check-prefix=DUMP %s
10
11 define internal void @FuncC(i32 %i) {
12 entry:
13 ret void
14 }
15 ; FuncC is a C symbol that isn't recognized as a C++ mangled symbol.
16 ; CHECK: FuncC:
17 ; MANGLE: SubzeroFuncC
18
19 define internal void @_ZN13TestNamespace4FuncEi(i32 %i) {
20 entry:
21 ret void
22 }
23 ; This is Func(int) nested inside namespace TestNamespace.
24 ; CHECK: _ZN13TestNamespace4FuncEi:
25 ; MANGLE: _ZN7Subzero13TestNamespace4FuncEi:
26
27 define internal void @_ZN13TestNamespace15NestedNamespace4FuncEi(i32 %i) {
28 entry:
29 ret void
30 }
31 ; This is Func(int) nested inside two namespaces.
32 ; CHECK: _ZN13TestNamespace15NestedNamespace4FuncEi:
33 ; MANGLE: _ZN7Subzero13TestNamespace15NestedNamespace4FuncEi:
34
35 define internal void @_Z13FuncCPlusPlusi(i32 %i) {
36 entry:
37 ret void
38 }
39 ; This is a non-nested, mangled C++ symbol.
40 ; CHECK: _Z13FuncCPlusPlusi:
41 ; MANGLE: _ZN7Subzero13FuncCPlusPlusEi:
42
43 define internal void @_ZN12_GLOBAL__N_18FuncAnonEi(i32 %i) {
44 entry:
45 ret void
46 }
47 ; This is FuncAnon(int) nested inside an anonymous namespace.
48 ; CHECK: _ZN12_GLOBAL__N_18FuncAnonEi:
49 ; MANGLE: _ZN7Subzero12_GLOBAL__N_18FuncAnonEi:
50
51 ; Now for the illegitimate examples.
52
53 ; Test for _ZN with no suffix. Don't crash, prepend Subzero.
54 define internal void @_ZN(i32 %i) {
55 entry:
56 ret void
57 }
58 ; MANGLE: Subzero_ZN:
59
60 ; Test for _Z<len><str> where <len> is smaller than it should be.
61 define internal void @_Z12FuncCPlusPlusi(i32 %i) {
62 entry:
63 ret void
64 }
65 ; MANGLE: _ZN7Subzero12FuncCPlusPluEsi:
66
67 ; Test for _Z<len><str> where <len> is slightly larger than it should be.
68 define internal void @_Z14FuncCPlusPlusi(i32 %i) {
69 entry:
70 ret void
71 }
72 ; MANGLE: _ZN7Subzero14FuncCPlusPlusiE:
73
74 ; Test for _Z<len><str> where <len> is much larger than it should be.
75 define internal void @_Z114FuncCPlusPlusi(i32 %i) {
76 entry:
77 ret void
78 }
79 ; MANGLE: Subzero_Z114FuncCPlusPlusi:
80
81 ; Test for _Z<len><str> where we try to overflow the uint32_t holding <len>.
82 define internal void @_Z4294967296FuncCPlusPlusi(i32 %i) {
83 entry:
84 ret void
85 }
86 ; MANGLE: Subzero_Z4294967296FuncCPlusPlusi:
87
88 ; Test for _Z<len><str> where <len> is 0.
89 define internal void @_Z0FuncCPlusPlusi(i32 %i) {
90 entry:
91 ret void
92 }
93 ; MANGLE: _ZN7Subzero0EFuncCPlusPlusi:
94
95 ; Test for _Z<len><str> where <len> is -1. LLVM explicitly allows the
96 ; '-' character in identifiers.
97
98 define internal void @_Z-1FuncCPlusPlusi(i32 %i) {
99 entry:
100 ret void
101 }
102 ; MANGLE: Subzero_Z-1FuncCPlusPlusi:
103
104 ; ERRORS-NOT: ICE translation error
105 ; DUMP-NOT: SZ
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/load.ll ('k') | tests_lit/llvm2ice_tests/return-int-arg.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698