The attached patch modifies SemaTemplate/example-dynarray.cpp test to have
explicit declaration for malloc, free and assert functions and removes its
dependency on <stdlib.h> and <assert.h>.

 

Please let me know if the patch is okay to commit.

 

Thanks,

Jyotsna

 

--

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
The Linux Foundation

 

>From d925137368cdc3c2b30b5be367e17c2f323b794c Mon Sep 17 00:00:00 2001
From: Jyotsna Verma <[email protected]>
Date: Fri, 19 Apr 2013 09:10:45 -0500
Subject: [PATCH] Use explicit declaration of malloc, free and assert in
 SemaTemplate/example-dynarray.cpp. Don't include <stdlib.h>
 and <assert.h> as they (or the header files included in
 them) may not be available for all the targets and cause
 the test to fail.

---
 test/SemaTemplate/example-dynarray.cpp |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/test/SemaTemplate/example-dynarray.cpp 
b/test/SemaTemplate/example-dynarray.cpp
index 266d2d4..3310159 100644
--- a/test/SemaTemplate/example-dynarray.cpp
+++ b/test/SemaTemplate/example-dynarray.cpp
@@ -1,8 +1,15 @@
 // RUN: %clangxx -emit-llvm -c -o - %s
-// XFAIL: hexagon
 #include <stddef.h>
-#include <stdlib.h>
-#include <assert.h>
+
+extern void free(void *ptr);
+extern void *malloc(size_t size);
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+    unsigned int __line, __const char *__function)
+     __attribute__ ((__noreturn__));
+
+#define assert(expr) \
+  ((expr)  ? (void)(0)  : __assert_fail (#expr, __FILE__, __LINE__, __func__))
 
 // Placement new requires <new> to be included, but we don't support that yet.
 void* operator new(size_t, void* ptr) throw() {
-- 
1.7.6.4

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to