r281785 - CodeGen: Add more checks to nobuiltin.c test, add a negative test.

Peter Collingbourne via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 16 15:05:53 PDT 2016


Author: pcc
Date: Fri Sep 16 17:05:53 2016
New Revision: 281785

URL: http://llvm.org/viewvc/llvm-project?rev=281785&view=rev
Log:
CodeGen: Add more checks to nobuiltin.c test, add a negative test.

Modified:
    cfe/trunk/test/CodeGen/nobuiltin.c

Modified: cfe/trunk/test/CodeGen/nobuiltin.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/nobuiltin.c?rev=281785&r1=281784&r2=281785&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/nobuiltin.c (original)
+++ cfe/trunk/test/CodeGen/nobuiltin.c Fri Sep 16 17:05:53 2016
@@ -1,17 +1,19 @@
-// RUN: %clang_cc1 -fno-builtin -O1 -S -o - %s | FileCheck %s
-// RUN: %clang_cc1 -fno-builtin-memset -O1 -S -o - %s | FileCheck -check-prefix=MEMSET %s
+// RUN: %clang_cc1 -O1 -S -o - %s | FileCheck -check-prefix=STRCPY -check-prefix=MEMSET %s
+// RUN: %clang_cc1 -fno-builtin -O1 -S -o - %s | FileCheck -check-prefix=NOSTRCPY -check-prefix=NOMEMSET %s
+// RUN: %clang_cc1 -fno-builtin-memset -O1 -S -o - %s | FileCheck -check-prefix=STRCPY -check-prefix=NOMEMSET %s
 
 void PR13497() {
   char content[2];
   // make sure we don't optimize this call to strcpy()
-  // CHECK: __strcpy_chk
+  // STRCPY-NOT: __strcpy_chk
+  // NOSTRCPY: __strcpy_chk
   __builtin___strcpy_chk(content, "", 1);
 }
 
 void PR4941(char *s) {
   // Make sure we don't optimize this loop to a memset().
-  // MEMSET-LABEL: PR4941:
-  // MEMSET-NOT: memset
+  // NOMEMSET-NOT: memset
+  // MEMSET: memset
   for (unsigned i = 0; i < 8192; ++i)
     s[i] = 0;
 }




More information about the cfe-commits mailing list