aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/testFuncs1.c2
-rw-r--r--test/testFuncs1.h1
-rw-r--r--test/testFuncs2.c53
-rw-r--r--test/testFuncs2.h1
4 files changed, 57 insertions, 0 deletions
diff --git a/test/testFuncs1.c b/test/testFuncs1.c
index cb950a0..50c5905 100644
--- a/test/testFuncs1.c
+++ b/test/testFuncs1.c
@@ -1194,6 +1194,8 @@ void test34(void)
; int b;
+ int ut_int = 0;
+
test33();
}
diff --git a/test/testFuncs1.h b/test/testFuncs1.h
index 4a8a91a..ca9827e 100644
--- a/test/testFuncs1.h
+++ b/test/testFuncs1.h
@@ -156,6 +156,7 @@ void testfunc9999(void)
};
struct s* ps1;
+ /*these two should not be tagged by 18.1 since they are pointers to an incomplete type. the pointer is a complete type.*/
struct s** ps2;
struct s*** ps3;
diff --git a/test/testFuncs2.c b/test/testFuncs2.c
index accc3e3..e65c922 100644
--- a/test/testFuncs2.c
+++ b/test/testFuncs2.c
@@ -68,6 +68,29 @@ typedef const* INTPTR;
#endif
/*********************************************************************************************************************/
/*Globals*/
+int incompletearr1[];
+int incompletearr2[];
+
+int incompletearr1[10];
+
+union u3;
+union u4;
+
+union u3
+{
+ int ua;
+ char ub;
+};
+
+struct s10;
+struct s11;
+
+struct s10
+{
+ int sa[10];
+ char sb;
+ int sc;
+};
/*********************************************************************************************************************/
/*functions go here.*/
@@ -87,8 +110,19 @@ void testfunc1(void)
{
unsigned char a;
unsigned char b;
+ char c;
b = a;
+ c = 123;
+ c = 'c';
+ c = "c";
+ c = '\n';
+
+ ;;;;
+ ;/*comment*/
+ ; /*comment*/
+
+ c = '5';
}
#if CRAZYMACRO < 0
@@ -176,13 +210,19 @@ void testfunc9(void)
};
struct s* ps1;
+ /*these two should not be tagged by 18.1 since they are pointers(to pointers) to an incomplete type. the pointer itself is a complete type.*/
struct s** ps2;
struct s*** ps3;
INTPTR *const* const fedupp1;
int ** (*pfunc1)();
+ int crazycast1 = (int)pfunc1;
+ int crazycast2;
+ pfunc1 = (int ** (*)())crazycast2;
int ** (**pfunc2)();
+ pfunc2 = pfunc1;
+ pfunc2 = (int ** (*)())pfunc1;
int ** (***pfunc3)();
int *** (**pfunc4)();
int ** (**pfunc5)(int**, int**);
@@ -207,5 +247,18 @@ void testfunc11(void)
b = a;
dd = b;
}
+
+void testfunc12(void)
+{
+ const char* stringlit = "date should be in the form ??-??-??";
+
+ short int port = 0x5aU;
+ short int resultshort;
+ int resultlong;
+ resultshort = (~port) >> 4;
+ resultshort = ((short int)(~port)) >> 4;
+ resultlong = ((int)(~(int)port)) >> 4;
+
+}
/*********************************************************************************************************************/
/*last line intentionally left blank.*/
diff --git a/test/testFuncs2.h b/test/testFuncs2.h
index 5b14d7d..bf848aa 100644
--- a/test/testFuncs2.h
+++ b/test/testFuncs2.h
@@ -42,6 +42,7 @@ void anotherheaderfunc (void)
void testFunc9(void);
void testFunc11(void);
+void testFunc12(void);
/*********************************************************************************************************************/
#endif