extern "C" char *strncpy(char *dst, const char *src, size_t n);
extern "C" char *strncat(char *dst, const char *src, size_t n);
extern "C" char *strndup(const char *src, size_t n);
-extern "C" size_t strlcpy(char *dst, const char *src, size_t size);
-extern "C" size_t strlcat(char *dst, const char *src, size_t size);
void f() {
char b1[80], b2[80];
expected-note {{explicitly cast the argument}}
if (strndup(b1, sizeof(b1)) != 0) {}
- if (strlcpy(b1, b2, sizeof(b1) != 0)) {} // \
- expected-warning{{size argument in 'strlcpy' call is a comparison}} \
- expected-note {{did you mean to compare}} \
- expected-note {{explicitly cast the argument}}
- if (strlcpy(b1, b2, sizeof(b1)) != 0) {}
-
- if (strlcat(b1, b2, sizeof(b1) != 0)) {} // \
- expected-warning{{size argument in 'strlcat' call is a comparison}} \
- expected-note {{did you mean to compare}} \
- expected-note {{explicitly cast the argument}}
- if (strlcat(b1, b2, sizeof(b1)) != 0) {}
-
if (memset(b1, 0, sizeof(b1) / 2)) {}
if (memset(b1, 0, sizeof(b1) >> 2)) {}
if (memset(b1, 0, 4 << 2)) {}
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes
; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
; REQUIRES: loadable_module
+; XFAIL: *
; Test to make sure that arguments are removed from the function if they are
; unnecessary. And clean up any types that frees up too.