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

Side by Side Diff: test/NaCl/PNaClABI/abi-flattened-globals.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
OLDNEW
(Empty)
1 ; RUN: not pnacl-abicheck < %s | FileCheck %s
2
3
4 ; Allowed cases
5
6 @bytes = internal global [7 x i8] c"abcdefg"
7
8 @ptr_to_ptr = internal global i32 ptrtoint (i32* @ptr to i32)
9 @ptr_to_func = internal global i32 ptrtoint (void ()* @func to i32)
10
11 @compound = internal global <{ [3 x i8], i32 }>
12 <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }>
13
14 @ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32)
15
16 @addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1)
17 @addend_negative = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1)
18
19 @addend_array1 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32) , i32 1)
20 @addend_array2 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32) , i32 7)
21 @addend_array3 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32) , i32 9)
22
23 @addend_struct1 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @c ompound to i32), i32 1)
24 @addend_struct2 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @c ompound to i32), i32 4)
25
26 ; CHECK-NOT: disallowed
27
28
29 ; Disallowed cases
30
31 @bad_external = external global [1 x i8]
32 ; CHECK: Global variable bad_external has no initializer (disallowed)
33
34 @bad_int = internal global i32 0
35 ; CHECK: Global variable bad_int has non-flattened initializer (disallowed): i32 0
36
37 @bad_size = internal global i64 ptrtoint ([7 x i8]* @bytes to i64)
38 ; CHECK: Global variable bad_size has non-flattened initializer
39
40 ; "null" is not allowed.
41 @bad_ptr = internal global i8* null
42 ; CHECK: Global variable bad_ptr has non-flattened initializer
43
44 @bad_ptr2 = internal global i64 ptrtoint (i8* null to i64)
45 ; CHECK: Global variable bad_ptr2 has non-flattened initializer
46
47 @bad_sub = internal global i32 sub (i32 ptrtoint (i32* @ptr to i32), i32 1)
48 ; CHECK: Global variable bad_sub has non-flattened initializer
49
50 ; i16 not allowed here.
51 @bad_compound = internal global <{ i32, i16 }>
52 <{ i32 ptrtoint (void ()* @func to i32), i16 0 }>
53 ; CHECK: Global variable bad_compound has non-flattened initializer
54
55 ; The struct type must be packed.
56 @non_packed_struct = internal global { [3 x i8], i32 }
57 { [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }
58 ; CHECK: Global variable non_packed_struct has non-flattened initializer
59
60 ; The struct type must be anonymous.
61 %struct = type <{ [3 x i8], i32 }>
62 @named_struct = internal global %struct
63 <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }>
64 ; CHECK: Global variable named_struct has non-flattened initializer
65
66
67 define internal void @func() {
68 ret void
69 }
OLDNEW
« no previous file with comments | « test/NaCl/PNaClABI/abi-externals-whitelist-pso.ll ('k') | test/NaCl/PNaClABI/abi-i1-operations.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698