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

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: Improve the test Created 9 years, 3 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 -o /tmp/OUTPUTNAME 2> %t.log
nlewycky 2011/08/24 01:32:49 "/tmp/OUTPUTNAME"? Please use %t2 or something.
krasin 2011/08/24 01:56:10 Done.
2
3 // Make sure we used clang.
4 // RUN: grep 'clang\(-[0-9.]\+\)\?\(\.[Ee][Xx][Ee]\)\?" -cc1 .*le32-unknown-nacl .c' %t.log
5
6 // RUN: llvm-dis < /tmp/OUTPUTNAME | FileCheck %s
7
8 // Check platform defines
9 #include <stddef.h>
10
11 extern "C" {
12
13 #ifdef __native_client__
14 void __native_client__defined() {
15 // CHECK: __native_client__defined
16 }
17 #endif
18
19 #ifdef __le32__
20 void __le32__defined() {
21 // CHECK: __le32__defined
22 }
23 #endif
24
25 #ifdef __pnacl__
26 void __pnacl__defined() {
27 // CHECK: __pnacl__defined
28 }
29 #endif
30
31 // Check types
32
33 // CHECK: signext i8 @check_char()
34 char check_char() { return 0; }
35
36 // CHECK: signext i16 @check_short()
37 short check_short() { return 0; }
38
39 // CHECK: i32 @check_int()
40 int check_int() { return 0; }
41
42 // CHECK: i32 @check_long()
43 long check_long() { return 0; }
44
45 // CHECK: i64 @check_longlong()
46 long long check_longlong() { return 0; }
47
48 // CHECK: zeroext i8 @check_uchar()
49 unsigned char check_uchar() { return 0; }
50
51 // CHECK: zeroext i16 @check_ushort()
52 unsigned short check_ushort() { return 0; }
53
54 // CHECK: i32 @check_uint()
55 unsigned int check_uint() { return 0; }
56
57 // CHECK: i32 @check_ulong()
58 unsigned long check_ulong() { return 0; }
59
60 // CHECK: i64 @check_ulonglong()
61 unsigned long long check_ulonglong() { return 0; }
62
63 // CHECK: i32 @check_size_t()
64 size_t check_size_t() { return 0; }
65
66 // CHECK: float @check_float()
67 float check_float() { return 0; }
68
69 // CHECK: double @check_double()
70 double check_double() { return 0; }
71
72 }
73
74 // Check that pointers are 32-bit.
75
76 template<int> void Switch();
77 template<> void Switch<4>();
78 template<> void Switch<8>();
79
80 void check_pointer_size() {
81 // CHECK: SwitchILi4
82 Switch<sizeof(void*)>();
83
84 // CHECK: SwitchILi8
85 Switch<sizeof(long long)>();
86 }
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