Thanks Chandler for the suggestion!

 

Attached patch contains the  change. Please let me know if it is good to commit.

 

Also, there are other tests that require system header files and had to be 
disabled for Hexagon. I will be modifying them in similar fashion.

 

Thanks,

Jyotsna

 

--

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

 

From: Chandler Carruth [mailto:[email protected]] 
Sent: Thursday, April 11, 2013 8:28 PM
To: Jyotsna Verma
Cc: llvm cfe
Subject: Re: r179310 - Exclude test30 of Sema/return.c for Hexagon since 
setjmp.h include file

 

On Thu, Apr 11, 2013 at 11:56 AM, Jyotsna Verma <[email protected]> wrote:

Author: jverma
Date: Thu Apr 11 13:56:34 2013
New Revision: 179310

URL: http://llvm.org/viewvc/llvm-project?rev=179310 
<http://llvm.org/viewvc/llvm-project?rev=179310&view=rev> &view=rev
Log:
Exclude test30 of Sema/return.c for Hexagon since setjmp.h include file
is unavailable for Hexagon.

 

I feel like the right thing to do is inline a minimal set of declarations to 
support just *this* test, as the test suite really shouldn't be subjected to 
the vagaries of the system headers anyways.

 


Modified:
    cfe/trunk/test/Sema/return.c

Modified: cfe/trunk/test/Sema/return.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return.c?rev=179310 
<http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return.c?rev=179310&r1=179309&r2=179310&view=diff>
 &r1=179309&r2=179310&view=diff
==============================================================================
--- cfe/trunk/test/Sema/return.c (original)
+++ cfe/trunk/test/Sema/return.c Thu Apr 11 13:56:34 2013
@@ -197,6 +197,7 @@ int test29() {
   exit(1);
 }

+#ifndef __hexagon__
 #include <setjmp.h>
 jmp_buf test30_j;
 int test30() {
@@ -209,6 +210,7 @@ int test30() {
     _longjmp(test30_j, 1);
 #endif
 }
+#endif

 typedef void test31_t(int status);
 void test31(test31_t *callback __attribute__((noreturn)));


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

 

>From 52f41ece8ce30651e0480dd6a97a6bbdc1c26392 Mon Sep 17 00:00:00 2001
From: Jyotsna Verma <[email protected]>
Date: Fri, 12 Apr 2013 10:49:40 -0500
Subject: [PATCH] Remove setjmp.h header file from Sema/return.c test and
 include necessary declarations explicitly in the test.

---
 test/Sema/return.c |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/test/Sema/return.c b/test/Sema/return.c
index ddd99a3..4703e97 100644
--- a/test/Sema/return.c
+++ b/test/Sema/return.c
@@ -197,9 +197,28 @@ int test29() {
   exit(1);
 }
 
-#ifndef __hexagon__
-#include <setjmp.h>
+// Include these declarations here explicitly so we don't depend on system 
headers.
+typedef long int __jmp_buf[8];
+
+typedef struct
+{
+  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
+} __sigset_t;
+
+struct __jmp_buf_tag
+{
+  __jmp_buf __jmpbuf;
+  int __mask_was_saved;
+  __sigset_t __saved_mask;
+};
+
+typedef struct __jmp_buf_tag jmp_buf[1];
+
+extern void longjmp (struct __jmp_buf_tag __env[1], int __val) __attribute__ 
((noreturn));
+extern void _longjmp (struct __jmp_buf_tag __env[1], int __val) __attribute__ 
((noreturn));
+
 jmp_buf test30_j;
+
 int test30() {
   if (j)
     longjmp(test30_j, 1);
@@ -210,7 +229,6 @@ int test30() {
     _longjmp(test30_j, 1);
 #endif
 }
-#endif
 
 typedef void test31_t(int status);
 void test31(test31_t *callback __attribute__((noreturn)));
-- 
1.7.6.4

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

Reply via email to