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

Side by Side Diff: test/Driver/le32-unknown-nacl.cpp

Issue 7717004: Add PNaCl TargetInfo to Clang (Closed) Base URL: http://llvm.org/svn/llvm-project/cfe/trunk/
Patch Set: test long double as well Created 9 years, 4 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 | « lib/Basic/Targets.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 -ccc-host-triple le32-unknown-nacl -ccc-echo %s -emit-llvm -c 2>& 1 | FileCheck %s -check-prefix=ECHO
2 // RUN: %clang -ccc-host-triple le32-unknown-nacl %s -emit-llvm -S -c -o - | Fil eCheck %s
3
4 // ECHO: clang{{.*}} -cc1 {{.*}}le32-unknown-nacl.c
5
6 // Check platform defines
7 #include <stddef.h>
8
9 extern "C" {
10
11 #ifdef __native_client__
12 void __native_client__defined() {
13 // CHECK: __native_client__defined
14 }
15 #endif
16
17 #ifdef __le32__
18 void __le32__defined() {
19 // CHECK: __le32__defined
20 }
21 #endif
22
23 #ifdef __pnacl__
24 void __pnacl__defined() {
25 // CHECK: __pnacl__defined
26 }
27 #endif
28
29 // Check types
30
31 // CHECK: signext i8 @check_char()
32 char check_char() { return 0; }
33
34 // CHECK: signext i16 @check_short()
35 short check_short() { return 0; }
36
37 // CHECK: i32 @check_int()
38 int check_int() { return 0; }
39
40 // CHECK: i32 @check_long()
41 long check_long() { return 0; }
42
43 // CHECK: i64 @check_longlong()
44 long long check_longlong() { return 0; }
45
46 // CHECK: zeroext i8 @check_uchar()
47 unsigned char check_uchar() { return 0; }
48
49 // CHECK: zeroext i16 @check_ushort()
50 unsigned short check_ushort() { return 0; }
51
52 // CHECK: i32 @check_uint()
53 unsigned int check_uint() { return 0; }
54
55 // CHECK: i32 @check_ulong()
56 unsigned long check_ulong() { return 0; }
57
58 // CHECK: i64 @check_ulonglong()
59 unsigned long long check_ulonglong() { return 0; }
60
61 // CHECK: i32 @check_size_t()
62 size_t check_size_t() { return 0; }
63
64 // CHECK: float @check_float()
65 float check_float() { return 0; }
66
67 // CHECK: double @check_double()
68 double check_double() { return 0; }
69
70 // CHECK: double @check_longdouble()
71 long double check_longdouble() { return 0; }
72
73 }
74
75 #include <stdarg.h>
76
77 template<int> void Switch();
78 template<> void Switch<4>();
79 template<> void Switch<8>();
80 template<> void Switch<16>();
81
82 void check_pointer_size() {
83 // CHECK: SwitchILi4
84 Switch<sizeof(void*)>();
85
86 // CHECK: SwitchILi8
87 Switch<sizeof(long long)>();
88
89 // CHECK: SwitchILi16
90 Switch<sizeof(va_list)>();
91 }
OLDNEW
« no previous file with comments | « lib/Basic/Targets.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698