r178736 - Add tests that build modules for our builtin headers, and fix two buglets exposed by doing so.
Richard Smith
richard-llvm at metafoo.co.uk
Wed Apr 3 19:55:25 PDT 2013
Author: rsmith
Date: Wed Apr 3 21:55:24 2013
New Revision: 178736
URL: http://llvm.org/viewvc/llvm-project?rev=178736&view=rev
Log:
Add tests that build modules for our builtin headers, and fix two buglets exposed by doing so.
Modified:
cfe/trunk/lib/Headers/cpuid.h
cfe/trunk/lib/Headers/module.map
cfe/trunk/test/Headers/c11.c
cfe/trunk/test/Headers/c89.c
cfe/trunk/test/Headers/cxx11.cpp
Modified: cfe/trunk/lib/Headers/cpuid.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/cpuid.h?rev=178736&r1=178735&r2=178736&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/cpuid.h (original)
+++ cfe/trunk/lib/Headers/cpuid.h Wed Apr 3 21:55:24 2013
@@ -25,9 +25,9 @@
#error this header is for x86 only
#endif
-static inline int __get_cpuid (unsigned int __level, unsigned int *__eax,
- unsigned int *__ebx, unsigned int *__ecx,
- unsigned int *__edx) {
+static __inline int __get_cpuid (unsigned int __level, unsigned int *__eax,
+ unsigned int *__ebx, unsigned int *__ecx,
+ unsigned int *__edx) {
__asm("cpuid" : "=a"(*__eax), "=b" (*__ebx), "=c"(*__ecx), "=d"(*__edx)
: "0"(__level));
return 1;
Modified: cfe/trunk/lib/Headers/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/module.map?rev=178736&r1=178735&r2=178736&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/module.map (original)
+++ cfe/trunk/lib/Headers/module.map Wed Apr 3 21:55:24 2013
@@ -17,6 +17,7 @@ module _Builtin_intrinsics [system] {
}
explicit module cpuid {
+ requires x86
header "cpuid.h"
}
Modified: cfe/trunk/test/Headers/c11.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/c11.c?rev=178736&r1=178735&r2=178736&view=diff
==============================================================================
--- cfe/trunk/test/Headers/c11.c (original)
+++ cfe/trunk/test/Headers/c11.c Wed Apr 3 21:55:24 2013
@@ -1,4 +1,5 @@
// RUN: %clang -fsyntax-only -Xclang -verify -std=c11 %s
+// RUN: %clang -fsyntax-only -Xclang -verify -std=c11 -fmodules %s
noreturn int f(); // expected-error 1+{{}}
Modified: cfe/trunk/test/Headers/c89.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/c89.c?rev=178736&r1=178735&r2=178736&view=diff
==============================================================================
--- cfe/trunk/test/Headers/c89.c (original)
+++ cfe/trunk/test/Headers/c89.c Wed Apr 3 21:55:24 2013
@@ -1,4 +1,5 @@
// RUN: %clang -target i386-apple-darwin10 -fsyntax-only -Xclang -verify -std=c89 %s
+// RUN: %clang -target i386-apple-darwin10 -fsyntax-only -Xclang -verify -std=c89 -fmodules %s
// expected-no-diagnostics
// FIXME: Disable inclusion of mm_malloc.h, our current implementation is broken
Modified: cfe/trunk/test/Headers/cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/cxx11.cpp?rev=178736&r1=178735&r2=178736&view=diff
==============================================================================
--- cfe/trunk/test/Headers/cxx11.cpp (original)
+++ cfe/trunk/test/Headers/cxx11.cpp Wed Apr 3 21:55:24 2013
@@ -1,4 +1,5 @@
// RUN: %clang -fsyntax-only -std=c++11 %s
+// RUN: %clang -fsyntax-only -std=c++11 -fmodules %s
#include <stdalign.h>
More information about the cfe-commits
mailing list