[cfe-commits] r85534 - /cfe/trunk/test/CodeGen/object-size.c

Mike Stump mrs at apple.com
Thu Oct 29 16:22:14 PDT 2009


Author: mrs
Date: Thu Oct 29 18:22:14 2009
New Revision: 85534

URL: http://llvm.org/viewvc/llvm-project?rev=85534&view=rev
Log:
Add some more testcases.

Modified:
    cfe/trunk/test/CodeGen/object-size.c

Modified: cfe/trunk/test/CodeGen/object-size.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/object-size.c?rev=85534&r1=85533&r2=85534&view=diff

==============================================================================
--- cfe/trunk/test/CodeGen/object-size.c (original)
+++ cfe/trunk/test/CodeGen/object-size.c Thu Oct 29 18:22:14 2009
@@ -11,6 +11,7 @@
 
 char gbuf[63];
 char *gp;
+int gi, gj;
 
 void test1() {
   // CHECK:       movabsq $59, %rdx
@@ -45,17 +46,13 @@
 }
 
 void test5() {
+  // CHECK:       movb    $0, %al
+  // CHECK-NEXT   testb   %al, %al
   // CHECK:       call    ___inline_strcpy_chk
   strcpy(gp, "Hi there");
 }
 
 void test6() {
-  int i;
-  // CHECK:       call    ___inline_strcpy_chk
-  strcpy((++i, gbuf), "Hi there");
-}
-
-void test7() {
   char buf[57];
 
   // CHECK:       movabsq $53, %rdx
@@ -64,3 +61,30 @@
   // CHECK-NEXT:  call    ___strcpy_chk
   strcpy(&buf[4], "Hi there");
 }
+
+void test7() {
+  int i;
+  // CHECK-NOT:   call    ___strcpy_chk
+  // CHECK:       call    ___inline_strcpy_chk
+  strcpy((++i, gbuf), "Hi there");
+}
+
+void test8() {
+  char *buf[50];
+  // CHECK-NOT:   call    ___strcpy_chk
+  // CHECK:       call    ___inline_strcpy_chk
+  strcpy(buf[++gi], "Hi there");
+}
+
+void test9() {
+  // CHECK-NOT:   call    ___strcpy_chk
+  // CHECK:       call    ___inline_strcpy_chk
+  strcpy((char *)((++gi) + gj), "Hi there");
+}
+
+char **p;
+void test10() {
+  // CHECK-NOT:   call    ___strcpy_chk
+  // CHECK:       call    ___inline_strcpy_chk
+  strcpy(*(++p), "Hi there");
+}





More information about the cfe-commits mailing list