From 9cf7122ff75017ce747a391931f18e54fd7935dc Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 22 Jan 2015 00:45:20 +0000 Subject: [PATCH] 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 llvm-svn: 226754 --- clang/test/Modules/Inputs/System/usr/include/malloc.h | 0 clang/test/Modules/Inputs/System/usr/include/stdlib.h | 1 + clang/test/Modules/compiler_builtins.m | 4 ++-- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 clang/test/Modules/Inputs/System/usr/include/malloc.h create mode 100644 clang/test/Modules/Inputs/System/usr/include/stdlib.h diff --git a/clang/test/Modules/Inputs/System/usr/include/malloc.h b/clang/test/Modules/Inputs/System/usr/include/malloc.h new file mode 100644 index 0000000..e69de29 diff --git a/clang/test/Modules/Inputs/System/usr/include/stdlib.h b/clang/test/Modules/Inputs/System/usr/include/stdlib.h new file mode 100644 index 0000000..a1bf1a8 --- /dev/null +++ b/clang/test/Modules/Inputs/System/usr/include/stdlib.h @@ -0,0 +1 @@ +typedef __SIZE_TYPE__ size_t; diff --git a/clang/test/Modules/compiler_builtins.m b/clang/test/Modules/compiler_builtins.m index 4b8cb5b..f120bcf 100644 --- a/clang/test/Modules/compiler_builtins.m +++ b/clang/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__ -- 2.7.4