aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-04-04 02:55:24 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-04-04 02:55:24 +0000
commit4a3c6c6daebce44416a63bb19ad1ab7fe0d16354 (patch)
treef80e41b9267dba8c77fc0470ad7d1ca135a17d86
parent80a8689b274f758d9d7fb04c5cad81a582525497 (diff)
Add tests that build modules for our builtin headers, and fix two buglets exposed by doing so.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178736 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Headers/cpuid.h6
-rw-r--r--lib/Headers/module.map1
-rw-r--r--test/Headers/c11.c1
-rw-r--r--test/Headers/c89.c1
-rw-r--r--test/Headers/cxx11.cpp1
5 files changed, 7 insertions, 3 deletions
diff --git a/lib/Headers/cpuid.h b/lib/Headers/cpuid.h
index 6d7d61d508..7b012384a2 100644
--- a/lib/Headers/cpuid.h
+++ b/lib/Headers/cpuid.h
@@ -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;
diff --git a/lib/Headers/module.map b/lib/Headers/module.map
index 1b476a5e55..aa219cb407 100644
--- a/lib/Headers/module.map
+++ b/lib/Headers/module.map
@@ -17,6 +17,7 @@ module _Builtin_intrinsics [system] {
}
explicit module cpuid {
+ requires x86
header "cpuid.h"
}
diff --git a/test/Headers/c11.c b/test/Headers/c11.c
index 24a1c2a60d..f65164d15c 100644
--- a/test/Headers/c11.c
+++ b/test/Headers/c11.c
@@ -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+{{}}
diff --git a/test/Headers/c89.c b/test/Headers/c89.c
index acf01b40e0..95f692b8f0 100644
--- a/test/Headers/c89.c
+++ b/test/Headers/c89.c
@@ -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
diff --git a/test/Headers/cxx11.cpp b/test/Headers/cxx11.cpp
index 995fc6528d..41bdc76fda 100644
--- a/test/Headers/cxx11.cpp
+++ b/test/Headers/cxx11.cpp
@@ -1,4 +1,5 @@
// RUN: %clang -fsyntax-only -std=c++11 %s
+// RUN: %clang -fsyntax-only -std=c++11 -fmodules %s
#include <stdalign.h>