// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo '[{"directory":".","command":"clang++ '$(llvm-config --cppflags all)' -c %s","file":"%s"}]' > %t/compile_commands.json
// RUN: remove-cstr-calls %t %s | FileCheck %s

#include <string>

namespace llvm { struct StringRef { StringRef(const char *p); }; }

void f1(const std::string &s) {
  f1(s.c_str());  // CHECK:remove-cstr-calls.cpp:11:6:11:14:s
}
void f2(const llvm::StringRef r) {
  std::string s;
  f2(s.c_str());  // CHECK:remove-cstr-calls.cpp:15:6:15:14:s
}
void f3(const llvm::StringRef &r) {
  std::string s;
  f3(s.c_str());  // CHECK:remove-cstr-calls.cpp:19:6:19:14:s
}

// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo '[{"directory":".","command":"clang++ '$(llvm-config --cppflags all)' -c %s","file":"%s"}]' > %t/compile_commands.json
// RUN: remove-cstr-calls %t %s | FileCheck %s
// XFAIL: *

#include <string>

namespace llvm { struct StringRef { StringRef(const char *p); }; }

void f1(const std::string &s) {
  f1(s.c_str());  // CHECK:remove-cstr-calls.cpp:11:6:11:14:s
}
void f2(const llvm::StringRef r) {
  std::string s;
  f2(s.c_str());  // CHECK:remove-cstr-calls.cpp:15:6:15:14:s
}
void f3(const llvm::StringRef &r) {
  std::string s;
  f3(s.c_str());  // CHECK:remove-cstr-calls.cpp:19:6:19:14:s
}

Fix test breakage due to example not being built.
Fix test breakage due to example not being built.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@132376 91177308-0d34-0410-b5e6-96231b3b80d8
