| /llvm-project-15.0.7/clang-tools-extra/test/clang-tidy/checkers/readability/ |
| H A D | string-compare.cpp | 33 std::string str2("b", 1); in Test() local 35 if (str1.compare(str2)) { in Test() 38 if (!str1.compare(str2)) { in Test() 41 if (str1.compare(str2) == 0) { in Test() 61 func(str1.compare(str2)); in Test() 63 if (str2.empty() || str1.compare(str2) != 0) { in Test() 68 if (str3->compare(str2)) { in Test() 94 std::string str2("b", 1); in Valid() local 95 if (str1 == str2) { in Valid() 97 if (str1 != str2) { in Valid() [all …]
|
| /llvm-project-15.0.7/clang-tools-extra/docs/clang-tidy/checks/readability/ |
| H A D | string-compare.rst | 22 std::string str2{"b"}; 24 // use str1 != str2 instead. 25 if (str1.compare(str2)) { 28 // use str1 == str2 instead. 29 if (!str1.compare(str2)) { 32 // use str1 == str2 instead. 33 if (str1.compare(str2) == 0) { 36 // use str1 != str2 instead. 37 if (str1.compare(str2) != 0) { 40 // use str1 == str2 instead. [all …]
|
| /llvm-project-15.0.7/llvm/test/Transforms/InstCombine/ |
| H A D | strncmp-1.ll | 15 define i32 @test1(i8* %str2) { 24 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 10) 37 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 10) 49 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 10) 71 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 4) 76 define i32 @test6(i8* %str1, i8* %str2) { 86 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 1) 91 define i32 @test7(i8* %str1, i8* %str2) { 111 define i32 @test9(i8* %str1, i8* %str2, i32 %n) { 122 define i32 @test10(i8* %str1, i8* %str2, i32 %n) { [all …]
|
| H A D | strcmp-1.ll | 16 define i32 @test1(i8* %str2) { 35 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) 56 %str2 = getelementptr inbounds [1 x i8], [1 x i8]* @null, i32 0, i32 0 57 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) 73 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) 87 %str2 = getelementptr inbounds [1 x i8], [1 x i8]* @null, i32 0, i32 0 88 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) 111 %str2 = select i1 %b, i8* %temp1, i8* %temp2 112 %temp3 = call i32 @strcmp(i8* %str1, i8* %str2) 149 %str2 = select i1 %b, i8* %temp1, i8* %temp2 [all …]
|
| H A D | strstr-1.ll | 10 @.str2 = private constant [6 x i8] c"abcde\00" 42 ; CHECK-NEXT: ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str2, i64 0, i64 1) 44 %str = getelementptr inbounds [6 x i8], [6 x i8]* @.str2, i32 0, i32 0 74 define i8* @test1(i8* %str1, i8* %str2) { 79 %ret = call i8* @strstr(i8* %str1, i8* %str2) 83 define i8* @test2(i8* %str1, i8* %str2) null_pointer_is_valid { 88 %ret = call i8* @strstr(i8* %str1, i8* %str2)
|
| H A D | weak-symbols.ll | 17 %str2 = getelementptr inbounds [2 x i8], [2 x i8]* @.str, i64 0, i64 0 18 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) nounwind readonly 28 %str2 = getelementptr inbounds [2 x i8], [2 x i8]* @.str, i64 0, i64 0 29 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) nounwind readonly
|
| H A D | strncat-2.ll | 62 define i8* @test1(i8* %str1, i8* %str2, i32 %n) { 68 %temp1 = call i8* @strncat(i8* nonnull %str1, i8* nonnull %str2, i32 %n) 73 define i8* @test2(i8* %str1, i8* %str2, i32 %n) { 78 %temp1 = call i8* @strncat(i8* %str1, i8* %str2, i32 0) 83 define i8* @test3(i8* %str1, i8* %str2, i32 %n) { 89 %temp1 = call i8* @strncat(i8* %str1, i8* %str2, i32 5) 93 define i8* @test4(i8* %str1, i8* %str2, i32 %n) null_pointer_is_valid { 99 %temp1 = call i8* @strncat(i8* %str1, i8* %str2, i32 %n)
|
| H A D | strncmp-wrong-datalayout.ll | 10 define i32 @test6(i8* %str1, i8* %str2) { 12 ; CHECK: call i32 @strncmp(i8* %str1, i8* %str2, i32 1) 14 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 1)
|
| /llvm-project-15.0.7/llvm/test/Transforms/InstCombine/ARM/ |
| H A D | strcmp.ll | 15 define arm_aapcscc i32 @test1(i8* %str2) { 24 %temp1 = call arm_apcscc i32 @strcmp(i8* %str1, i8* %str2) 38 %temp1 = call arm_aapcscc i32 @strcmp(i8* %str1, i8* %str2) 50 %temp1 = call arm_aapcscc i32 @strcmp(i8* %str1, i8* %str2) 61 %temp1 = call arm_aapcscc i32 @strcmp(i8* %str1, i8* %str2) 77 %str2 = select i1 %b, i8* %temp1, i8* %temp2 78 %temp3 = call arm_aapcscc i32 @strcmp(i8* %str1, i8* %str2) 93 define arm_aapcs_vfpcc i32 @test1_vfp(i8* %str2) { 102 %temp1 = call arm_aapcs_vfpcc i32 @strcmp(i8* %str1, i8* %str2) 116 %temp1 = call arm_aapcs_vfpcc i32 @strcmp(i8* %str1, i8* %str2) [all …]
|
| /llvm-project-15.0.7/clang/test/Sema/ |
| H A D | overloaded-func-transparent-union.c | 8 char *str2; member 15 __attribute__((overloadable)) void Class_Init(Instance this, char *str, void *str2) { in Class_Init() argument 17 this.object->str2 = str2; in Class_Init() 22 this.object->str2 = str; in Class_Init()
|
| /llvm-project-15.0.7/clang-tools-extra/test/clang-tidy/checkers/bugprone/ |
| H A D | not-null-terminated-result-in-initialization-strlen.c | 39 int bad_strncmp_1(char *str1, const char *str2) { in bad_strncmp_1() argument 41 return strncmp(str1, str2, length); in bad_strncmp_1() 46 int good_strncmp_1(char *str1, const char *str2) { in good_strncmp_1() argument 48 return strncmp(str1, str2, length - 1); in good_strncmp_1() 51 int bad_strncmp_2(char *str2) { in bad_strncmp_2() argument 52 return strncmp(str2, "foobar", (strlen("foobar") + 1)); in bad_strncmp_2()
|
| H A D | not-null-terminated-result-strlen.c | 76 int bad_strncmp_2(char *str2, const char *str3) { in bad_strncmp_2() argument 77 return strncmp(str2, str3, 1 + strlen(str2)); in bad_strncmp_2()
|
| /llvm-project-15.0.7/llvm/test/MC/ELF/ |
| H A D | entsize.s | 13 .type .L.str2,@object # @.str2 14 .L.str2: 16 .size .L.str2, 7 19 .section .rodata.str2.1,"aMS",@progbits,2
|
| H A D | basic-elf-32.s | 12 movl $.L.str2, (%esp) 26 .type .L.str2,@object # @.str2 27 .L.str2: 29 .size .L.str2, 7
|
| H A D | basic-elf-64.s | 12 movl $.L.str2, %edi 58 .type .L.str2,@object # @.str2 59 .L.str2: 61 .size .L.str2, 7
|
| /llvm-project-15.0.7/llvm/test/MC/X86/AlignedBundling/ |
| H A D | rodata-section.s | 10 movl $.str2, 8(%esp) 27 .type .str2,@object 28 .str2: label 30 .size .str2, 7
|
| /llvm-project-15.0.7/flang/test/Semantics/ |
| H A D | resolve93.f90 | 8 character(10) str2 12 print *, str2(1:9) ! substring is ok 14 print *, str2(7)
|
| /llvm-project-15.0.7/compiler-rt/test/dfsan/ |
| H A D | custom.cpp | 242 char str2[sizeof(str1)]; in test_memcpy() local 247 char *ptr2 = str2; in test_memcpy() 254 ASSERT_ZERO_LABEL(str2[0]); in test_memcpy() 308 int rv = strcmp(str1, str2); in test_strcmp() 404 char str2[sizeof(str1)]; in test_strncpy() local 408 assert(strd == str2); in test_strncpy() 417 char *p2 = str2; in test_strncpy() 420 assert(strd == str2); in test_strncpy() 1524 char str2[] = "1s"; in test_strstr() local 1525 char *p2 = str2; in test_strstr() [all …]
|
| /llvm-project-15.0.7/llvm/test/MC/COFF/ |
| H A D | symbol-fragment-offset-64.s | 20 movl $.L_.str2, (%esp) 33 .align 16 # @.str2 34 .L_.str2:
|
| H A D | symbol-fragment-offset.s | 20 movl $L_.str2, (%esp) 33 .align 16 # @.str2 34 L_.str2:
|
| /llvm-project-15.0.7/llvm/test/CodeGen/X86/ |
| H A D | memcmp-constant.ll | 5 @.str2 = private constant [4 x i8] c"\ff\ff\ff\ff", align 1 64 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str2, i64 4) nounwind 73 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str2, i64 4) nounwind 83 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str2, i64 4) nounwind 93 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str2, i64 4) nounwind 103 %m = tail call i32 @memcmp(ptr @.str1, ptr @.str2, i64 4) nounwind
|
| /llvm-project-15.0.7/llvm/test/DebugInfo/X86/ |
| H A D | nodebug_with_debug_loc.ll | 31 ; string str2; 32 ; s2(&str2); 33 ; sink(&str2); 51 %str2.i = alloca %struct.string, align 4 52 %0 = bitcast %struct.string* %str2.i to i8*, !dbg !26 60 …call void @llvm.dbg.value(metadata %struct.string* %str2.i, metadata !16, metadata !DIExpression(D… 61 …call void @llvm.dbg.value(metadata %struct.string* %str2.i, metadata !27, metadata !DIExpression(D… 114 !16 = !DILocalVariable(name: "str2", line: 15, scope: !11, file: !12, type: !4)
|
| /llvm-project-15.0.7/lldb/test/API/lang/objc/sample/ |
| H A D | main.m | 56 NSString *str2 = [NSString stringWithFormat:@"string %i", 2]; 58 NSArray *array = [NSArray arrayWithObjects: str1, str2, str3, nil]; 61 str2, @"2",
|
| /llvm-project-15.0.7/lldb/test/API/lang/objcxx/sample/ |
| H A D | main.mm | 56 NSString *str2 = [NSString stringWithFormat:@"string %i", 2]; 58 NSArray *array = [NSArray arrayWithObjects: str1, str2, str3, nil]; 61 str2, @"2",
|
| /llvm-project-15.0.7/llvm/test/MC/WebAssembly/ |
| H A D | unnamed-data.ll | 6 @.str2 = private unnamed_addr constant [6 x i8] c"world\00", align 1 9 @b = global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str2, i32 0, i32 0), align 8 57 ; CHECK-NEXT: Name: .L.str2 79 ; CHECK-NEXT: Name: .rodata..L.str2
|