From: Hans Wennborg Date: Thu, 22 Jan 2015 00:45:20 +0000 (+0000) Subject: Fix compiler_builtins.m test to not rely on including system stdlib.h and malloc.h X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23f012f9de248a75889d194db937c686f4b4bf36;p=clang Fix compiler_builtins.m test to not rely on including system stdlib.h and malloc.h Importing _Builtin_intrinsics.sse and avx would transitively pull in those headers, and the test would fail when building in an environment where they were not available on the include path. This fixes PR20995 for me. Differential Revision: http://reviews.llvm.org/D7112 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226754 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Modules/Inputs/System/usr/include/malloc.h b/test/Modules/Inputs/System/usr/include/malloc.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Modules/Inputs/System/usr/include/stdlib.h b/test/Modules/Inputs/System/usr/include/stdlib.h new file mode 100644 index 0000000000..a1bf1a8b29 --- /dev/null +++ b/test/Modules/Inputs/System/usr/include/stdlib.h @@ -0,0 +1 @@ +typedef __SIZE_TYPE__ size_t; diff --git a/test/Modules/compiler_builtins.m b/test/Modules/compiler_builtins.m index 4b8cb5bdc5..f120bcfd98 100644 --- a/test/Modules/compiler_builtins.m +++ b/test/Modules/compiler_builtins.m @@ -1,6 +1,6 @@ // RUN: rm -rf %t -// RUN: %clang -fsyntax-only -fmodules -fmodules-cache-path=%t -D__need_wint_t %s -Xclang -verify -// RUN: %clang -fsyntax-only -std=c99 -fmodules -fmodules-cache-path=%t -D__need_wint_t %s -Xclang -verify +// RUN: %clang -fsyntax-only -fmodules -fmodules-cache-path=%t -D__need_wint_t %s -I%S/Inputs/System/usr/include -Xclang -verify +// RUN: %clang -fsyntax-only -std=c99 -fmodules -fmodules-cache-path=%t -D__need_wint_t %s -I%S/Inputs/System/usr/include -Xclang -verify // expected-no-diagnostics #ifdef __SSE__