Follow up to r138470 (Add PNaCl TargetInfo). I've occasionally submitted wrong patch.

llvm-svn: 138489
This commit is contained in:
Ivan Krasin 2011-08-24 21:22:25 +00:00
parent 0a0b3071df
commit 7a09d12242
2 changed files with 17 additions and 7 deletions

View File

@ -2877,7 +2877,12 @@ public:
unsigned &NumRecords) const {
}
virtual const char *getVAListDeclaration() const {
return "typedef void* __builtin_va_list;";
return "typedef struct __va_list_tag {"
" void* ptr;"
" void* padding1;"
" void* padding2;"
" void* padding3;"
"} __builtin_va_list[1];";
}
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const;

View File

@ -1,9 +1,7 @@
// RUN: %clang -ccc-host-triple le32-unknown-nacl -ccc-echo %s -emit-llvm -c -o /tmp/OUTPUTNAME 2> %t.log
// RUN: %clang -ccc-host-triple le32-unknown-nacl -ccc-echo %s -emit-llvm -c 2>&1 | FileCheck %s -check-prefix=ECHO
// RUN: %clang -ccc-host-triple le32-unknown-nacl %s -emit-llvm -S -c -o - | FileCheck %s
// Make sure we used clang.
// RUN: grep 'clang\(-[0-9.]\+\)\?\(\.[Ee][Xx][Ee]\)\?" -cc1 .*le32-unknown-nacl.c' %t.log
// RUN: llvm-dis < /tmp/OUTPUTNAME | FileCheck %s
// ECHO: clang{{.*}} -cc1 {{.*}}le32-unknown-nacl.c
// Check platform defines
#include <stddef.h>
@ -69,13 +67,17 @@ float check_float() { return 0; }
// CHECK: double @check_double()
double check_double() { return 0; }
// CHECK: double @check_longdouble()
long double check_longdouble() { return 0; }
}
// Check that pointers are 32-bit.
#include <stdarg.h>
template<int> void Switch();
template<> void Switch<4>();
template<> void Switch<8>();
template<> void Switch<16>();
void check_pointer_size() {
// CHECK: SwitchILi4
@ -83,4 +85,7 @@ void check_pointer_size() {
// CHECK: SwitchILi8
Switch<sizeof(long long)>();
// CHECK: SwitchILi16
Switch<sizeof(va_list)>();
}