• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  // RUN: %clang_cc1 -fno-builtin -O1 -S -o - %s | FileCheck %s
2  // RUN: %clang_cc1 -fno-builtin-memset -O1 -S -o - %s | FileCheck -check-prefix=MEMSET %s
3  
PR13497()4  void PR13497() {
5    char content[2];
6    // make sure we don't optimize this call to strcpy()
7    // CHECK: __strcpy_chk
8    __builtin___strcpy_chk(content, "", 1);
9  }
10  
PR4941(char * s)11  void PR4941(char *s) {
12    // Make sure we don't optimize this loop to a memset().
13    // MEMSET-LABEL: PR4941:
14    // MEMSET-NOT: memset
15    for (unsigned i = 0; i < 8192; ++i)
16      s[i] = 0;
17  }
18