Use autobuilds to verify if a couple of experimental compiler tests pass on all of...
authorYang Tse <yangsita@gmail.com>
Wed, 6 May 2009 18:37:24 +0000 (18:37 +0000)
committerYang Tse <yangsita@gmail.com>
Wed, 6 May 2009 18:37:24 +0000 (18:37 +0000)
This will be removed in 24 or 48 hours.

acinclude.m4
configure.ac

index e84b977..47fda33 100644 (file)
@@ -2408,6 +2408,59 @@ AC_DEFUN([CURL_CONFIGURE_CURL_SOCKLEN_T], [
 ])
 
 
+dnl CURL_A_COUPLE_OF_EXPERIMENTAL_COMPILER_TESTS
+dnl -------------------------------------------------
+dnl Use autobuilds to verify if these two tests pass.
+dnl To be removed in 24 or 48 hours.
+
+AC_DEFUN([CURL_A_COUPLE_OF_EXPERIMENTAL_COMPILER_TESTS], [
+  AC_MSG_CHECKING([compiler test 01])
+  AC_COMPILE_IFELSE([
+    AC_LANG_PROGRAM([[
+      struct mystruct {
+        int              member1;
+        char            *member2;
+        struct mystruct *next;
+      };
+      typedef struct mystruct mystruct;
+      struct mystruct myfunc();
+      typedef char __my_arr_01__
+        [sizeof(myfunc().member1) == sizeof(int) ? 1 : -1];
+    ]],[[
+      /* this should compile ok to pass test 01 */
+      struct mystruct dummy;
+    ]])
+  ],[
+    AC_MSG_RESULT([pass])
+  ],[
+    AC_MSG_RESULT([FAIL])
+    sed 's/^/cc-src: /' conftest.$ac_ext >&6
+    sed 's/^/cc-err: /' conftest.err >&6
+  ])
+  AC_MSG_CHECKING([compiler test 02])
+  AC_COMPILE_IFELSE([
+    AC_LANG_PROGRAM([[
+      struct mystruct {
+        int              member1;
+        char            *member2;
+        struct mystruct *next;
+      };
+      typedef struct mystruct mystruct;
+      struct mystruct myfunc();
+      typedef char __my_arr_02__
+        [sizeof(myfunc().member1) == sizeof(char) ? 1 : -1];
+    ]],[[
+      /* this should fail compilation to pass test 02 */
+      struct mystruct dummy;
+    ]])
+  ],[
+    AC_MSG_RESULT([FAIL])
+  ],[
+    AC_MSG_RESULT([pass])
+  ])
+])
+
+
 dnl CURL_CHECK_FUNC_SELECT
 dnl -------------------------------------------------
 dnl Test if the socket select() function is available,
index 8049e06..0e0a1bf 100644 (file)
@@ -1999,6 +1999,8 @@ AC_CHECK_TYPE([bool],[
 #endif
 ])
 
+CURL_A_COUPLE_OF_EXPERIMENTAL_COMPILER_TESTS
+
 CURL_CONFIGURE_CURL_SOCKLEN_T
 
 TYPE_IN_ADDR_T