blob: 3a9451ad23c4c156c5c0639fccec2b5bee86f6d1 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnantf5256e12010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00004//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <string>
11
12// template<class charT, class traits, class Allocator>
13// bool operator!=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs);
14
15#include <string>
16#include <cassert>
17
18template <class S>
19void
20test(const typename S::value_type* lhs, const S& rhs, bool x)
21{
22 assert((lhs != rhs) == x);
23}
24
25typedef std::string S;
26
27int main()
28{
29 test("", S(""), false);
30 test("", S("abcde"), true);
31 test("", S("abcdefghij"), true);
32 test("", S("abcdefghijklmnopqrst"), true);
33 test("abcde", S(""), true);
34 test("abcde", S("abcde"), false);
35 test("abcde", S("abcdefghij"), true);
36 test("abcde", S("abcdefghijklmnopqrst"), true);
37 test("abcdefghij", S(""), true);
38 test("abcdefghij", S("abcde"), true);
39 test("abcdefghij", S("abcdefghij"), false);
40 test("abcdefghij", S("abcdefghijklmnopqrst"), true);
41 test("abcdefghijklmnopqrst", S(""), true);
42 test("abcdefghijklmnopqrst", S("abcde"), true);
43 test("abcdefghijklmnopqrst", S("abcdefghij"), true);
44 test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false);
45}