r200344 - Intrin.h: include setjmp.h to get a jmp_buf definition
Hans Wennborg
hans at hanshq.net
Tue Jan 28 15:01:59 PST 2014
Author: hans
Date: Tue Jan 28 17:01:59 2014
New Revision: 200344
URL: http://llvm.org/viewvc/llvm-project?rev=200344&view=rev
Log:
Intrin.h: include setjmp.h to get a jmp_buf definition
This makes sure that the ms-intrin.cpp test passes by providing
a mock setjmp.h as a test input.
Added:
cfe/trunk/test/Headers/Inputs/include/setjmp.h
Modified:
cfe/trunk/lib/Headers/Intrin.h
cfe/trunk/test/Headers/ms-intrin.cpp
Modified: cfe/trunk/lib/Headers/Intrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/Intrin.h?rev=200344&r1=200343&r2=200344&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/Intrin.h (original)
+++ cfe/trunk/lib/Headers/Intrin.h Tue Jan 28 17:01:59 2014
@@ -32,6 +32,9 @@
/* First include the standard intrinsics. */
#include <x86intrin.h>
+/* For the definition of jmp_buf. */
+#include <setjmp.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -279,10 +282,7 @@ unsigned __int64 __cdecl _rotr64(unsigne
static __inline__
unsigned char _rotr8(unsigned char _Value, unsigned char _Shift);
int _sarx_i32(int, unsigned int);
-
-/* FIXME: Need definition for jmp_buf.
- int __cdecl _setjmp(jmp_buf); */
-
+int __cdecl _setjmp(jmp_buf);
unsigned int _shlx_u32(unsigned int, unsigned int);
unsigned int _shrx_u32(unsigned int, unsigned int);
void _Store_HLERelease(long volatile *, long);
Added: cfe/trunk/test/Headers/Inputs/include/setjmp.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/Inputs/include/setjmp.h?rev=200344&view=auto
==============================================================================
--- cfe/trunk/test/Headers/Inputs/include/setjmp.h (added)
+++ cfe/trunk/test/Headers/Inputs/include/setjmp.h Tue Jan 28 17:01:59 2014
@@ -0,0 +1,8 @@
+#ifndef SETJMP_H
+#define SETJMP_H
+
+typedef struct {
+ int x[42];
+} jmp_buf;
+
+#endif
Modified: cfe/trunk/test/Headers/ms-intrin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/ms-intrin.cpp?rev=200344&r1=200343&r2=200344&view=diff
==============================================================================
--- cfe/trunk/test/Headers/ms-intrin.cpp (original)
+++ cfe/trunk/test/Headers/ms-intrin.cpp Tue Jan 28 17:01:59 2014
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -triple i386-pc-win32 -target-cpu pentium4 \
// RUN: -fms-extensions -fms-compatibility -fmsc-version=1700 \
-// RUN: -ffreestanding -fsyntax-only -Werror %s
+// RUN: -ffreestanding -fsyntax-only -Werror \
+// RUN: -isystem %S/Inputs/include %s
// Intrin.h needs size_t, but -ffreestanding prevents us from getting it from
// stddef.h. Work around it with this typedef.
More information about the cfe-commits
mailing list