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

Side by Side Diff: test/Driver/asmjs-unknown-emscripten.cpp

Issue 1696583002: Remove Emscripten support (Closed) Base URL: https://chromium.googlesource.com/a/native_client/pnacl-clang.git@master
Patch Set: Created 4 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/CodeGenCXX/static-init-emscripten.cpp ('k') | no next file » | 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: %clang -target asmjs-unknown-emscripten -### %s -emit-llvm-only -c 2>&1 | FileCheck %s -check-prefix=ECHO
2 // RUN: %clang -target asmjs-unknown-emscripten %s -emit-llvm -S -c -o - | FileC heck %s
3 // RUN: %clang -target asmjs-unknown-emscripten %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS
4
5 // ECHO: {{.*}} "-cc1" {{.*}}asmjs-unknown-emscripten.c
6
7 typedef __builtin_va_list va_list;
8 typedef __SIZE_TYPE__ size_t;
9 typedef __PTRDIFF_TYPE__ ptrdiff_t;
10
11 extern "C" {
12
13 // CHECK: @align_c = global i32 1
14 int align_c = __alignof(char);
15
16 // CHECK: @align_s = global i32 2
17 int align_s = __alignof(short);
18
19 // CHECK: @align_i = global i32 4
20 int align_i = __alignof(int);
21
22 // CHECK: @align_l = global i32 4
23 int align_l = __alignof(long);
24
25 // CHECK: @align_ll = global i32 8
26 int align_ll = __alignof(long long);
27
28 // CHECK: @align_p = global i32 4
29 int align_p = __alignof(void*);
30
31 // CHECK: @align_f = global i32 4
32 int align_f = __alignof(float);
33
34 // CHECK: @align_d = global i32 8
35 int align_d = __alignof(double);
36
37 // CHECK: @align_ld = global i32 8
38 int align_ld = __alignof(long double);
39
40 // CHECK: @align_vl = global i32 4
41 int align_vl = __alignof(va_list);
42
43 // CHECK: __LITTLE_ENDIAN__defined
44 #ifdef __LITTLE_ENDIAN__
45 void __LITTLE_ENDIAN__defined() {}
46 #endif
47
48 // CHECK: __asmjs__defined
49 #ifdef __asmjs__
50 void __asmjs__defined() {}
51 #endif
52
53 // CHECK: EMSCRIPTENdefined
54 #ifdef EMSCRIPTEN
55 void EMSCRIPTENdefined() {}
56 #endif
57
58 // CHECK: __EMSCRIPTEN__defined
59 #ifdef __EMSCRIPTEN__
60 void __EMSCRIPTEN__defined() {}
61 #endif
62
63 // CHECK: unixdefined
64 #ifdef unix
65 void unixdefined() {}
66 #endif
67
68 // CHECK: _GNU_SOURCEdefined
69 #ifdef _GNU_SOURCE
70 void _GNU_SOURCEdefined() {}
71 #endif
72
73 // THREADS: _REENTRANTdefined
74 // CHECK: _REENTRANTundefined
75 #ifdef _REENTRANT
76 void _REENTRANTdefined() {}
77 #else
78 void _REENTRANTundefined() {}
79 #endif
80
81 // Check types
82
83 // CHECK: signext i8 @check_char()
84 char check_char() { return 0; }
85
86 // CHECK: signext i16 @check_short()
87 short check_short() { return 0; }
88
89 // CHECK: i32 @check_int()
90 int check_int() { return 0; }
91
92 // CHECK: i32 @check_long()
93 long check_long() { return 0; }
94
95 // CHECK: i64 @check_longlong()
96 long long check_longlong() { return 0; }
97
98 // CHECK: zeroext i8 @check_uchar()
99 unsigned char check_uchar() { return 0; }
100
101 // CHECK: zeroext i16 @check_ushort()
102 unsigned short check_ushort() { return 0; }
103
104 // CHECK: i32 @check_uint()
105 unsigned int check_uint() { return 0; }
106
107 // CHECK: i32 @check_ulong()
108 unsigned long check_ulong() { return 0; }
109
110 // CHECK: i64 @check_ulonglong()
111 unsigned long long check_ulonglong() { return 0; }
112
113 // CHECK: i32 @check_size_t()
114 size_t check_size_t() { return 0; }
115
116 // CHECK: float @check_float()
117 float check_float() { return 0; }
118
119 // CHECK: double @check_double()
120 double check_double() { return 0; }
121
122 // CHECK: double @check_longdouble()
123 long double check_longdouble() { return 0; }
124
125 }
126
127 template<int> void Switch();
128 template<> void Switch<4>();
129 template<> void Switch<8>();
130 template<> void Switch<16>();
131
132 void check_pointer_size() {
133 // CHECK: SwitchILi4
134 Switch<sizeof(void*)>();
135
136 // CHECK: SwitchILi8
137 Switch<sizeof(long long)>();
138
139 // CHECK: SwitchILi16
140 Switch<sizeof(va_list)>();
141 }
OLDNEW
« no previous file with comments | « test/CodeGenCXX/static-init-emscripten.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698