34 changes: 17 additions & 17 deletions clang/test/CoverageMapping/branch-constfolded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,93 +4,93 @@
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -fcoverage-mcdc -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name branch-constfolded.cpp %s | FileCheck %s -check-prefix=MCDC

// CHECK-LABEL: _Z6fand_0b:
bool fand_0(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:20 = M:0, C:2
bool fand_0(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:20 = M:3, C:2
return false && a; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:15 = 0, 0
} // CHECK: Branch,File 0, [[@LINE-1]]:19 -> [[@LINE-1]]:20 = #2, (#1 - #2)

// CHECK-LABEL: _Z6fand_1b:
bool fand_1(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:19 = M:0, C:2
bool fand_1(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:19 = M:3, C:2
return a && true; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:11 = #1, (#0 - #1)
} // CHECK: Branch,File 0, [[@LINE-1]]:15 -> [[@LINE-1]]:19 = 0, 0

// CHECK-LABEL: _Z6fand_2bb:
bool fand_2(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:25 = M:0, C:3
bool fand_2(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:25 = M:4, C:3
return false && a && b; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:15 = 0, 0
} // CHECK: Branch,File 0, [[@LINE-1]]:19 -> [[@LINE-1]]:20 = #4, (#3 - #4)
// CHECK: Branch,File 0, [[@LINE-2]]:24 -> [[@LINE-2]]:25 = #2, (#1 - #2)

// CHECK-LABEL: _Z6fand_3bb:
bool fand_3(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:24 = M:0, C:3
bool fand_3(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:24 = M:4, C:3
return a && true && b; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:11 = #3, (#0 - #3)
} // CHECK: Branch,File 0, [[@LINE-1]]:15 -> [[@LINE-1]]:19 = 0, 0
// CHECK: Branch,File 0, [[@LINE-2]]:23 -> [[@LINE-2]]:24 = #2, (#1 - #2)

// CHECK-LABEL: _Z6fand_4bb:
bool fand_4(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:25 = M:0, C:3
bool fand_4(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:25 = M:4, C:3
return a && b && false; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:11 = #3, (#0 - #3)
} // CHECK: Branch,File 0, [[@LINE-1]]:15 -> [[@LINE-1]]:16 = #4, (#3 - #4)
// CHECK: Branch,File 0, [[@LINE-2]]:20 -> [[@LINE-2]]:25 = 0, 0

// CHECK-LABEL: _Z6fand_5b:
bool fand_5(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:23 = M:0, C:2
bool fand_5(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:23 = M:3, C:2
return false && true; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:15 = 0, 0
} // CHECK: Branch,File 0, [[@LINE-1]]:19 -> [[@LINE-1]]:23 = 0, 0

// CHECK-LABEL: _Z6fand_6b:
bool fand_6(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:19 = M:0, C:2
bool fand_6(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:19 = M:3, C:2
return true && a; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:14 = 0, 0
} // CHECK: Branch,File 0, [[@LINE-1]]:18 -> [[@LINE-1]]:19 = #2, (#1 - #2)

// CHECK-LABEL: _Z6fand_7b:
bool fand_7(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:20 = M:0, C:2
bool fand_7(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:20 = M:3, C:2
return a && false; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:11 = #1, (#0 - #1)
} // CHECK: Branch,File 0, [[@LINE-1]]:15 -> [[@LINE-1]]:20 = 0, 0

// CHECK-LABEL: _Z5for_0b:
bool for_0(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:19 = M:0, C:2
bool for_0(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:19 = M:3, C:2
return true || a; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:14 = 0, 0
} // CHECK: Branch,File 0, [[@LINE-1]]:18 -> [[@LINE-1]]:19 = (#1 - #2), #2

// CHECK-LABEL: _Z5for_1b:
bool for_1(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:20 = M:0, C:2
bool for_1(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:20 = M:3, C:2
return a || false; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:11 = (#0 - #1), #1
} // CHECK: Branch,File 0, [[@LINE-1]]:15 -> [[@LINE-1]]:20 = 0, 0

// CHECK-LABEL: _Z5for_2bb:
bool for_2(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:24 = M:0, C:3
bool for_2(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:24 = M:4, C:3
return true || a || b; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:14 = 0, 0
} // CHECK: Branch,File 0, [[@LINE-1]]:18 -> [[@LINE-1]]:19 = (#3 - #4), #4
// CHECK: Branch,File 0, [[@LINE-2]]:23 -> [[@LINE-2]]:24 = (#1 - #2), #2

// CHECK-LABEL: _Z5for_3bb:
bool for_3(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:25 = M:0, C:3
bool for_3(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:25 = M:4, C:3
return a || false || b; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:11 = (#0 - #3), #3
} // CHECK: Branch,File 0, [[@LINE-1]]:15 -> [[@LINE-1]]:20 = 0, 0
// CHECK: Branch,File 0, [[@LINE-2]]:24 -> [[@LINE-2]]:25 = (#1 - #2), #2

// CHECK-LABEL: _Z5for_4bb:
bool for_4(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:24 = M:0, C:3
bool for_4(bool a, bool b) {// MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:24 = M:4, C:3
return a || b || true; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:11 = (#0 - #3), #3
} // CHECK: Branch,File 0, [[@LINE-1]]:15 -> [[@LINE-1]]:16 = (#3 - #4), #4
// CHECK: Branch,File 0, [[@LINE-2]]:20 -> [[@LINE-2]]:24 = 0, 0

// CHECK-LABEL: _Z5for_5b:
bool for_5(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:23 = M:0, C:2
bool for_5(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:23 = M:3, C:2
return true || false; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:14 = 0, 0
} // CHECK: Branch,File 0, [[@LINE-1]]:18 -> [[@LINE-1]]:23 = 0, 0

// CHECK-LABEL: _Z5for_6b:
bool for_6(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:20 = M:0, C:2
bool for_6(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:20 = M:3, C:2
return false || a; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:15 = 0, 0
} // CHECK: Branch,File 0, [[@LINE-1]]:19 -> [[@LINE-1]]:20 = (#1 - #2), #2

// CHECK-LABEL: _Z5for_7b:
bool for_7(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:19 = M:0, C:2
bool for_7(bool a) { // MCDC: Decision,File 0, [[@LINE+1]]:10 -> [[@LINE+1]]:19 = M:3, C:2
return a || true; // CHECK: Branch,File 0, [[@LINE]]:10 -> [[@LINE]]:11 = (#0 - #1), #1
} // CHECK: Branch,File 0, [[@LINE-1]]:15 -> [[@LINE-1]]:19 = 0, 0

// CHECK-LABEL: _Z5for_8b:
bool for_8(bool a) { // MCDC: Decision,File 0, [[@LINE+3]]:7 -> [[@LINE+3]]:20 = M:0, C:2
bool for_8(bool a) { // MCDC: Decision,File 0, [[@LINE+3]]:7 -> [[@LINE+3]]:20 = M:3, C:2
// CHECK: Branch,File 0, [[@LINE+2]]:7 -> [[@LINE+2]]:11 = 0, 0
// CHECK: Branch,File 0, [[@LINE+1]]:15 -> [[@LINE+1]]:20 = 0, 0
if (true && false)
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CoverageMapping/logical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

int main() { // CHECK: File 0, [[@LINE]]:12 -> [[@LINE+23]]:2 = #0
bool bt = true;
bool bf = false; // MCDC: Decision,File 0, [[@LINE+1]]:12 -> [[@LINE+1]]:20 = M:0, C:2
bool bf = false; // MCDC: Decision,File 0, [[@LINE+1]]:12 -> [[@LINE+1]]:20 = M:3, C:2
bool a = bt && bf; // CHECK-NEXT: File 0, [[@LINE]]:12 -> [[@LINE]]:14 = #0
// CHECK-NEXT: Branch,File 0, [[@LINE-1]]:12 -> [[@LINE-1]]:14 = #1, (#0 - #1)
// CHECK-NEXT: File 0, [[@LINE-2]]:18 -> [[@LINE-2]]:20 = #1
// CHECK-NEXT: Branch,File 0, [[@LINE-3]]:18 -> [[@LINE-3]]:20 = #2, (#1 - #2)
// MCDC: Decision,File 0, [[@LINE+1]]:7 -> [[@LINE+2]]:9 = M:1, C:2
// MCDC: Decision,File 0, [[@LINE+1]]:7 -> [[@LINE+2]]:9 = M:6, C:2
a = bt && // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:9 = #0
bf; // CHECK-NEXT: Branch,File 0, [[@LINE-1]]:7 -> [[@LINE-1]]:9 = #3, (#0 - #3)
// CHECK-NEXT: File 0, [[@LINE-1]]:7 -> [[@LINE-1]]:9 = #3
// CHECK-NEXT: Branch,File 0, [[@LINE-2]]:7 -> [[@LINE-2]]:9 = #4, (#3 - #4)
// MCDC: Decision,File 0, [[@LINE+1]]:7 -> [[@LINE+1]]:15 = M:2, C:2
// MCDC: Decision,File 0, [[@LINE+1]]:7 -> [[@LINE+1]]:15 = M:9, C:2
a = bf || bt; // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:9 = #0
// CHECK-NEXT: Branch,File 0, [[@LINE-1]]:7 -> [[@LINE-1]]:9 = (#0 - #5), #5
// CHECK-NEXT: File 0, [[@LINE-2]]:13 -> [[@LINE-2]]:15 = #5
// CHECK-NEXT: Branch,File 0, [[@LINE-3]]:13 -> [[@LINE-3]]:15 = (#5 - #6), #6
// MCDC: Decision,File 0, [[@LINE+1]]:7 -> [[@LINE+2]]:9 = M:3, C:2
// MCDC: Decision,File 0, [[@LINE+1]]:7 -> [[@LINE+2]]:9 = M:12, C:2
a = bf || // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:9 = #0
bt; // CHECK-NEXT: Branch,File 0, [[@LINE-1]]:7 -> [[@LINE-1]]:9 = (#0 - #7), #7
// CHECK-NEXT: File 0, [[@LINE-1]]:7 -> [[@LINE-1]]:9 = #7
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CoverageMapping/mcdc-class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Value::~Value(void) {
bar();
}

// CHECK-LABEL: Decision,File 0, 18:7 -> 18:31 = M:0, C:2
// CHECK-LABEL: Decision,File 0, 18:7 -> 18:31 = M:3, C:2
// CHECK-NEXT: Branch,File 0, 18:7 -> 18:17 = (#0 - #2), #2 [1,0,2]
// CHECK: Branch,File 0, 18:21 -> 18:31 = (#2 - #3), #3 [2,0,0]
// CHECK-LABEL: Decision,File 0, 22:7 -> 22:31 = M:0, C:2
// CHECK-LABEL: Decision,File 0, 22:7 -> 22:31 = M:3, C:2
// CHECK-NEXT: Branch,File 0, 22:7 -> 22:17 = (#0 - #2), #2 [1,0,2]
// CHECK: Branch,File 0, 22:21 -> 22:31 = (#2 - #3), #3 [2,0,0]
105 changes: 103 additions & 2 deletions clang/test/CoverageMapping/mcdc-error-conditions.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,108 @@
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -fcoverage-mcdc -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s 2>&1| FileCheck %s
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -fcoverage-mcdc -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s 2>&1| FileCheck %s --check-prefixes=CHECK,COND7,TV

// RUN: %clang_cc1 -fmcdc-max-test-vectors=8 -triple %itanium_abi_triple -std=c++11 -fcoverage-mcdc -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s 2>&1| FileCheck %s --check-prefixes=CHECK,COND7,TV
// RUN: %clang_cc1 -fmcdc-max-test-vectors=7 -triple %itanium_abi_triple -std=c++11 -fcoverage-mcdc -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s 2>&1| FileCheck %s --check-prefixes=CHECK,TV7,TV

// RUN: %clang_cc1 -fmcdc-max-conditions=287 -triple %itanium_abi_triple -std=c++11 -fcoverage-mcdc -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s 2>&1| FileCheck %s --check-prefixes=CHECK,COND7,TV
// RUN: %clang_cc1 -fmcdc-max-conditions=286 -triple %itanium_abi_triple -std=c++11 -fcoverage-mcdc -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s 2>&1| FileCheck %s --check-prefixes=CHECK,COND7,COND
// RUN: %clang_cc1 -fmcdc-max-conditions=7 -triple %itanium_abi_triple -std=c++11 -fcoverage-mcdc -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s 2>&1| FileCheck %s --check-prefixes=CHECK,COND7,COND
// RUN: %clang_cc1 -fmcdc-max-conditions=6 -triple %itanium_abi_triple -std=c++11 -fcoverage-mcdc -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s 2>&1| FileCheck %s --check-prefixes=CHECK,COND6,COND

bool func_conditions(bool a, bool b, bool c, bool d, bool e, bool f, bool g) {
// TV7: :[[@LINE+2]]:10: warning: unsupported MC/DC boolean expression; number of test vectors (8) exceeds max
// COND6: :[[@LINE+1]]:10: warning: unsupported MC/DC boolean expression; number of conditions (7) exceeds max
return a && b && c && d && e && f && g;
}

// CHECK: warning: unsupported MC/DC boolean expression; number of conditions{{.*}} exceeds max
// From clang-tidy/misc/MisleadingIdentifier.cpp
bool func_isR(unsigned CP) {
// TV: :[[@LINE+2]]:10: warning: unsupported MC/DC boolean expression; number of test vectors (2147483647) exceeds max
// COND: :[[@LINE+1]]:10: warning: unsupported MC/DC boolean expression; number of conditions (287) exceeds max
return (CP == 0x0590) || (CP == 0x05BE) || (CP == 0x05C0) || (CP == 0x05C3) ||
(CP == 0x05C6) || (0x05C8 <= CP && CP <= 0x05CF) ||
(0x05D0 <= CP && CP <= 0x05EA) || (0x05EB <= CP && CP <= 0x05EE) ||
(0x05EF <= CP && CP <= 0x05F2) || (0x05F3 <= CP && CP <= 0x05F4) ||
(0x05F5 <= CP && CP <= 0x05FF) || (0x07C0 <= CP && CP <= 0x07C9) ||
(0x07CA <= CP && CP <= 0x07EA) || (0x07F4 <= CP && CP <= 0x07F5) ||
(CP == 0x07FA) || (0x07FB <= CP && CP <= 0x07FC) ||
(0x07FE <= CP && CP <= 0x07FF) || (0x0800 <= CP && CP <= 0x0815) ||
(CP == 0x081A) || (CP == 0x0824) || (CP == 0x0828) ||
(0x082E <= CP && CP <= 0x082F) || (0x0830 <= CP && CP <= 0x083E) ||
(CP == 0x083F) || (0x0840 <= CP && CP <= 0x0858) ||
(0x085C <= CP && CP <= 0x085D) || (CP == 0x085E) || (CP == 0x085F) ||
(CP == 0x200F) || (CP == 0xFB1D) || (0xFB1F <= CP && CP <= 0xFB28) ||
(0xFB2A <= CP && CP <= 0xFB36) || (CP == 0xFB37) ||
(0xFB38 <= CP && CP <= 0xFB3C) || (CP == 0xFB3D) || (CP == 0xFB3E) ||
(CP == 0xFB3F) || (0xFB40 <= CP && CP <= 0xFB41) || (CP == 0xFB42) ||
(0xFB43 <= CP && CP <= 0xFB44) || (CP == 0xFB45) ||
(0xFB46 <= CP && CP <= 0xFB4F) || (0x10800 <= CP && CP <= 0x10805) ||
(0x10806 <= CP && CP <= 0x10807) || (CP == 0x10808) ||
(CP == 0x10809) || (0x1080A <= CP && CP <= 0x10835) ||
(CP == 0x10836) || (0x10837 <= CP && CP <= 0x10838) ||
(0x10839 <= CP && CP <= 0x1083B) || (CP == 0x1083C) ||
(0x1083D <= CP && CP <= 0x1083E) || (0x1083F <= CP && CP <= 0x10855) ||
(CP == 0x10856) || (CP == 0x10857) ||
(0x10858 <= CP && CP <= 0x1085F) || (0x10860 <= CP && CP <= 0x10876) ||
(0x10877 <= CP && CP <= 0x10878) || (0x10879 <= CP && CP <= 0x1087F) ||
(0x10880 <= CP && CP <= 0x1089E) || (0x1089F <= CP && CP <= 0x108A6) ||
(0x108A7 <= CP && CP <= 0x108AF) || (0x108B0 <= CP && CP <= 0x108DF) ||
(0x108E0 <= CP && CP <= 0x108F2) || (CP == 0x108F3) ||
(0x108F4 <= CP && CP <= 0x108F5) || (0x108F6 <= CP && CP <= 0x108FA) ||
(0x108FB <= CP && CP <= 0x108FF) || (0x10900 <= CP && CP <= 0x10915) ||
(0x10916 <= CP && CP <= 0x1091B) || (0x1091C <= CP && CP <= 0x1091E) ||
(0x10920 <= CP && CP <= 0x10939) || (0x1093A <= CP && CP <= 0x1093E) ||
(CP == 0x1093F) || (0x10940 <= CP && CP <= 0x1097F) ||
(0x10980 <= CP && CP <= 0x109B7) || (0x109B8 <= CP && CP <= 0x109BB) ||
(0x109BC <= CP && CP <= 0x109BD) || (0x109BE <= CP && CP <= 0x109BF) ||
(0x109C0 <= CP && CP <= 0x109CF) || (0x109D0 <= CP && CP <= 0x109D1) ||
(0x109D2 <= CP && CP <= 0x109FF) || (CP == 0x10A00) ||
(CP == 0x10A04) || (0x10A07 <= CP && CP <= 0x10A0B) ||
(0x10A10 <= CP && CP <= 0x10A13) || (CP == 0x10A14) ||
(0x10A15 <= CP && CP <= 0x10A17) || (CP == 0x10A18) ||
(0x10A19 <= CP && CP <= 0x10A35) || (0x10A36 <= CP && CP <= 0x10A37) ||
(0x10A3B <= CP && CP <= 0x10A3E) || (0x10A40 <= CP && CP <= 0x10A48) ||
(0x10A49 <= CP && CP <= 0x10A4F) || (0x10A50 <= CP && CP <= 0x10A58) ||
(0x10A59 <= CP && CP <= 0x10A5F) || (0x10A60 <= CP && CP <= 0x10A7C) ||
(0x10A7D <= CP && CP <= 0x10A7E) || (CP == 0x10A7F) ||
(0x10A80 <= CP && CP <= 0x10A9C) || (0x10A9D <= CP && CP <= 0x10A9F) ||
(0x10AA0 <= CP && CP <= 0x10ABF) || (0x10AC0 <= CP && CP <= 0x10AC7) ||
(CP == 0x10AC8) || (0x10AC9 <= CP && CP <= 0x10AE4) ||
(0x10AE7 <= CP && CP <= 0x10AEA) || (0x10AEB <= CP && CP <= 0x10AEF) ||
(0x10AF0 <= CP && CP <= 0x10AF6) || (0x10AF7 <= CP && CP <= 0x10AFF) ||
(0x10B00 <= CP && CP <= 0x10B35) || (0x10B36 <= CP && CP <= 0x10B38) ||
(0x10B40 <= CP && CP <= 0x10B55) || (0x10B56 <= CP && CP <= 0x10B57) ||
(0x10B58 <= CP && CP <= 0x10B5F) || (0x10B60 <= CP && CP <= 0x10B72) ||
(0x10B73 <= CP && CP <= 0x10B77) || (0x10B78 <= CP && CP <= 0x10B7F) ||
(0x10B80 <= CP && CP <= 0x10B91) || (0x10B92 <= CP && CP <= 0x10B98) ||
(0x10B99 <= CP && CP <= 0x10B9C) || (0x10B9D <= CP && CP <= 0x10BA8) ||
(0x10BA9 <= CP && CP <= 0x10BAF) || (0x10BB0 <= CP && CP <= 0x10BFF) ||
(0x10C00 <= CP && CP <= 0x10C48) || (0x10C49 <= CP && CP <= 0x10C7F) ||
(0x10C80 <= CP && CP <= 0x10CB2) || (0x10CB3 <= CP && CP <= 0x10CBF) ||
(0x10CC0 <= CP && CP <= 0x10CF2) || (0x10CF3 <= CP && CP <= 0x10CF9) ||
(0x10CFA <= CP && CP <= 0x10CFF) || (0x10D40 <= CP && CP <= 0x10E5F) ||
(CP == 0x10E7F) || (0x10E80 <= CP && CP <= 0x10EA9) ||
(CP == 0x10EAA) || (CP == 0x10EAD) ||
(0x10EAE <= CP && CP <= 0x10EAF) || (0x10EB0 <= CP && CP <= 0x10EB1) ||
(0x10EB2 <= CP && CP <= 0x10EFF) || (0x10F00 <= CP && CP <= 0x10F1C) ||
(0x10F1D <= CP && CP <= 0x10F26) || (CP == 0x10F27) ||
(0x10F28 <= CP && CP <= 0x10F2F) || (0x10F70 <= CP && CP <= 0x10F81) ||
(0x10F86 <= CP && CP <= 0x10F89) || (0x10F8A <= CP && CP <= 0x10FAF) ||
(0x10FB0 <= CP && CP <= 0x10FC4) || (0x10FC5 <= CP && CP <= 0x10FCB) ||
(0x10FCC <= CP && CP <= 0x10FDF) || (0x10FE0 <= CP && CP <= 0x10FF6) ||
(0x10FF7 <= CP && CP <= 0x10FFF) || (0x1E800 <= CP && CP <= 0x1E8C4) ||
(0x1E8C5 <= CP && CP <= 0x1E8C6) || (0x1E8C7 <= CP && CP <= 0x1E8CF) ||
(0x1E8D7 <= CP && CP <= 0x1E8FF) || (0x1E900 <= CP && CP <= 0x1E943) ||
(CP == 0x1E94B) || (0x1E94C <= CP && CP <= 0x1E94F) ||
(0x1E950 <= CP && CP <= 0x1E959) || (0x1E95A <= CP && CP <= 0x1E95D) ||
(0x1E95E <= CP && CP <= 0x1E95F) || (0x1E960 <= CP && CP <= 0x1EC6F) ||
(0x1ECC0 <= CP && CP <= 0x1ECFF) || (0x1ED50 <= CP && CP <= 0x1EDFF);
}

// CHECK: _Z15func_conditionsbbbbbbb:
// TV8-NOT: Decision,
// COND6-NOT: Decision,
// COND7: Decision,File 0, {{[0-9]+}}:10 -> {{[0-9]+}}:41 = M:8, C:7
// CHECK: _Z8func_isRj:
// CHECK-NOT: Decision,
// CHECK-NOT: Branch,{{.*}}]
// CHECK: Branch,File 0, [[@LINE-10]]:64 -> [[@LINE-10]]:77 =
30 changes: 15 additions & 15 deletions clang/test/CoverageMapping/mcdc-logical-scalar-ids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ bool func_scalar_and(bool a, bool b, bool c, bool d, bool e, bool f) {
return bar(res1, res2, res3, res4, res5);
}

// CHECK-LABEL: Decision,File 0, 5:17 -> 5:23 = M:0, C:2
// CHECK-LABEL: Decision,File 0, 5:17 -> 5:23 = M:3, C:2
// CHECK-NEXT: Branch,File 0, 5:17 -> 5:18 = #1, (#0 - #1) [1,2,0]
// CHECK: Branch,File 0, 5:22 -> 5:23 = #2, (#1 - #2) [2,0,0]
// CHECK-LABEL: Decision,File 0, 6:17 -> 6:28 = M:1, C:3
// CHECK-LABEL: Decision,File 0, 6:17 -> 6:28 = M:7, C:3
// CHECK-NEXT: Branch,File 0, 6:17 -> 6:18 = #5, (#0 - #5) [1,3,0]
// CHECK: Branch,File 0, 6:22 -> 6:23 = #6, (#5 - #6) [3,2,0]
// CHECK: Branch,File 0, 6:27 -> 6:28 = #4, (#3 - #4) [2,0,0]
// CHECK-LABEL: Decision,File 0, 7:17 -> 7:33 = M:2, C:4
// CHECK-LABEL: Decision,File 0, 7:17 -> 7:33 = M:12, C:4
// CHECK-NEXT: Branch,File 0, 7:17 -> 7:18 = #11, (#0 - #11) [1,4,0]
// CHECK: Branch,File 0, 7:22 -> 7:23 = #12, (#11 - #12) [4,3,0]
// CHECK: Branch,File 0, 7:27 -> 7:28 = #10, (#9 - #10) [3,2,0]
// CHECK: Branch,File 0, 7:32 -> 7:33 = #8, (#7 - #8) [2,0,0]
// CHECK-LABEL: Decision,File 0, 8:17 -> 8:38 = M:4, C:5
// CHECK-LABEL: Decision,File 0, 8:17 -> 8:38 = M:18, C:5
// CHECK-NEXT: Branch,File 0, 8:17 -> 8:18 = #19, (#0 - #19) [1,5,0]
// CHECK: Branch,File 0, 8:22 -> 8:23 = #20, (#19 - #20) [5,4,0]
// CHECK: Branch,File 0, 8:27 -> 8:28 = #18, (#17 - #18) [4,3,0]
// CHECK: Branch,File 0, 8:32 -> 8:33 = #16, (#15 - #16) [3,2,0]
// CHECK: Branch,File 0, 8:37 -> 8:38 = #14, (#13 - #14) [2,0,0]
// CHECK-LABEL: Decision,File 0, 9:17 -> 9:43 = M:8, C:6
// CHECK-LABEL: Decision,File 0, 9:17 -> 9:43 = M:25, C:6
// CHECK-NEXT: Branch,File 0, 9:17 -> 9:18 = #29, (#0 - #29) [1,6,0]
// CHECK: Branch,File 0, 9:22 -> 9:23 = #30, (#29 - #30) [6,5,0]
// CHECK: Branch,File 0, 9:27 -> 9:28 = #28, (#27 - #28) [5,4,0]
Expand All @@ -45,25 +45,25 @@ bool func_scalar_or(bool a, bool b, bool c, bool d, bool e, bool f) {
return bar(res1, res2, res3, res4, res5);
}

// CHECK-LABEL: Decision,File 0, 40:17 -> 40:23 = M:0, C:2
// CHECK-LABEL: Decision,File 0, 40:17 -> 40:23 = M:3, C:2
// CHECK-NEXT: Branch,File 0, 40:17 -> 40:18 = (#0 - #1), #1 [1,0,2]
// CHECK: Branch,File 0, 40:22 -> 40:23 = (#1 - #2), #2 [2,0,0]
// CHECK-LABEL: Decision,File 0, 41:17 -> 41:28 = M:1, C:3
// CHECK-LABEL: Decision,File 0, 41:17 -> 41:28 = M:7, C:3
// CHECK-NEXT: Branch,File 0, 41:17 -> 41:18 = (#0 - #5), #5 [1,0,3]
// CHECK: Branch,File 0, 41:22 -> 41:23 = (#5 - #6), #6 [3,0,2]
// CHECK: Branch,File 0, 41:27 -> 41:28 = (#3 - #4), #4 [2,0,0]
// CHECK-LABEL: Decision,File 0, 42:17 -> 42:33 = M:2, C:4
// CHECK-LABEL: Decision,File 0, 42:17 -> 42:33 = M:12, C:4
// CHECK-NEXT: Branch,File 0, 42:17 -> 42:18 = (#0 - #11), #11 [1,0,4]
// CHECK: Branch,File 0, 42:22 -> 42:23 = (#11 - #12), #12 [4,0,3]
// CHECK: Branch,File 0, 42:27 -> 42:28 = (#9 - #10), #10 [3,0,2]
// CHECK: Branch,File 0, 42:32 -> 42:33 = (#7 - #8), #8 [2,0,0]
// CHECK-LABEL: Decision,File 0, 43:17 -> 43:38 = M:4, C:5
// CHECK-LABEL: Decision,File 0, 43:17 -> 43:38 = M:18, C:5
// CHECK-NEXT: Branch,File 0, 43:17 -> 43:18 = (#0 - #19), #19 [1,0,5]
// CHECK: Branch,File 0, 43:22 -> 43:23 = (#19 - #20), #20 [5,0,4]
// CHECK: Branch,File 0, 43:27 -> 43:28 = (#17 - #18), #18 [4,0,3]
// CHECK: Branch,File 0, 43:32 -> 43:33 = (#15 - #16), #16 [3,0,2]
// CHECK: Branch,File 0, 43:37 -> 43:38 = (#13 - #14), #14 [2,0,0]
// CHECK-LABEL: Decision,File 0, 44:17 -> 44:43 = M:8, C:6
// CHECK-LABEL: Decision,File 0, 44:17 -> 44:43 = M:25, C:6
// CHECK-NEXT: Branch,File 0, 44:17 -> 44:18 = (#0 - #29), #29 [1,0,6]
// CHECK: Branch,File 0, 44:22 -> 44:23 = (#29 - #30), #30 [6,0,5]
// CHECK: Branch,File 0, 44:27 -> 44:28 = (#27 - #28), #28 [5,0,4]
Expand All @@ -81,26 +81,26 @@ bool func_scalar_mix(bool a, bool b, bool c, bool d, bool e, bool f) {
return bar(res1, res2, res3, res4, res5);
}

// CHECK-LABEL: Decision,File 0, 76:17 -> 76:23 = M:0, C:2
// CHECK-LABEL: Decision,File 0, 76:17 -> 76:23 = M:3, C:2
// CHECK-NEXT: Branch,File 0, 76:17 -> 76:18 = (#0 - #1), #1 [1,0,2]
// CHECK: Branch,File 0, 76:22 -> 76:23 = (#1 - #2), #2 [2,0,0]
// CHECK-LABEL: Decision,File 0, 77:17 -> 77:30 = M:1, C:3
// CHECK-LABEL: Decision,File 0, 77:17 -> 77:30 = M:7, C:3
// CHECK-NEXT: Branch,File 0, 77:17 -> 77:18 = #3, (#0 - #3) [1,2,0]
// CHECK: Branch,File 0, 77:23 -> 77:24 = (#3 - #4), #4 [2,0,3]
// CHECK: Branch,File 0, 77:28 -> 77:29 = (#4 - #5), #5 [3,0,0]
// CHECK-LABEL: Decision,File 0, 78:17 -> 78:37 = M:2, C:4
// CHECK-LABEL: Decision,File 0, 78:17 -> 78:37 = M:14, C:4
// CHECK-NEXT: File 0
// CHECK-NEXT: Branch,File 0, 78:18 -> 78:19 = (#0 - #7), #7 [1,2,3]
// CHECK: Branch,File 0, 78:23 -> 78:24 = (#7 - #8), #8 [3,2,0]
// CHECK: Branch,File 0, 78:30 -> 78:31 = (#6 - #9), #9 [2,0,4]
// CHECK: Branch,File 0, 78:35 -> 78:36 = (#9 - #10), #10 [4,0,0]
// CHECK-LABEL: Decision,File 0, 79:17 -> 79:42 = M:4, C:5
// CHECK-LABEL: Decision,File 0, 79:17 -> 79:42 = M:22, C:5
// CHECK-NEXT: Branch,File 0, 79:17 -> 79:18 = #12, (#0 - #12) [1,3,0]
// CHECK: Branch,File 0, 79:23 -> 79:24 = (#12 - #13), #13 [3,2,4]
// CHECK: Branch,File 0, 79:28 -> 79:29 = (#13 - #14), #14 [4,2,0]
// CHECK: Branch,File 0, 79:35 -> 79:36 = (#11 - #15), #15 [2,0,5]
// CHECK: Branch,File 0, 79:40 -> 79:41 = (#15 - #16), #16 [5,0,0]
// CHECK-LABEL: Decision,File 0, 80:17 -> 80:49 = M:8, C:6
// CHECK-LABEL: Decision,File 0, 80:17 -> 80:49 = M:37, C:6
// CHECK-NEXT: File 0
// CHECK-NEXT: Branch,File 0, 80:18 -> 80:19 = (#0 - #19), #19 [1,3,4]
// CHECK: Branch,File 0, 80:23 -> 80:24 = (#19 - #20), #20 [4,3,0]
Expand Down
32 changes: 16 additions & 16 deletions clang/test/CoverageMapping/mcdc-logical-stmt-ids-all.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bool func_if_and(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 4:7 -> 4:33 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 4:7 -> 4:33 = M:7, C:6
// CHECK-NEXT: Branch,File 0, 4:7 -> 4:8 = #10, (#0 - #10) [1,6,0]
// CHECK: Branch,File 0, 4:12 -> 4:13 = #11, (#10 - #11) [6,5,0]
// CHECK: Branch,File 0, 4:17 -> 4:18 = #9, (#8 - #9) [5,4,0]
Expand All @@ -20,7 +20,7 @@ bool func_if_or(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 18:7 -> 18:33 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 18:7 -> 18:33 = M:7, C:6
// CHECK-NEXT: Branch,File 0, 18:7 -> 18:8 = (#0 - #10), #10 [1,0,6]
// CHECK: Branch,File 0, 18:12 -> 18:13 = (#10 - #11), #11 [6,0,5]
// CHECK: Branch,File 0, 18:17 -> 18:18 = (#8 - #9), #9 [5,0,4]
Expand All @@ -33,7 +33,7 @@ bool func_while_and(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 32:10 -> 32:36 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 32:10 -> 32:36 = M:7, C:6
// CHECK-NEXT: Branch,File 0, 32:10 -> 32:11 = #10, (#0 - #10) [1,6,0]
// CHECK: Branch,File 0, 32:15 -> 32:16 = #11, (#10 - #11) [6,5,0]
// CHECK: Branch,File 0, 32:20 -> 32:21 = #9, (#8 - #9) [5,4,0]
Expand All @@ -46,7 +46,7 @@ bool func_while_or(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 45:10 -> 45:36 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 45:10 -> 45:36 = M:7, C:6
// CHECK-NEXT: Branch,File 0, 45:10 -> 45:11 = (#0 - #10), #10 [1,0,6]
// CHECK: Branch,File 0, 45:15 -> 45:16 = (#10 - #11), #11 [6,0,5]
// CHECK: Branch,File 0, 45:20 -> 45:21 = (#8 - #9), #9 [5,0,4]
Expand All @@ -59,7 +59,7 @@ bool func_for_and(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 58:9 -> 58:35 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 58:9 -> 58:35 = M:7, C:6
// CHECK-NEXT: Branch,File 0, 58:9 -> 58:10 = #10, (#0 - #10) [1,6,0]
// CHECK: Branch,File 0, 58:14 -> 58:15 = #11, (#10 - #11) [6,5,0]
// CHECK: Branch,File 0, 58:19 -> 58:20 = #9, (#8 - #9) [5,4,0]
Expand All @@ -72,7 +72,7 @@ bool func_for_or(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 71:9 -> 71:35 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 71:9 -> 71:35 = M:7, C:6
// CHECK-NEXT: Branch,File 0, 71:9 -> 71:10 = (#0 - #10), #10 [1,0,6]
// CHECK: Branch,File 0, 71:14 -> 71:15 = (#10 - #11), #11 [6,0,5]
// CHECK: Branch,File 0, 71:19 -> 71:20 = (#8 - #9), #9 [5,0,4]
Expand All @@ -85,7 +85,7 @@ bool func_do_and(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 84:16 -> 84:42 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 84:16 -> 84:42 = M:7, C:6
// CHECK-NEXT: Branch,File 0, 84:16 -> 84:17 = #10, ((#0 + #1) - #10) [1,6,0]
// CHECK: Branch,File 0, 84:21 -> 84:22 = #11, (#10 - #11) [6,5,0]
// CHECK: Branch,File 0, 84:26 -> 84:27 = #9, (#8 - #9) [5,4,0]
Expand All @@ -98,7 +98,7 @@ bool func_do_or(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 97:16 -> 97:42 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 97:16 -> 97:42 = M:7, C:6
// CHECK-NEXT: Branch,File 0, 97:16 -> 97:17 = ((#0 + #1) - #10), #10 [1,0,6]
// CHECK: Branch,File 0, 97:21 -> 97:22 = (#10 - #11), #11 [6,0,5]
// CHECK: Branch,File 0, 97:26 -> 97:27 = (#8 - #9), #9 [5,0,4]
Expand All @@ -110,7 +110,7 @@ bool func_ternary_and(bool a, bool b, bool c, bool d, bool e, bool f) {
return (a && b && c && d && e && f) ? true : false;
}

// CHECK-LABEL: Decision,File 0, 110:11 -> 110:37 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 110:11 -> 110:37 = M:7, C:6
// CHECK-NEXT: Branch,File 0, 110:11 -> 110:12 = #10, (#0 - #10) [1,6,0]
// CHECK: Branch,File 0, 110:16 -> 110:17 = #11, (#10 - #11) [6,5,0]
// CHECK: Branch,File 0, 110:21 -> 110:22 = #9, (#8 - #9) [5,4,0]
Expand All @@ -122,7 +122,7 @@ bool func_ternary_or(bool a, bool b, bool c, bool d, bool e, bool f) {
return (a || b || c || d || e || f) ? true : false;
}

// CHECK-LABEL: Decision,File 0, 122:11 -> 122:37 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 122:11 -> 122:37 = M:7, C:6
// CHECK-NEXT: Branch,File 0, 122:11 -> 122:12 = (#0 - #10), #10 [1,0,6]
// CHECK: Branch,File 0, 122:16 -> 122:17 = (#10 - #11), #11 [6,0,5]
// CHECK: Branch,File 0, 122:21 -> 122:22 = (#8 - #9), #9 [5,0,4]
Expand All @@ -137,7 +137,7 @@ bool func_if_nested_if(bool a, bool b, bool c, bool d, bool e) {
return false;
}

// CHECK-LABEL: Decision,File 0, 134:7 -> 134:30 = M:0, C:5
// CHECK-LABEL: Decision,File 0, 134:7 -> 134:30 = M:8, C:5
// CHECK-NEXT: Branch,File 0, 134:7 -> 134:8 = (#0 - #6), #6 [1,0,4]
// CHECK: Branch,File 0, 134:13 -> 134:14 = #7, (#6 - #7) [4,5,3]
// CHECK: Branch,File 0, 134:18 -> 134:19 = #8, (#7 - #8) [5,0,3]
Expand All @@ -148,7 +148,7 @@ bool func_ternary_nested_if(bool a, bool b, bool c, bool d, bool e) {
return (a || (b && c) || d || e) ? true : false;
}

// CHECK-LABEL: Decision,File 0, 148:11 -> 148:34 = M:0, C:5
// CHECK-LABEL: Decision,File 0, 148:11 -> 148:34 = M:8, C:5
// CHECK-NEXT: Branch,File 0, 148:11 -> 148:12 = (#0 - #6), #6 [1,0,4]
// CHECK: Branch,File 0, 148:17 -> 148:18 = #7, (#6 - #7) [4,5,3]
// CHECK: Branch,File 0, 148:22 -> 148:23 = #8, (#7 - #8) [5,0,3]
Expand All @@ -162,7 +162,7 @@ bool func_if_nested_if_2(bool a, bool b, bool c, bool d, bool e) {
return false;
}

// CHECK-LABEL: Decision,File 0, 159:7 -> 159:32 = M:0, C:5
// CHECK-LABEL: Decision,File 0, 159:7 -> 159:32 = M:9, C:5
// CHECK-NEXT: Branch,File 0, 159:7 -> 159:8 = (#0 - #2), #2 [1,0,2]
// CHECK: Branch,File 0, 159:14 -> 159:15 = #7, (#2 - #7) [2,5,4]
// CHECK: Branch,File 0, 159:19 -> 159:20 = #8, (#7 - #8) [5,3,4]
Expand All @@ -173,7 +173,7 @@ bool func_ternary_nested_if_2(bool a, bool b, bool c, bool d, bool e) {
return (a || ((b && c) || d) && e) ? true : false;
}

// CHECK-LABEL: Decision,File 0, 173:11 -> 173:36 = M:0, C:5
// CHECK-LABEL: Decision,File 0, 173:11 -> 173:36 = M:9, C:5
// CHECK-NEXT: Branch,File 0, 173:11 -> 173:12 = (#0 - #2), #2 [1,0,2]
// CHECK: Branch,File 0, 173:18 -> 173:19 = #7, (#2 - #7) [2,5,4]
// CHECK: Branch,File 0, 173:23 -> 173:24 = #8, (#7 - #8) [5,3,4]
Expand All @@ -187,7 +187,7 @@ bool func_if_nested_if_3(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 184:7 -> 184:39 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 184:7 -> 184:39 = M:12, C:6
// CHECK: Branch,File 0, 184:8 -> 184:9 = #5, (#0 - #5) [1,4,3]
// CHECK: Branch,File 0, 184:14 -> 184:15 = (#5 - #6), #6 [4,2,5]
// CHECK: Branch,File 0, 184:19 -> 184:20 = (#6 - #7), #7 [5,2,3]
Expand All @@ -199,7 +199,7 @@ bool func_ternary_nested_if_3(bool a, bool b, bool c, bool d, bool e, bool f) {
return ((a && (b || c) || (d && e)) && f) ? true : false;
}

// CHECK-LABEL: Decision,File 0, 199:11 -> 199:43 = M:0, C:6
// CHECK-LABEL: Decision,File 0, 199:11 -> 199:43 = M:12, C:6
// CHECK: Branch,File 0, 199:12 -> 199:13 = #5, (#0 - #5) [1,4,3]
// CHECK: Branch,File 0, 199:18 -> 199:19 = (#5 - #6), #6 [4,2,5]
// CHECK: Branch,File 0, 199:23 -> 199:24 = (#6 - #7), #7 [5,2,3]
Expand Down
30 changes: 15 additions & 15 deletions clang/test/CoverageMapping/mcdc-logical-stmt-ids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ bool func_if_and(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 4:7 -> 4:13 = M:0, C:2
// CHECK-LABEL: Decision,File 0, 4:7 -> 4:13 = M:3, C:2
// CHECK-NEXT: Branch,File 0, 4:7 -> 4:8 = #2, (#0 - #2) [1,2,0]
// CHECK: Branch,File 0, 4:12 -> 4:13 = #3, (#2 - #3) [2,0,0]
// CHECK-LABEL: Decision,File 0, 5:9 -> 5:20 = M:1, C:3
// CHECK-LABEL: Decision,File 0, 5:9 -> 5:20 = M:7, C:3
// CHECK-NEXT: Branch,File 0, 5:9 -> 5:10 = #7, (#1 - #7) [1,3,0]
// CHECK: Branch,File 0, 5:14 -> 5:15 = #8, (#7 - #8) [3,2,0]
// CHECK: Branch,File 0, 5:19 -> 5:20 = #6, (#5 - #6) [2,0,0]
// CHECK-LABEL: Decision,File 0, 6:11 -> 6:27 = M:2, C:4
// CHECK-LABEL: Decision,File 0, 6:11 -> 6:27 = M:12, C:4
// CHECK-NEXT: Branch,File 0, 6:11 -> 6:12 = #14, (#4 - #14) [1,4,0]
// CHECK: Branch,File 0, 6:16 -> 6:17 = #15, (#14 - #15) [4,3,0]
// CHECK: Branch,File 0, 6:21 -> 6:22 = #13, (#12 - #13) [3,2,0]
// CHECK: Branch,File 0, 6:26 -> 6:27 = #11, (#10 - #11) [2,0,0]
// CHECK-LABEL: Decision,File 0, 7:13 -> 7:34 = M:4, C:5
// CHECK-LABEL: Decision,File 0, 7:13 -> 7:34 = M:18, C:5
// CHECK-NEXT: Branch,File 0, 7:13 -> 7:14 = #23, (#9 - #23) [1,5,0]
// CHECK: Branch,File 0, 7:18 -> 7:19 = #24, (#23 - #24) [5,4,0]
// CHECK: Branch,File 0, 7:23 -> 7:24 = #22, (#21 - #22) [4,3,0]
// CHECK: Branch,File 0, 7:28 -> 7:29 = #20, (#19 - #20) [3,2,0]
// CHECK: Branch,File 0, 7:33 -> 7:34 = #18, (#17 - #18) [2,0,0]
// CHECK-LABEL: Decision,File 0, 8:16 -> 8:42 = M:8, C:6
// CHECK-LABEL: Decision,File 0, 8:16 -> 8:42 = M:25, C:6
// CHECK-NEXT: Branch,File 0, 8:16 -> 8:17 = #34, (#16 - #34) [1,6,0]
// CHECK: Branch,File 0, 8:21 -> 8:22 = #35, (#34 - #35) [6,5,0]
// CHECK: Branch,File 0, 8:26 -> 8:27 = #33, (#32 - #33) [5,4,0]
Expand All @@ -46,25 +46,25 @@ bool func_if_or(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 40:7 -> 40:13 = M:0, C:2
// CHECK-LABEL: Decision,File 0, 40:7 -> 40:13 = M:3, C:2
// CHECK-NEXT: Branch,File 0, 40:7 -> 40:8 = (#0 - #2), #2 [1,0,2]
// CHECK: Branch,File 0, 40:12 -> 40:13 = (#2 - #3), #3 [2,0,0]
// CHECK-LABEL: Decision,File 0, 41:9 -> 41:20 = M:1, C:3
// CHECK-LABEL: Decision,File 0, 41:9 -> 41:20 = M:7, C:3
// CHECK-NEXT: Branch,File 0, 41:9 -> 41:10 = (#1 - #7), #7 [1,0,3]
// CHECK: Branch,File 0, 41:14 -> 41:15 = (#7 - #8), #8 [3,0,2]
// CHECK: Branch,File 0, 41:19 -> 41:20 = (#5 - #6), #6 [2,0,0]
// CHECK-LABEL: Decision,File 0, 42:11 -> 42:27 = M:2, C:4
// CHECK-LABEL: Decision,File 0, 42:11 -> 42:27 = M:12, C:4
// CHECK-NEXT: Branch,File 0, 42:11 -> 42:12 = (#4 - #14), #14 [1,0,4]
// CHECK: Branch,File 0, 42:16 -> 42:17 = (#14 - #15), #15 [4,0,3]
// CHECK: Branch,File 0, 42:21 -> 42:22 = (#12 - #13), #13 [3,0,2]
// CHECK: Branch,File 0, 42:26 -> 42:27 = (#10 - #11), #11 [2,0,0]
// CHECK-LABEL: Decision,File 0, 43:13 -> 43:34 = M:4, C:5
// CHECK-LABEL: Decision,File 0, 43:13 -> 43:34 = M:18, C:5
// CHECK-NEXT: Branch,File 0, 43:13 -> 43:14 = (#9 - #23), #23 [1,0,5]
// CHECK: Branch,File 0, 43:18 -> 43:19 = (#23 - #24), #24 [5,0,4]
// CHECK: Branch,File 0, 43:23 -> 43:24 = (#21 - #22), #22 [4,0,3]
// CHECK: Branch,File 0, 43:28 -> 43:29 = (#19 - #20), #20 [3,0,2]
// CHECK: Branch,File 0, 43:33 -> 43:34 = (#17 - #18), #18 [2,0,0]
// CHECK-LABEL: Decision,File 0, 44:16 -> 44:42 = M:8, C:6
// CHECK-LABEL: Decision,File 0, 44:16 -> 44:42 = M:25, C:6
// CHECK-NEXT: Branch,File 0, 44:16 -> 44:17 = (#16 - #34), #34 [1,0,6]
// CHECK: Branch,File 0, 44:21 -> 44:22 = (#34 - #35), #35 [6,0,5]
// CHECK: Branch,File 0, 44:26 -> 44:27 = (#32 - #33), #33 [5,0,4]
Expand All @@ -82,26 +82,26 @@ bool func_if_mix(bool a, bool b, bool c, bool d, bool e, bool f) {
return false;
}

// CHECK-LABEL: Decision,File 0, 76:7 -> 76:13 = M:0, C:2
// CHECK-LABEL: Decision,File 0, 76:7 -> 76:13 = M:3, C:2
// CHECK-NEXT: Branch,File 0, 76:7 -> 76:8 = (#0 - #2), #2 [1,0,2]
// CHECK: Branch,File 0, 76:12 -> 76:13 = (#2 - #3), #3 [2,0,0]
// CHECK-LABEL: Decision,File 0, 77:9 -> 77:22 = M:1, C:3
// CHECK-LABEL: Decision,File 0, 77:9 -> 77:22 = M:7, C:3
// CHECK-NEXT: Branch,File 0, 77:9 -> 77:10 = #5, (#1 - #5) [1,2,0]
// CHECK: Branch,File 0, 77:15 -> 77:16 = (#5 - #6), #6 [2,0,3]
// CHECK: Branch,File 0, 77:20 -> 77:21 = (#6 - #7), #7 [3,0,0]
// CHECK-LABEL: Decision,File 0, 78:11 -> 78:31 = M:2, C:4
// CHECK-LABEL: Decision,File 0, 78:11 -> 78:31 = M:14, C:4
// CHECK-NEXT: File 0
// CHECK-NEXT: Branch,File 0, 78:12 -> 78:13 = (#4 - #10), #10 [1,2,3]
// CHECK: Branch,File 0, 78:17 -> 78:18 = (#10 - #11), #11 [3,2,0]
// CHECK: Branch,File 0, 78:24 -> 78:25 = (#9 - #12), #12 [2,0,4]
// CHECK: Branch,File 0, 78:29 -> 78:30 = (#12 - #13), #13 [4,0,0]
// CHECK-LABEL: Decision,File 0, 79:13 -> 79:38 = M:4, C:5
// CHECK-LABEL: Decision,File 0, 79:13 -> 79:38 = M:22, C:5
// CHECK-NEXT: Branch,File 0, 79:13 -> 79:14 = #16, (#8 - #16) [1,3,0]
// CHECK: Branch,File 0, 79:19 -> 79:20 = (#16 - #17), #17 [3,2,4]
// CHECK: Branch,File 0, 79:24 -> 79:25 = (#17 - #18), #18 [4,2,0]
// CHECK: Branch,File 0, 79:31 -> 79:32 = (#15 - #19), #19 [2,0,5]
// CHECK: Branch,File 0, 79:36 -> 79:37 = (#19 - #20), #20 [5,0,0]
// CHECK-LABEL: Decision,File 0, 80:15 -> 80:47 = M:8, C:6
// CHECK-LABEL: Decision,File 0, 80:15 -> 80:47 = M:37, C:6
// CHECK-NEXT: File 0
// CHECK-NEXT: Branch,File 0, 80:16 -> 80:17 = (#14 - #24), #24 [1,3,4]
// CHECK: Branch,File 0, 80:21 -> 80:22 = (#24 - #25), #25 [4,3,0]
Expand Down
12 changes: 6 additions & 6 deletions clang/test/CoverageMapping/mcdc-scratch-space.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

// CHECK: builtin_macro0:
int builtin_macro0(int a) {
// CHECK: Decision,File 0, [[@LINE+1]]:11 -> [[@LINE+2]]:15 = M:0, C:2
// CHECK: Decision,File 0, [[@LINE+1]]:11 -> [[@LINE+2]]:15 = M:3, C:2
return (__LINE__ // CHECK: Branch,File 0, [[@LINE]]:11 -> [[@LINE]]:11 = 0, 0 [1,2,0]
&& a); // CHECK: Branch,File 0, [[@LINE]]:14 -> [[@LINE]]:15 = #2, (#1 - #2) [2,0,0]
}

// CHECK: builtin_macro1:
int builtin_macro1(int a) {
// CHECK: Decision,File 0, [[@LINE+1]]:11 -> [[@LINE+2]]:22 = M:0, C:2
// CHECK: Decision,File 0, [[@LINE+1]]:11 -> [[@LINE+2]]:22 = M:3, C:2
return (a // CHECK: Branch,File 0, [[@LINE]]:11 -> [[@LINE]]:12 = (#0 - #1), #1 [1,0,2]
|| __LINE__); // CHECK: Branch,File 0, [[@LINE]]:14 -> [[@LINE]]:14 = 0, 0 [2,0,0]
}
Expand All @@ -18,7 +18,7 @@ int builtin_macro1(int a) {

// CHECK: pre0:
int pre0(int pre_a, int b_post) {
// CHECK: Decision,File 0, [[@LINE+2]]:11 -> [[@LINE+3]]:20 = M:0, C:2
// CHECK: Decision,File 0, [[@LINE+2]]:11 -> [[@LINE+3]]:20 = M:3, C:2
// CHECK: Expansion,File 0, [[@LINE+1]]:11 -> [[@LINE+1]]:14 = #0 (Expanded file = 1)
return (PRE(a)
&& b_post);
Expand All @@ -30,7 +30,7 @@ int pre0(int pre_a, int b_post) {

// CHECK: pre1:
int pre1(int pre_a, int b_post) {
// CHECK: Decision,File 0, [[@LINE+3]]:11 -> [[@LINE+4]]:20 = M:0, C:2
// CHECK: Decision,File 0, [[@LINE+3]]:11 -> [[@LINE+4]]:20 = M:3, C:2
// CHECK: Expansion,File 0, [[@LINE+2]]:11 -> [[@LINE+2]]:14 = #0 (Expanded file = 1)
// CHECK: Branch,File 0, [[@LINE+2]]:14 -> [[@LINE+2]]:20 = #2, (#1 - #2) [2,0,0]
return (PRE(foo)
Expand All @@ -43,7 +43,7 @@ int pre1(int pre_a, int b_post) {

// CHECK: post0:
int post0(int pre_a, int b_post) {
// CHECK: Decision,File 0, [[@LINE+2]]:11 -> [[@LINE+3]]:18 = M:0, C:2
// CHECK: Decision,File 0, [[@LINE+2]]:11 -> [[@LINE+3]]:18 = M:3, C:2
// CHECK: Branch,File 0, [[@LINE+1]]:11 -> [[@LINE+1]]:16 = (#0 - #1), #1 [1,0,2]
return (pre_a
|| POST(b));
Expand All @@ -55,7 +55,7 @@ int post0(int pre_a, int b_post) {

// CHECK: post1:
int post1(int pre_a, int b_post) {
// CHECK: Decision,File 0, [[@LINE+3]]:11 -> [[@LINE+4]]:18 = M:0, C:2
// CHECK: Decision,File 0, [[@LINE+3]]:11 -> [[@LINE+4]]:18 = M:3, C:2
// CHECK: Branch,File 0, [[@LINE+2]]:11 -> [[@LINE+2]]:16 = (#0 - #1), #1 [1,0,2]
// CHECK: Expansion,File 0, [[@LINE+2]]:14 -> [[@LINE+2]]:18 = 0 (Expanded file = 1)
return (pre_a
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CoverageMapping/mcdc-system-headers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// CHECK: _Z5func0i:
int func0(int a) {
// CHECK: Decision,File 0, [[@LINE+3]]:11 -> [[@LINE+3]]:21 = M:0, C:2
// CHECK: Decision,File 0, [[@LINE+3]]:11 -> [[@LINE+3]]:21 = M:3, C:2
// W_SYS: Expansion,File 0, [[@LINE+2]]:11 -> [[@LINE+2]]:16 = #0 (Expanded file = 1)
// X_SYS: Branch,File 0, [[@LINE+1]]:11 -> [[@LINE+1]]:11 = 0, 0 [1,2,0]
return (CONST && a);
Expand All @@ -25,7 +25,7 @@ int func0(int a) {

// CHECK: _Z5func1ii:
int func1(int a, int b) {
// CHECK: Decision,File 0, [[@LINE+2]]:11 -> [[@LINE+2]]:21 = M:0, C:2
// CHECK: Decision,File 0, [[@LINE+2]]:11 -> [[@LINE+2]]:21 = M:3, C:2
// CHECK: Branch,File 0, [[@LINE+1]]:11 -> [[@LINE+1]]:12 = (#0 - #1), #1 [1,0,2]
return (a || EXPR1(b));
// W_SYS: Expansion,File 0, [[@LINE-1]]:16 -> [[@LINE-1]]:21 = #1 (Expanded file = 1)
Expand All @@ -35,8 +35,8 @@ int func1(int a, int b) {

// CHECK: _Z5func2ii:
int func2(int a, int b) {
// W_SYS: Decision,File 0, [[@LINE+5]]:11 -> [[@LINE+5]]:28 = M:0, C:3
// X_SYS: Decision,File 0, [[@LINE+4]]:11 -> [[@LINE+4]]:28 = M:0, C:2
// W_SYS: Decision,File 0, [[@LINE+5]]:11 -> [[@LINE+5]]:28 = M:4, C:3
// X_SYS: Decision,File 0, [[@LINE+4]]:11 -> [[@LINE+4]]:28 = M:3, C:2
// W_SYS: Expansion,File 0, [[@LINE+3]]:11 -> [[@LINE+3]]:16 = #0 (Expanded file = 1)
// W_SYS: Expansion,File 0, [[@LINE+2]]:23 -> [[@LINE+2]]:28 = #1 (Expanded file = 2)
// X_SYS: Branch,File 0, [[@LINE+1]]:11 -> [[@LINE+1]]:11 = #1, (#0 - #1) [1,2,0]
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Driver/aarch64-mcpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
// CORTEXX3: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-x3"
// RUN: %clang --target=aarch64 -mcpu=cortex-x4 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-X4 %s
// CORTEX-X4: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-x4"
// RUN: %clang --target=aarch64 -mcpu=cortex-x925 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-X925 %s
// CORTEX-X925: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-x925"
// RUN: %clang --target=aarch64 -mcpu=cortex-a78 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEXA78 %s
// CORTEXA78: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a78"
// RUN: %clang --target=aarch64 -mcpu=cortex-a78c -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A78C %s
Expand All @@ -58,6 +60,8 @@
// CORTEX-A720: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a720"
// RUN: %clang --target=aarch64 -mcpu=cortex-a720ae -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A720AE %s
// CORTEX-A720AE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a720ae"
// RUN: %clang --target=aarch64 -mcpu=cortex-a725 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A725 %s
// CORTEX-A725: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a725"
// RUN: %clang --target=aarch64 -mcpu=neoverse-e1 -### -c %s 2>&1 | FileCheck -check-prefix=NEOVERSE-E1 %s
// NEOVERSE-E1: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "neoverse-e1"
// RUN: %clang --target=aarch64 -mcpu=neoverse-v1 -### -c %s 2>&1 | FileCheck -check-prefix=NEOVERSE-V1 %s
Expand Down
27 changes: 26 additions & 1 deletion clang/test/Driver/debug-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,32 @@
// RUN: %clang -### -c -g %s -target x86_64-apple-driverkit19.0 2>&1 \
// RUN: | FileCheck -check-prefix=G_STANDALONE \
// RUN: -check-prefix=G_DWARF4 %s
// RUN: %clang -### -c -fsave-optimization-record %s \
// RUN: %clang -### -c -g %s -target x86_64-apple-macosx15 2>&1 \
// RUN: | FileCheck -check-prefix=G_STANDALONE \
// RUN: -check-prefix=G_DWARF5 %s
// RUN: %clang -### -c -g %s -target arm64-apple-ios17.0 2>&1 \
// RUN: | FileCheck -check-prefix=G_STANDALONE \
// RUN: -check-prefix=G_DWARF4 %s
// RUN: %clang -### -c -g %s -target arm64-apple-ios18.0 2>&1 \
// RUN: | FileCheck -check-prefix=G_STANDALONE \
// RUN: -check-prefix=G_DWARF5 %s
// RUN: %clang -### -c -g %s -target arm64_32-apple-watchos11 2>&1 \
// RUN: | FileCheck -check-prefix=G_STANDALONE \
// RUN: -check-prefix=G_DWARF5 %s
// RUN: %clang -### -c -g %s -target arm64-apple-tvos18.0 2>&1 \
// RUN: | FileCheck -check-prefix=G_STANDALONE \
// RUN: -check-prefix=G_DWARF5 %s
// RUN: %clang -### -c -g %s -target x86_64-apple-driverkit24.0 2>&1 \
// RUN: | FileCheck -check-prefix=G_STANDALONE \
// RUN: -check-prefix=G_DWARF5 %s
// RUN: %clang -### -c -g %s -target arm64-apple-xros1 2>&1 \
// RUN: | FileCheck -check-prefix=G_STANDALONE \
// RUN: -check-prefix=G_DWARF4 %s
// RUN: %clang -### -c -g %s -target arm64-apple-xros2 2>&1 \
// RUN: | FileCheck -check-prefix=G_STANDALONE \
// RUN: -check-prefix=G_DWARF5 %s
//
// RUN: %clang -### -c -fsave-optimization-record %s \
// RUN: -target x86_64-apple-darwin 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
// RUN: %clang -### -c -g -fsave-optimization-record %s \
Expand Down
9 changes: 7 additions & 2 deletions clang/test/Driver/spirv-toolchain.cl
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@

//-----------------------------------------------------------------------------
// Check llvm-spirv-<LLVM_VERSION_MAJOR> is used if it is found in PATH.
//
// This test uses the PATH environment variable; on Windows, we may need to retain
// the original path for the built Clang binary to be able to execute (as it is
// used for locating dependent DLLs). Therefore, skip this test on system-windows.
//
// RUN: mkdir -p %t/versioned
// RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
// RUN: && chmod +x %t/versioned/llvm-spirv-%llvm-version-major
// RUN: env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c %s 2>&1 \
// RUN: | FileCheck -DVERSION=%llvm-version-major --check-prefix=VERSIONED %s
// RUN: %if !system-windows %{ env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c %s 2>&1 \
// RUN: | FileCheck -DVERSION=%llvm-version-major --check-prefix=VERSIONED %s %}

// VERSIONED: {{.*}}llvm-spirv-[[VERSION]]
4 changes: 4 additions & 0 deletions clang/test/Lexer/cxx2c-raw-strings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ int main() {
(void) R"\()\";
// expected-error@-1 {{invalid character '\' in raw string delimiter}}
// expected-error@-2 {{expected expression}}
(void) R"@(foo)@";
// cxx26-warning@-1 {{'@' in a raw string literal delimiter is incompatible with standards before C++2c}}
// precxx26-warning@-2 {{'@' in a raw string literal delimiter is a C++2c extension}}
}
4 changes: 2 additions & 2 deletions clang/test/Misc/target-invalid-cpu-note.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

// RUN: not %clang_cc1 -triple arm64--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix AARCH64
// AARCH64: error: unknown target CPU 'not-a-cpu'
// AARCH64-NEXT: note: valid target CPU values are: cortex-a34, cortex-a35, cortex-a53, cortex-a55, cortex-a510, cortex-a520, cortex-a520ae, cortex-a57, cortex-a65, cortex-a65ae, cortex-a72, cortex-a73, cortex-a75, cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78ae, cortex-a78c, cortex-a710, cortex-a715, cortex-a720, cortex-a720ae, cortex-r82, cortex-r82ae, cortex-x1, cortex-x1c, cortex-x2, cortex-x3, cortex-x4, neoverse-e1, neoverse-n1, neoverse-n2, neoverse-n3, neoverse-512tvb, neoverse-v1, neoverse-v2, neoverse-v3, neoverse-v3ae, cyclone, apple-a7, apple-a8, apple-a9, apple-a10, apple-a11, apple-a12, apple-a13, apple-a14, apple-a15, apple-a16, apple-a17, apple-m1, apple-m2, apple-m3, apple-s4, apple-s5, exynos-m3, exynos-m4, exynos-m5, falkor, saphira, kryo, thunderx2t99, thunderx3t110, thunderx, thunderxt88, thunderxt81, thunderxt83, tsv110, a64fx, carmel, ampere1, ampere1a, ampere1b, oryon-1, cobalt-100, grace{{$}}
// AARCH64-NEXT: note: valid target CPU values are: cortex-a34, cortex-a35, cortex-a53, cortex-a55, cortex-a510, cortex-a520, cortex-a520ae, cortex-a57, cortex-a65, cortex-a65ae, cortex-a72, cortex-a73, cortex-a75, cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78ae, cortex-a78c, cortex-a710, cortex-a715, cortex-a720, cortex-a720ae, cortex-a725, cortex-r82, cortex-r82ae, cortex-x1, cortex-x1c, cortex-x2, cortex-x3, cortex-x4, cortex-x925, neoverse-e1, neoverse-n1, neoverse-n2, neoverse-n3, neoverse-512tvb, neoverse-v1, neoverse-v2, neoverse-v3, neoverse-v3ae, cyclone, apple-a7, apple-a8, apple-a9, apple-a10, apple-a11, apple-a12, apple-a13, apple-a14, apple-a15, apple-a16, apple-a17, apple-m1, apple-m2, apple-m3, apple-s4, apple-s5, exynos-m3, exynos-m4, exynos-m5, falkor, saphira, kryo, thunderx2t99, thunderx3t110, thunderx, thunderxt88, thunderxt81, thunderxt83, tsv110, a64fx, carmel, ampere1, ampere1a, ampere1b, oryon-1, cobalt-100, grace{{$}}

// RUN: not %clang_cc1 -triple arm64--- -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE_AARCH64
// TUNE_AARCH64: error: unknown target CPU 'not-a-cpu'
// TUNE_AARCH64-NEXT: note: valid target CPU values are: cortex-a34, cortex-a35, cortex-a53, cortex-a55, cortex-a510, cortex-a520, cortex-a520ae, cortex-a57, cortex-a65, cortex-a65ae, cortex-a72, cortex-a73, cortex-a75, cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78ae, cortex-a78c, cortex-a710, cortex-a715, cortex-a720, cortex-a720ae, cortex-r82, cortex-r82ae, cortex-x1, cortex-x1c, cortex-x2, cortex-x3, cortex-x4, neoverse-e1, neoverse-n1, neoverse-n2, neoverse-n3, neoverse-512tvb, neoverse-v1, neoverse-v2, neoverse-v3, neoverse-v3ae, cyclone, apple-a7, apple-a8, apple-a9, apple-a10, apple-a11, apple-a12, apple-a13, apple-a14, apple-a15, apple-a16, apple-a17, apple-m1, apple-m2, apple-m3, apple-s4, apple-s5, exynos-m3, exynos-m4, exynos-m5, falkor, saphira, kryo, thunderx2t99, thunderx3t110, thunderx, thunderxt88, thunderxt81, thunderxt83, tsv110, a64fx, carmel, ampere1, ampere1a, ampere1b, oryon-1, cobalt-100, grace{{$}}
// TUNE_AARCH64-NEXT: note: valid target CPU values are: cortex-a34, cortex-a35, cortex-a53, cortex-a55, cortex-a510, cortex-a520, cortex-a520ae, cortex-a57, cortex-a65, cortex-a65ae, cortex-a72, cortex-a73, cortex-a75, cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78ae, cortex-a78c, cortex-a710, cortex-a715, cortex-a720, cortex-a720ae, cortex-a725, cortex-r82, cortex-r82ae, cortex-x1, cortex-x1c, cortex-x2, cortex-x3, cortex-x4, cortex-x925, neoverse-e1, neoverse-n1, neoverse-n2, neoverse-n3, neoverse-512tvb, neoverse-v1, neoverse-v2, neoverse-v3, neoverse-v3ae, cyclone, apple-a7, apple-a8, apple-a9, apple-a10, apple-a11, apple-a12, apple-a13, apple-a14, apple-a15, apple-a16, apple-a17, apple-m1, apple-m2, apple-m3, apple-s4, apple-s5, exynos-m3, exynos-m4, exynos-m5, falkor, saphira, kryo, thunderx2t99, thunderx3t110, thunderx, thunderxt88, thunderxt81, thunderxt83, tsv110, a64fx, carmel, ampere1, ampere1a, ampere1b, oryon-1, cobalt-100, grace{{$}}

// RUN: not %clang_cc1 -triple i386--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix X86
// X86: error: unknown target CPU 'not-a-cpu'
Expand Down
16 changes: 8 additions & 8 deletions clang/test/OpenMP/threadprivate_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2586,7 +2586,7 @@ int foobar() {
// SIMD1-NEXT: [[TMP12:%.*]] = load i32, ptr [[RES]], align 4
// SIMD1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], [[TMP11]]
// SIMD1-NEXT: store i32 [[ADD3]], ptr [[RES]], align 4
// SIMD1-NEXT: [[TMP13:%.*]] = load i32, ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1, i64 1), align 4
// SIMD1-NEXT: [[TMP13:%.*]] = load i32, ptr getelementptr inbounds ([3 x %struct.S1], ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1), i64 0, i64 1), align 4
// SIMD1-NEXT: [[TMP14:%.*]] = load i32, ptr [[RES]], align 4
// SIMD1-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP14]], [[TMP13]]
// SIMD1-NEXT: store i32 [[ADD4]], ptr [[RES]], align 4
Expand Down Expand Up @@ -2663,7 +2663,7 @@ int foobar() {
// SIMD1-NEXT: [[TMP6:%.*]] = load i32, ptr [[RES]], align 4
// SIMD1-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP6]], [[TMP5]]
// SIMD1-NEXT: store i32 [[ADD2]], ptr [[RES]], align 4
// SIMD1-NEXT: [[TMP7:%.*]] = load i32, ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1, i64 1), align 4
// SIMD1-NEXT: [[TMP7:%.*]] = load i32, ptr getelementptr inbounds ([3 x %struct.S1], ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1), i64 0, i64 1), align 4
// SIMD1-NEXT: [[TMP8:%.*]] = load i32, ptr [[RES]], align 4
// SIMD1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP8]], [[TMP7]]
// SIMD1-NEXT: store i32 [[ADD3]], ptr [[RES]], align 4
Expand Down Expand Up @@ -3052,7 +3052,7 @@ int foobar() {
// SIMD2-NEXT: [[TMP12:%.*]] = load i32, ptr [[RES]], align 4, !dbg [[DBG187:![0-9]+]]
// SIMD2-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], [[TMP11]], !dbg [[DBG187]]
// SIMD2-NEXT: store i32 [[ADD3]], ptr [[RES]], align 4, !dbg [[DBG187]]
// SIMD2-NEXT: [[TMP13:%.*]] = load i32, ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1, i64 1), align 4, !dbg [[DBG188:![0-9]+]]
// SIMD2-NEXT: [[TMP13:%.*]] = load i32, ptr getelementptr inbounds ([3 x %struct.S1], ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1), i64 0, i64 1), align 4, !dbg [[DBG188:![0-9]+]]
// SIMD2-NEXT: [[TMP14:%.*]] = load i32, ptr [[RES]], align 4, !dbg [[DBG189:![0-9]+]]
// SIMD2-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP14]], [[TMP13]], !dbg [[DBG189]]
// SIMD2-NEXT: store i32 [[ADD4]], ptr [[RES]], align 4, !dbg [[DBG189]]
Expand Down Expand Up @@ -3133,7 +3133,7 @@ int foobar() {
// SIMD2-NEXT: [[TMP6:%.*]] = load i32, ptr [[RES]], align 4, !dbg [[DBG222:![0-9]+]]
// SIMD2-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP6]], [[TMP5]], !dbg [[DBG222]]
// SIMD2-NEXT: store i32 [[ADD2]], ptr [[RES]], align 4, !dbg [[DBG222]]
// SIMD2-NEXT: [[TMP7:%.*]] = load i32, ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1, i64 1), align 4, !dbg [[DBG223:![0-9]+]]
// SIMD2-NEXT: [[TMP7:%.*]] = load i32, ptr getelementptr inbounds ([3 x %struct.S1], ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1), i64 0, i64 1), align 4, !dbg [[DBG223:![0-9]+]]
// SIMD2-NEXT: [[TMP8:%.*]] = load i32, ptr [[RES]], align 4, !dbg [[DBG224:![0-9]+]]
// SIMD2-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP8]], [[TMP7]], !dbg [[DBG224]]
// SIMD2-NEXT: store i32 [[ADD3]], ptr [[RES]], align 4, !dbg [[DBG224]]
Expand Down Expand Up @@ -5707,7 +5707,7 @@ int foobar() {
// SIMD3-NEXT: [[TMP12:%.*]] = load i32, ptr [[RES]], align 4
// SIMD3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], [[TMP11]]
// SIMD3-NEXT: store i32 [[ADD3]], ptr [[RES]], align 4
// SIMD3-NEXT: [[TMP13:%.*]] = load i32, ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1, i64 1), align 4
// SIMD3-NEXT: [[TMP13:%.*]] = load i32, ptr getelementptr inbounds ([3 x %struct.S1], ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1), i64 0, i64 1), align 4
// SIMD3-NEXT: [[TMP14:%.*]] = load i32, ptr [[RES]], align 4
// SIMD3-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP14]], [[TMP13]]
// SIMD3-NEXT: store i32 [[ADD4]], ptr [[RES]], align 4
Expand Down Expand Up @@ -5784,7 +5784,7 @@ int foobar() {
// SIMD3-NEXT: [[TMP6:%.*]] = load i32, ptr [[RES]], align 4
// SIMD3-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP6]], [[TMP5]]
// SIMD3-NEXT: store i32 [[ADD2]], ptr [[RES]], align 4
// SIMD3-NEXT: [[TMP7:%.*]] = load i32, ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1, i64 1), align 4
// SIMD3-NEXT: [[TMP7:%.*]] = load i32, ptr getelementptr inbounds ([3 x %struct.S1], ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1), i64 0, i64 1), align 4
// SIMD3-NEXT: [[TMP8:%.*]] = load i32, ptr [[RES]], align 4
// SIMD3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP8]], [[TMP7]]
// SIMD3-NEXT: store i32 [[ADD3]], ptr [[RES]], align 4
Expand Down Expand Up @@ -6173,7 +6173,7 @@ int foobar() {
// SIMD4-NEXT: [[TMP12:%.*]] = load i32, ptr [[RES]], align 4, !dbg [[DBG187:![0-9]+]]
// SIMD4-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], [[TMP11]], !dbg [[DBG187]]
// SIMD4-NEXT: store i32 [[ADD3]], ptr [[RES]], align 4, !dbg [[DBG187]]
// SIMD4-NEXT: [[TMP13:%.*]] = load i32, ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1, i64 1), align 4, !dbg [[DBG188:![0-9]+]]
// SIMD4-NEXT: [[TMP13:%.*]] = load i32, ptr getelementptr inbounds ([3 x %struct.S1], ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1), i64 0, i64 1), align 4, !dbg [[DBG188:![0-9]+]]
// SIMD4-NEXT: [[TMP14:%.*]] = load i32, ptr [[RES]], align 4, !dbg [[DBG189:![0-9]+]]
// SIMD4-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP14]], [[TMP13]], !dbg [[DBG189]]
// SIMD4-NEXT: store i32 [[ADD4]], ptr [[RES]], align 4, !dbg [[DBG189]]
Expand Down Expand Up @@ -6254,7 +6254,7 @@ int foobar() {
// SIMD4-NEXT: [[TMP6:%.*]] = load i32, ptr [[RES]], align 4, !dbg [[DBG222:![0-9]+]]
// SIMD4-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP6]], [[TMP5]], !dbg [[DBG222]]
// SIMD4-NEXT: store i32 [[ADD2]], ptr [[RES]], align 4, !dbg [[DBG222]]
// SIMD4-NEXT: [[TMP7:%.*]] = load i32, ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1, i64 1), align 4, !dbg [[DBG223:![0-9]+]]
// SIMD4-NEXT: [[TMP7:%.*]] = load i32, ptr getelementptr inbounds ([3 x %struct.S1], ptr getelementptr inbounds ([2 x [3 x %struct.S1]], ptr @arr_x, i64 0, i64 1), i64 0, i64 1), align 4, !dbg [[DBG223:![0-9]+]]
// SIMD4-NEXT: [[TMP8:%.*]] = load i32, ptr [[RES]], align 4, !dbg [[DBG224:![0-9]+]]
// SIMD4-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP8]], [[TMP7]], !dbg [[DBG224]]
// SIMD4-NEXT: store i32 [[ADD3]], ptr [[RES]], align 4, !dbg [[DBG224]]
Expand Down
38 changes: 20 additions & 18 deletions clang/test/Profile/c-mcdc-class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,24 @@ Value::~Value(void) {
// SHIFT FIRST CONDITION WITH ID = 0.
// MCDCCTOR: %[[LAB1:[0-9]+]] = load i32, ptr %value, align 4
// MCDCCTOR-DAG: %[[BOOL:cmp[0-9]*]] = icmp ne i32 %[[LAB1]], 2
// MCDCCTOR-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDCCTOR-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDCCTOR-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 0
// MCDCCTOR-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDCCTOR-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDCCTOR-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDCCTOR-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDCCTOR-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDCCTOR-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT SECOND CONDITION WITH ID = 1.
// MCDCCTOR: %[[LAB1:[0-9]+]] = load i32, ptr %value2, align 4
// MCDCCTOR-DAG: %[[BOOL:cmp[0-9]*]] = icmp ne i32 %[[LAB1]], 6
// MCDCCTOR-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDCCTOR-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDCCTOR-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 1
// MCDCCTOR-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDCCTOR-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDCCTOR-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 2
// MCDCCTOR-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 1
// MCDCCTOR-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDCCTOR-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// UPDATE FINAL BITMASK WITH RESULT.
// MCDCCTOR-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDCCTOR-DAG: %[[TEMP0:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDCCTOR: %[[TEMP:[0-9]+]] = add i32 %[[TEMP0]], 0
// MCDCCTOR: %[[LAB1:[0-9]+]] = lshr i32 %[[TEMP]], 3
// MCDCCTOR: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr @__profbm__ZN5ValueC2Ev, i32 %[[LAB1]]
// MCDCCTOR: %[[LAB5:[0-9]+]] = and i32 %[[TEMP]], 7
Expand All @@ -73,23 +74,24 @@ Value::~Value(void) {
// SHIFT FIRST CONDITION WITH ID = 0.
// MCDCDTOR: %[[LAB1:[0-9]+]] = load i32, ptr %value, align 4
// MCDCDTOR-DAG: %[[BOOL:cmp[0-9]*]] = icmp ne i32 %[[LAB1]], 2
// MCDCDTOR-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDCDTOR-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDCDTOR-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 0
// MCDCDTOR-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDCDTOR-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDCDTOR-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDCDTOR-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDCDTOR-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDCDTOR-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT SECOND CONDITION WITH ID = 1.
// MCDCDTOR: %[[LAB1:[0-9]+]] = load i32, ptr %value2, align 4
// MCDCDTOR-DAG: %[[BOOL:cmp[0-9]*]] = icmp ne i32 %[[LAB1]], 3
// MCDCDTOR-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDCDTOR-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDCDTOR-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 1
// MCDCDTOR-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDCDTOR-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDCDTOR-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 2
// MCDCDTOR-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 1
// MCDCDTOR-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDCDTOR-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// UPDATE FINAL BITMASK WITH RESULT.
// MCDCDTOR-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDCDTOR-DAG: %[[TEMP0:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDCDTOR: %[[TEMP:[0-9]+]] = add i32 %[[TEMP0]], 0
// MCDCDTOR: %[[LAB1:[0-9]+]] = lshr i32 %[[TEMP]], 3
// MCDCDTOR: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr @__profbm__ZN5ValueD2Ev, i32 %[[LAB1]]
// MCDCDTOR: %[[LAB5:[0-9]+]] = and i32 %[[TEMP]], 7
Expand Down
18 changes: 11 additions & 7 deletions clang/test/Profile/c-mcdc-logicalop-ternary.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int test(int a, int b, int c, int d, int e, int f) {
// NOMCDC-NOT: __profbm_test

// MCDC BOOKKEEPING.
// MCDC: @__profbm_test = private global [3 x i8] zeroinitializer
// MCDC: @__profbm_test = private global [2 x i8] zeroinitializer

// ALLOCATE MCDC TEMP AND ZERO IT.
// MCDC-LABEL: @test(
Expand All @@ -18,7 +18,8 @@ int test(int a, int b, int c, int d, int e, int f) {

// TERNARY TRUE SHOULD UPDATE THE BITMAP WITH RESULT AT ELEMENT 0.
// MCDC-LABEL: cond.true:
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[TEMP0:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC: %[[TEMP:[0-9]+]] = add i32 %[[TEMP0]], 0
// MCDC: %[[LAB1:[0-9]+]] = lshr i32 %[[TEMP]], 3
// MCDC: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr @__profbm_test, i32 %[[LAB1]]
// MCDC: %[[LAB5:[0-9]+]] = and i32 %[[TEMP]], 7
Expand All @@ -34,9 +35,10 @@ int test(int a, int b, int c, int d, int e, int f) {
// TERNARY TRUE YIELDS TERNARY LHS LOGICAL-AND.
// TERNARY LHS LOGICAL-AND SHOULD UPDATE THE BITMAP WITH RESULT AT ELEMENT 1.
// MCDC-LABEL: land.end:
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[TEMP0:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC: %[[TEMP:[0-9]+]] = add i32 %[[TEMP0]], 3
// MCDC: %[[LAB1:[0-9]+]] = lshr i32 %[[TEMP]], 3
// MCDC: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr getelementptr inbounds ([3 x i8], ptr @__profbm_test, i32 0, i32 1), i32 %[[LAB1]]
// MCDC: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr @__profbm_test, i32 %[[LAB1]]
// MCDC: %[[LAB5:[0-9]+]] = and i32 %[[TEMP]], 7
// MCDC: %[[LAB6:[0-9]+]] = trunc i32 %[[LAB5]] to i8
// MCDC: %[[LAB7:[0-9]+]] = shl i8 1, %[[LAB6]]
Expand All @@ -46,7 +48,8 @@ int test(int a, int b, int c, int d, int e, int f) {

// TERNARY FALSE SHOULD UPDATE THE BITMAP WITH RESULT AT ELEMENT 0.
// MCDC-LABEL: cond.false:
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[TEMP0:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC: %[[TEMP:[0-9]+]] = add i32 %[[TEMP0]], 0
// MCDC: %[[LAB1:[0-9]+]] = lshr i32 %[[TEMP]], 3
// MCDC: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr @__profbm_test, i32 %[[LAB1]]
// MCDC: %[[LAB5:[0-9]+]] = and i32 %[[TEMP]], 7
Expand All @@ -62,9 +65,10 @@ int test(int a, int b, int c, int d, int e, int f) {
// TERNARY FALSE YIELDS TERNARY RHS LOGICAL-OR.
// TERNARY RHS LOGICAL-OR SHOULD UPDATE THE BITMAP WITH RESULT AT ELEMENT 2.
// MCDC-LABEL: lor.end:
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[TEMP0:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC: %[[TEMP:[0-9]+]] = add i32 %[[TEMP0]], 6
// MCDC: %[[LAB1:[0-9]+]] = lshr i32 %[[TEMP]], 3
// MCDC: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr getelementptr inbounds ([3 x i8], ptr @__profbm_test, i32 0, i32 2), i32 %[[LAB1]]
// MCDC: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr @__profbm_test, i32 %[[LAB1]]
// MCDC: %[[LAB5:[0-9]+]] = and i32 %[[TEMP]], 7
// MCDC: %[[LAB6:[0-9]+]] = trunc i32 %[[LAB5]] to i8
// MCDC: %[[LAB7:[0-9]+]] = shl i8 1, %[[LAB6]]
Expand Down
35 changes: 18 additions & 17 deletions clang/test/Profile/c-mcdc-nested-ternary.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,43 @@ int test(int b, int c, int d, int e, int f) {
// MCDC-LABEL: cond.true:
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %c.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// TERNARY FALSE SHOULD SHIFT ID = 0 FOR CONDITION 'd'.
// MCDC-LABEL: cond.false:
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %d.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT SECOND CONDITION WITH ID = 2.
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %e.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 2
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 1
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT THIRD CONDITION WITH ID = 1.
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %f.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 1
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 3
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 2
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// UPDATE FINAL BITMASK WITH RESULT.
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[TEMP0:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC: %[[TEMP:[0-9]+]] = add i32 %[[TEMP0]], 0
// MCDC: %[[LAB1:[0-9]+]] = lshr i32 %[[TEMP]], 3
// MCDC: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr @__profbm_test, i32 %[[LAB1]]
// MCDC: %[[LAB5:[0-9]+]] = and i32 %[[TEMP]], 7
Expand Down
53 changes: 27 additions & 26 deletions clang/test/Profile/c-mcdc-not.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int test(int a, int b, int c, int d, int e, int f) {
// NOMCDC-NOT: __profbm_test

// MCDC BOOKKEEPING.
// MCDC: @__profbm_test = private global [8 x i8] zeroinitializer
// MCDC: @__profbm_test = private global [2 x i8] zeroinitializer
// MCDC: @__profc_test = private global [9 x i64] zeroinitializer

// ALLOCATE MCDC TEMP AND ZERO IT.
Expand All @@ -21,61 +21,62 @@ int test(int a, int b, int c, int d, int e, int f) {
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %a.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[LNOT:lnot[0-9]*]] = xor i1 %[[BOOL]]
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[LNOT]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[LNOT]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT SECOND CONDITION WITH ID = 2.
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %b.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 2
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 14
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 1
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT THIRD CONDITION WITH ID = 1.
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %c.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[LNOT:lnot[0-9]*]] = xor i1 %[[BOOL]]
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[LNOT]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 1
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[LNOT]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT FOURTH CONDITION WITH ID = 4.
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %d.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 4
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 12
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 2
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT FIFTH CONDITION WITH ID = 3.
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %e.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 3
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT SIXTH CONDITION WITH ID = 5.
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %f.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[LNOT:lnot[0-9]*]] = xor i1 %[[BOOL]]
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[LNOT]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 5
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 8
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 4
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[LNOT]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// UPDATE FINAL BITMASK WITH RESULT.
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[TEMP0:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC: %[[TEMP:[0-9]+]] = add i32 %[[TEMP0]], 0
// MCDC: %[[LAB1:[0-9]+]] = lshr i32 %[[TEMP]], 3
// MCDC: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr @__profbm_test, i32 %[[LAB1]]
// MCDC: %[[LAB5:[0-9]+]] = and i32 %[[TEMP]], 7
Expand Down
63 changes: 29 additions & 34 deletions clang/test/Profile/c-mcdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,85 +11,80 @@ int test(int a, int b, int c, int d, int e, int f) {
// NOPROFPASS-NOT: __profbm_test

// MCDC BOOKKEEPING.
// MCDC: @__profbm_test = private global [8 x i8] zeroinitializer
// MCDC: @__profbm_test = private global [2 x i8] zeroinitializer
// MCDC: @__profc_test = private global [9 x i64] zeroinitializer

// ALLOCATE MCDC TEMP AND ZERO IT.
// NOPROFPASS-LABEL: @test(
// NOPROFPASS: call void @llvm.instrprof.mcdc.parameters(ptr @__profn_test, i64 [[HASH:[0-9]+]], i32 8)
// NOPROFPASS: call void @llvm.instrprof.mcdc.parameters(ptr @__profn_test, i64 [[HASH:[0-9]+]], i32 15)
// MCDC-LABEL: @test(
// MCDC: %mcdc.addr = alloca i32, align 4
// MCDC: store i32 0, ptr %mcdc.addr, align 4

// SHIFT FIRST CONDITION WITH ID = 0.
// NOPROFPASS: call void @llvm.instrprof.mcdc.condbitmap.update(ptr @__profn_test, i64 [[HASH]], i32 0, ptr %mcdc.addr, i1 %tobool{{[0-9]*}})
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %a.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT SECOND CONDITION WITH ID = 2.
// NOPROFPASS-LABEL: land.lhs.true:
// NOPROFPASS: call void @llvm.instrprof.mcdc.condbitmap.update(ptr @__profn_test, i64 [[HASH]], i32 2, ptr %mcdc.addr, i1 %tobool{{[0-9]*}})
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %b.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 2
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 14
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 1
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT THIRD CONDITION WITH ID = 1.
// NOPROFPASS-LABEL: lor.rhs:
// NOPROFPASS: call void @llvm.instrprof.mcdc.condbitmap.update(ptr @__profn_test, i64 [[HASH]], i32 1, ptr %mcdc.addr, i1 %tobool{{[0-9]*}})
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %c.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 1
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT FOURTH CONDITION WITH ID = 4.
// NOPROFPASS-LABEL: land.lhs.true3:
// NOPROFPASS: call void @llvm.instrprof.mcdc.condbitmap.update(ptr @__profn_test, i64 [[HASH]], i32 4, ptr %mcdc.addr, i1 %tobool{{[0-9]*}})
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %d.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 4
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 12
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 2
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT FIFTH CONDITION WITH ID = 3.
// NOPROFPASS-LABEL: lor.rhs6:
// NOPROFPASS: call void @llvm.instrprof.mcdc.condbitmap.update(ptr @__profn_test, i64 [[HASH]], i32 3, ptr %mcdc.addr, i1 %tobool{{[0-9]*}})
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %e.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 3
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 0
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// SHIFT SIXTH CONDITION WITH ID = 5.
// NOPROFPASS-LABEL: land.rhs:
// NOPROFPASS: call void @llvm.instrprof.mcdc.condbitmap.update(ptr @__profn_test, i64 [[HASH]], i32 5, ptr %mcdc.addr, i1 %tobool{{[0-9]*}})
// MCDC: %[[LAB1:[0-9]+]] = load i32, ptr %f.addr, align 4
// MCDC-DAG: %[[BOOL:tobool[0-9]*]] = icmp ne i32 %[[LAB1]], 0
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = zext i1 %[[BOOL]] to i32
// MCDC-DAG: %[[LAB3:[0-9]+]] = shl i32 %[[LAB2]], 5
// MCDC-DAG: %[[LAB4:[0-9]+]] = or i32 %[[TEMP]], %[[LAB3]]
// MCDC-DAG: %[[TEMP:mcdc.*]] = load i32, ptr %mcdc.addr, align 4
// MCDC-DAG: %[[LAB2:[0-9]+]] = add i32 %[[TEMP]], 8
// MCDC-DAG: %[[LAB3:[0-9]+]] = add i32 %[[TEMP]], 4
// MCDC-DAG: %[[LAB4:[0-9]+]] = select i1 %[[BOOL]], i32 %[[LAB2]], i32 %[[LAB3]]
// MCDC-DAG: store i32 %[[LAB4]], ptr %mcdc.addr, align 4

// UPDATE FINAL BITMASK WITH RESULT.
// NOPROFPASS-LABEL: lor.end:
// NOPROFPASS: call void @llvm.instrprof.mcdc.tvbitmap.update(ptr @__profn_test, i64 [[HASH]], i32 8, i32 0, ptr %mcdc.addr)
// MCDC-DAG: %[[TEMP:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// NOPROFPASS: call void @llvm.instrprof.mcdc.tvbitmap.update(ptr @__profn_test, i64 [[HASH]], i32 0, i32 0, ptr %mcdc.addr)
// MCDC-DAG: %[[TEMP0:mcdc.temp[0-9]*]] = load i32, ptr %mcdc.addr, align 4
// MCDC: %[[TEMP:[0-9]+]] = add i32 %[[TEMP0]], 0
// MCDC: %[[LAB1:[0-9]+]] = lshr i32 %[[TEMP]], 3
// MCDC: %[[LAB4:[0-9]+]] = getelementptr inbounds i8, ptr @__profbm_test, i32 %[[LAB1]]
// MCDC: %[[LAB5:[0-9]+]] = and i32 %[[TEMP]], 7
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Sema/aarch64-neon-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ void undefined(uint32x2_t v2i32, uint32x4_t v4i32, uint16x8_t v8i16, uint8x16_t
vrnd_f16(v4f16); // expected-error {{always_inline function 'vrnd_f16' requires target feature 'fullfp16'}}
vmaxnm_f16(v4f16, v4f16); // expected-error {{always_inline function 'vmaxnm_f16' requires target feature 'fullfp16'}}
vrndi_f16(v4f16); // expected-error {{always_inline function 'vrndi_f16' requires target feature 'fullfp16'}}
// fp16fml depends on fp-armv8
vfmlal_low_f16(v2f32, v4f16, v4f16); // expected-error {{always_inline function 'vfmlal_low_f16' requires target feature 'fp-armv8'}}
// fp16fml
vfmlal_low_f16(v2f32, v4f16, v4f16); // expected-error {{always_inline function 'vfmlal_low_f16' requires target feature 'fp16fml'}}
// i8mm
vmmlaq_s32(v4i32, v8i16, v8i16); // expected-error {{always_inline function 'vmmlaq_s32' requires target feature 'i8mm'}}
vusdot_laneq_s32(v2i32, v8i8, v8i16, 0); // expected-error {{always_inline function 'vusdot_s32' requires target feature 'i8mm'}}
Expand Down
49 changes: 49 additions & 0 deletions clang/test/Sema/debug-93066.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s

struct S {
void f() {
++this; // expected-error {{expression is not assignable}}
// expected-note@-1 {{add '*' to dereference it}}
}

void g() const {
++this; // expected-error {{expression is not assignable}}
}
};

void f(int* a, int* const b, const int* const c, __UINTPTR_TYPE__ d) {
// expected-note@-1 {{variable 'b' declared const here}}
// expected-note@-2 {{variable 'c' declared const here}}
(int*)d = 4; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
// expected-note@-1 {{add '*' to dereference it}}

++a;
++b; // expected-error {{cannot assign to variable 'b' with const-qualified type 'int *const'}}
// expected-note@-1 {{add '*' to dereference it}}
++c; // expected-error {{cannot assign to variable 'c' with const-qualified type 'const int *const'}}

reinterpret_cast<int*>(42) += 3; // expected-error {{expression is not assignable}}
// expected-note@-1 {{add '*' to dereference it}}

const int x = 42;
(const_cast<int*>(&x)) += 3; // expected-error {{expression is not assignable}}
// expected-note@-1 {{add '*' to dereference it}}
}

template <typename T>
void f(T& t) {
// expected-note@* 2 {{variable 't' declared const here}}
++t;
// expected-error@-1 {{cannot assign to variable 't' with const-qualified type 'int *const &'}}
// expected-error@-2 {{cannot assign to variable 't' with const-qualified type 'const int *const &'}}
// expected-note@-3 {{add '*' to dereference it}}
}

void g() {
int* a;
int* const b = a;
const int* const c = a;
f(a);
f(b); // expected-note {{in instantiation of function template specialization 'f<int *const>' requested here}}
f(c); // expected-note {{in instantiation of function template specialization 'f<const int *const>' requested here}}
}
2 changes: 2 additions & 0 deletions clang/test/Sema/exprs.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ void test4(void) {

void test5(int *X, float *P) {
(float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
// expected-note@-1 {{add '*' to dereference it}}
#define FOO ((float*) X)
FOO = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
// expected-note@-1 {{add '*' to dereference it}}
}

void test6(void) {
Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/va_arg_x86_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

int a(void) {
__builtin_va_arg((char*)0, int); // expected-error {{expression is not assignable}}
// expected-note@-1 {{add '*' to dereference it}}
__builtin_va_arg((void*){0}, int); // expected-error {{first argument to 'va_arg' is of type 'void *'}}
}
68 changes: 2 additions & 66 deletions clang/test/Sema/warn-thread-safety-analysis.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -Wthread-safety-beta %s
// RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -Wthread-safety-beta -fexperimental-late-parse-attributes -DLATE_PARSING %s

#define LOCKABLE __attribute__ ((lockable))
#define SCOPED_LOCKABLE __attribute__ ((scoped_lockable))
#define GUARDED_BY(...) __attribute__ ((guarded_by(__VA_ARGS__)))
#define GUARDED_BY(x) __attribute__ ((guarded_by(x)))
#define GUARDED_VAR __attribute__ ((guarded_var))
#define PT_GUARDED_BY(...) __attribute__ ((pt_guarded_by(__VA_ARGS__)))
#define PT_GUARDED_BY(x) __attribute__ ((pt_guarded_by(x)))
#define PT_GUARDED_VAR __attribute__ ((pt_guarded_var))
#define ACQUIRED_AFTER(...) __attribute__ ((acquired_after(__VA_ARGS__)))
#define ACQUIRED_BEFORE(...) __attribute__ ((acquired_before(__VA_ARGS__)))
Expand All @@ -30,14 +29,6 @@ struct LOCKABLE Mutex {};

struct Foo {
struct Mutex *mu_;
int a_value GUARDED_BY(mu_);

struct Bar {
struct Mutex *other_mu ACQUIRED_AFTER(mu_);
struct Mutex *third_mu ACQUIRED_BEFORE(other_mu);
} bar;

int* a_ptr PT_GUARDED_BY(bar.other_mu);
};

// Declare mutex lock/unlock functions.
Expand Down Expand Up @@ -83,19 +74,6 @@ int get_value(int *p) SHARED_LOCKS_REQUIRED(foo_.mu_){

void unlock_scope(struct Mutex *const *mu) __attribute__((release_capability(**mu)));

// Verify late parsing:
#ifdef LATE_PARSING
struct LateParsing {
int a_value_defined_before GUARDED_BY(a_mutex_defined_late);
int *a_ptr_defined_before PT_GUARDED_BY(a_mutex_defined_late);
struct Mutex *a_mutex_defined_early
ACQUIRED_BEFORE(a_mutex_defined_late);
struct Mutex *a_mutex_defined_late
ACQUIRED_AFTER(a_mutex_defined_very_late);
struct Mutex *a_mutex_defined_very_late;
} late_parsing;
#endif

int main(void) {

Foo_fun1(1); // expected-warning{{calling function 'Foo_fun1' requires holding mutex 'mu2'}} \
Expand Down Expand Up @@ -158,51 +136,9 @@ int main(void) {
// Cleanup happens automatically -> no warning.
}

foo_.a_value = 0; // expected-warning {{writing variable 'a_value' requires holding mutex 'mu_' exclusively}}
*foo_.a_ptr = 1; // expected-warning {{writing the value pointed to by 'a_ptr' requires holding mutex 'bar.other_mu' exclusively}}


mutex_exclusive_lock(foo_.bar.other_mu);
mutex_exclusive_lock(foo_.bar.third_mu); // expected-warning{{mutex 'third_mu' must be acquired before 'other_mu'}}
mutex_exclusive_lock(foo_.mu_); // expected-warning{{mutex 'mu_' must be acquired before 'other_mu'}}
mutex_exclusive_unlock(foo_.mu_);
mutex_exclusive_unlock(foo_.bar.other_mu);
mutex_exclusive_unlock(foo_.bar.third_mu);

#ifdef LATE_PARSING
late_parsing.a_value_defined_before = 1; // expected-warning{{writing variable 'a_value_defined_before' requires holding mutex 'a_mutex_defined_late' exclusively}}
late_parsing.a_ptr_defined_before = 0;
mutex_exclusive_lock(late_parsing.a_mutex_defined_late);
mutex_exclusive_lock(late_parsing.a_mutex_defined_early); // expected-warning{{mutex 'a_mutex_defined_early' must be acquired before 'a_mutex_defined_late'}}
mutex_exclusive_unlock(late_parsing.a_mutex_defined_early);
mutex_exclusive_unlock(late_parsing.a_mutex_defined_late);
mutex_exclusive_lock(late_parsing.a_mutex_defined_late);
mutex_exclusive_lock(late_parsing.a_mutex_defined_very_late); // expected-warning{{mutex 'a_mutex_defined_very_late' must be acquired before 'a_mutex_defined_late'}}
mutex_exclusive_unlock(late_parsing.a_mutex_defined_very_late);
mutex_exclusive_unlock(late_parsing.a_mutex_defined_late);
#endif

return 0;
}

// We had a problem where we'd skip all attributes that follow a late-parsed
// attribute in a single __attribute__.
void run(void) __attribute__((guarded_by(mu1), guarded_by(mu1))); // expected-warning 2{{only applies to non-static data members and global variables}}

int value_with_wrong_number_of_args GUARDED_BY(mu1, mu2); // expected-error{{'guarded_by' attribute takes one argument}}

int *ptr_with_wrong_number_of_args PT_GUARDED_BY(mu1, mu2); // expected-error{{'pt_guarded_by' attribute takes one argument}}

int value_with_no_open_brace __attribute__((guarded_by)); // expected-error{{'guarded_by' attribute takes one argument}}
int *ptr_with_no_open_brace __attribute__((pt_guarded_by)); // expected-error{{'pt_guarded_by' attribute takes one argument}}

int value_with_no_open_brace_on_acquire_after __attribute__((acquired_after)); // expected-error{{'acquired_after' attribute takes at least 1 argument}}
int value_with_no_open_brace_on_acquire_before __attribute__((acquired_before)); // expected-error{{'acquired_before' attribute takes at least 1 argument}}

int value_with_bad_expr GUARDED_BY(bad_expr); // expected-error{{use of undeclared identifier 'bad_expr'}}
int *ptr_with_bad_expr PT_GUARDED_BY(bad_expr); // expected-error{{use of undeclared identifier 'bad_expr'}}

int value_with_bad_expr_on_acquire_after __attribute__((acquired_after(other_bad_expr))); // expected-error{{use of undeclared identifier 'other_bad_expr'}}
int value_with_bad_expr_on_acquire_before __attribute__((acquired_before(other_bad_expr))); // expected-error{{use of undeclared identifier 'other_bad_expr'}}

int a_final_expression = 0;
1 change: 1 addition & 0 deletions clang/test/SemaCXX/cxx0x-initializer-references.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s -fexperimental-new-constant-interpreter

struct one { char c; };
struct two { char c[2]; };
Expand Down
6 changes: 5 additions & 1 deletion clang/test/SemaCXX/warn-thread-safety-parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,11 @@ class Foo {
mutable Mutex mu;
int a GUARDED_BY(mu);

static int si GUARDED_BY(mu); // expected-error {{invalid use of non-static data member 'mu'}}
static int si GUARDED_BY(mu);
//FIXME: Bug 32066 - Error should be emitted irrespective of C++ dialect
#if __cplusplus <= 199711L
// expected-error@-3 {{invalid use of non-static data member 'mu'}}
#endif

static void foo() EXCLUSIVE_LOCKS_REQUIRED(mu);
//FIXME: Bug 32066 - Error should be emitted irrespective of C++ dialect
Expand Down
13 changes: 13 additions & 0 deletions clang/test/SemaObjCXX/sel-address.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,20 @@ void h() {
SEL s = @selector(dealloc);
SEL* ps = &s;

/*
FIXME: https://github.com/llvm/llvm-project/pull/94159
TLDR; This is about inserting '*' to deref.
This would assign the value of s to the SEL object pointed to by
@selector(dealloc). However, in Objective-C, selectors are not pointers,
they are special compile-time constructs representing method names, and
they are immutable, so you cannot assign values to them.
Therefore, this syntax is not valid for selectors in Objective-C.
*/
@selector(dealloc) = s; // expected-error {{expression is not assignable}}
// expected-note@-1 {{add '*' to dereference it}}

SEL* ps2 = &@selector(dealloc);

Expand Down
143 changes: 141 additions & 2 deletions clang/test/SemaTemplate/deduction-guide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ using AFoo = Foo<G<U>>;
// CHECK-NEXT: | | `-IntegerLiteral {{.*}}
// CHECK-NEXT: | `-TypeTraitExpr {{.*}} 'bool' __is_deducible
// CHECK-NEXT: | |-DeducedTemplateSpecializationType {{.*}} 'AFoo' dependent
// CHECK-NEXT: | | `-name: 'AFoo'
// CHECK-NEXT: | | `-name: 'AFoo'
// CHECK-NEXT: | | `-TypeAliasTemplateDecl {{.+}} AFoo
// CHECK-NEXT: | `-TemplateSpecializationType {{.*}} 'Foo<G<type-parameter-0-0>>' dependent
// CHECK: |-CXXDeductionGuideDecl {{.*}} implicit <deduction guide for AFoo> 'auto (G<type-parameter-0-0>) -> Foo<G<type-parameter-0-0>>'
Expand Down Expand Up @@ -330,8 +330,147 @@ namespace TTP {
// CHECK-NEXT: | `-CXXRecord {{.+}} 'B'{{$}}
// CHECK-NEXT: `-ElaboratedType {{.+}} 'template-parameter-0-1<T>' sugar dependent{{$}}
// CHECK-NEXT: `-TemplateSpecializationType {{.+}} 'template-parameter-0-1<T>' dependent{{$}}
// CHECK-NEXT: |-name: 'template-parameter-0-1' qualified
// CHECK-NEXT: |-name: 'template-parameter-0-1' qualified
// CHECK-NEXT: | `-TemplateTemplateParmDecl {{.+}} depth 0 index 1
// CHECK-NEXT: `-TemplateArgument type 'T':'type-parameter-0-0'{{$}}
// CHECK-NEXT: `-TemplateTypeParmType {{.+}} 'T' dependent depth 0 index 0{{$}}
// CHECK-NEXT: `-TemplateTypeParm {{.+}} 'T'{{$}}

namespace GH64625 {

template <class T> struct X {
T t[2];
};

X x = {{1, 2}};

// CHECK-LABEL: Dumping GH64625::<deduction guide for X>:
// CHECK-NEXT: FunctionTemplateDecl {{.+}} <{{.+}}:[[#@LINE - 7]]:1, col:27> col:27 implicit <deduction guide for X>
// CHECK-NEXT: |-TemplateTypeParmDecl {{.+}} <col:11, col:17> col:17 referenced class depth 0 index 0 T
// CHECK: |-CXXDeductionGuideDecl {{.+}} <col:27> col:27 implicit <deduction guide for X> 'auto (T (&&)[2]) -> X<T>' aggregate
// CHECK-NEXT: | `-ParmVarDecl {{.+}} <col:27> col:27 'T (&&)[2]'
// CHECK-NEXT: `-CXXDeductionGuideDecl {{.+}} <col:27> col:27 implicit used <deduction guide for X> 'auto (int (&&)[2]) -> GH64625::X<int>' implicit_instantiation aggregate
// CHECK-NEXT: |-TemplateArgument type 'int'
// CHECK-NEXT: | `-BuiltinType {{.+}} 'int'
// CHECK-NEXT: `-ParmVarDecl {{.+}} <col:27> col:27 'int (&&)[2]'
// CHECK-NEXT: FunctionProtoType {{.+}} 'auto (T (&&)[2]) -> X<T>' dependent trailing_return
// CHECK-NEXT: |-InjectedClassNameType {{.+}} 'X<T>' dependent
// CHECK-NEXT: | `-CXXRecord {{.+}} 'X'
// CHECK-NEXT: `-RValueReferenceType {{.+}} 'T (&&)[2]' dependent
// CHECK-NEXT: `-ConstantArrayType {{.+}} 'T[2]' dependent 2
// CHECK-NEXT: `-TemplateTypeParmType {{.+}} 'T' dependent depth 0 index 0
// CHECK-NEXT: `-TemplateTypeParm {{.+}} 'T'

template <class T, class U> struct TwoArrays {
T t[2];
U u[3];
};

TwoArrays ta = {{1, 2}, {3, 4, 5}};
// CHECK-LABEL: Dumping GH64625::<deduction guide for TwoArrays>:
// CHECK-NEXT: FunctionTemplateDecl {{.+}} <{{.+}}:[[#@LINE - 7]]:1, col:36> col:36 implicit <deduction guide for TwoArrays>
// CHECK-NEXT: |-TemplateTypeParmDecl {{.+}} <col:11, col:17> col:17 referenced class depth 0 index 0 T
// CHECK-NEXT: |-TemplateTypeParmDecl {{.+}} <col:20, col:26> col:26 referenced class depth 0 index 1 U
// CHECK: |-CXXDeductionGuideDecl {{.+}} <col:36> col:36 implicit <deduction guide for TwoArrays> 'auto (T (&&)[2], U (&&)[3]) -> TwoArrays<T, U>' aggregate
// CHECK-NEXT: | |-ParmVarDecl {{.+}} <col:36> col:36 'T (&&)[2]'
// CHECK-NEXT: | `-ParmVarDecl {{.+}} <col:36> col:36 'U (&&)[3]'
// CHECK-NEXT: `-CXXDeductionGuideDecl {{.+}} <col:36> col:36 implicit used <deduction guide for TwoArrays> 'auto (int (&&)[2], int (&&)[3]) -> GH64625::TwoArrays<int, int>' implicit_instantiation aggregate
// CHECK-NEXT: |-TemplateArgument type 'int'
// CHECK-NEXT: | `-BuiltinType {{.+}} 'int'
// CHECK-NEXT: |-TemplateArgument type 'int'
// CHECK-NEXT: | `-BuiltinType {{.+}} 'int'
// CHECK-NEXT: |-ParmVarDecl {{.+}} <col:36> col:36 'int (&&)[2]'
// CHECK-NEXT: `-ParmVarDecl {{.+}} <col:36> col:36 'int (&&)[3]'
// CHECK-NEXT: FunctionProtoType {{.+}} 'auto (T (&&)[2], U (&&)[3]) -> TwoArrays<T, U>' dependent trailing_return
// CHECK-NEXT: |-InjectedClassNameType {{.+}} 'TwoArrays<T, U>' dependent
// CHECK-NEXT: | `-CXXRecord {{.+}} 'TwoArrays'
// CHECK-NEXT: |-RValueReferenceType {{.+}} 'T (&&)[2]' dependent
// CHECK-NEXT: | `-ConstantArrayType {{.+}} 'T[2]' dependent 2
// CHECK-NEXT: | `-TemplateTypeParmType {{.+}} 'T' dependent depth 0 index 0
// CHECK-NEXT: | `-TemplateTypeParm {{.+}} 'T'
// CHECK-NEXT: `-RValueReferenceType {{.+}} 'U (&&)[3]' dependent
// CHECK-NEXT: `-ConstantArrayType {{.+}} 'U[3]' dependent 3
// CHECK-NEXT: `-TemplateTypeParmType {{.+}} 'U' dependent depth 0 index 1
// CHECK-NEXT: `-TemplateTypeParm {{.+}} 'U'

TwoArrays tb = {1, 2, {3, 4, 5}};
// CHECK: |-CXXDeductionGuideDecl {{.+}} <col:36> col:36 implicit <deduction guide for TwoArrays> 'auto (T, T, U (&&)[3]) -> TwoArrays<T, U>' aggregate
// CHECK-NEXT: | |-ParmVarDecl {{.+}} <col:36> col:36 'T'
// CHECK-NEXT: | |-ParmVarDecl {{.+}} <col:36> col:36 'T'
// CHECK-NEXT: | `-ParmVarDecl {{.+}} <col:36> col:36 'U (&&)[3]'
// CHECK-NEXT: `-CXXDeductionGuideDecl {{.+}} <col:36> col:36 implicit used <deduction guide for TwoArrays> 'auto (int, int, int (&&)[3]) -> GH64625::TwoArrays<int, int>' implicit_instantiation aggregate
// CHECK-NEXT: |-TemplateArgument type 'int'
// CHECK-NEXT: | `-BuiltinType {{.+}} 'int'
// CHECK-NEXT: |-TemplateArgument type 'int'
// CHECK-NEXT: | `-BuiltinType {{.+}} 'int'
// CHECK-NEXT: |-ParmVarDecl {{.+}} <col:36> col:36 'int'
// CHECK-NEXT: |-ParmVarDecl {{.+}} <col:36> col:36 'int'
// CHECK-NEXT: `-ParmVarDecl {{.+}} <col:36> col:36 'int (&&)[3]'
// CHECK-NEXT: FunctionProtoType {{.+}} 'auto (T, T, U (&&)[3]) -> TwoArrays<T, U>' dependent trailing_return
// CHECK-NEXT: |-InjectedClassNameType {{.+}} 'TwoArrays<T, U>' dependent
// CHECK-NEXT: | `-CXXRecord {{.+}} 'TwoArrays'
// CHECK-NEXT: |-TemplateTypeParmType {{.+}} 'T' dependent depth 0 index 0
// CHECK-NEXT: | `-TemplateTypeParm {{.+}} 'T'
// CHECK-NEXT: |-TemplateTypeParmType {{.+}} 'T' dependent depth 0 index 0
// CHECK-NEXT: | `-TemplateTypeParm {{.+}} 'T'
// CHECK-NEXT: `-RValueReferenceType {{.+}} 'U (&&)[3]' dependent
// CHECK-NEXT: `-ConstantArrayType {{.+}} 'U[3]' dependent 3
// CHECK-NEXT: `-TemplateTypeParmType {{.+}} 'U' dependent depth 0 index 1
// CHECK-NEXT: `-TemplateTypeParm {{.+}} 'U'

TwoArrays tc = {{1, 2}, 3, 4, 5};
// CHECK: |-CXXDeductionGuideDecl {{.+}} <col:36> col:36 implicit <deduction guide for TwoArrays> 'auto (T (&&)[2], U, U, U) -> TwoArrays<T, U>' aggregate
// CHECK-NEXT: | |-ParmVarDecl {{.+}} <col:36> col:36 'T (&&)[2]'
// CHECK-NEXT: | |-ParmVarDecl {{.+}} <col:36> col:36 'U'
// CHECK-NEXT: | |-ParmVarDecl {{.+}} <col:36> col:36 'U'
// CHECK-NEXT: | `-ParmVarDecl {{.+}} <col:36> col:36 'U'
// CHECK-NEXT: `-CXXDeductionGuideDecl {{.+}} <col:36> col:36 implicit used <deduction guide for TwoArrays> 'auto (int (&&)[2], int, int, int) -> GH64625::TwoArrays<int, int>' implicit_instantiation aggregate
// CHECK-NEXT: |-TemplateArgument type 'int'
// CHECK-NEXT: | `-BuiltinType {{.+}} 'int'
// CHECK-NEXT: |-TemplateArgument type 'int'
// CHECK-NEXT: | `-BuiltinType {{.+}} 'int'
// CHECK-NEXT: |-ParmVarDecl {{.+}} <col:36> col:36 'int (&&)[2]'
// CHECK-NEXT: |-ParmVarDecl {{.+}} <col:36> col:36 'int'
// CHECK-NEXT: |-ParmVarDecl {{.+}} <col:36> col:36 'int'
// CHECK-NEXT: `-ParmVarDecl {{.+}} <col:36> col:36 'int'
// CHECK-NEXT: FunctionProtoType {{.+}} 'auto (T (&&)[2], U, U, U) -> TwoArrays<T, U>' dependent trailing_return
// CHECK-NEXT: |-InjectedClassNameType {{.+}} 'TwoArrays<T, U>' dependent
// CHECK-NEXT: | `-CXXRecord {{.+}} 'TwoArrays'
// CHECK-NEXT: |-RValueReferenceType {{.+}} 'T (&&)[2]' dependent
// CHECK-NEXT: | `-ConstantArrayType {{.+}} 'T[2]' dependent 2
// CHECK-NEXT: | `-TemplateTypeParmType {{.+}} 'T' dependent depth 0 index 0
// CHECK-NEXT: | `-TemplateTypeParm {{.+}} 'T'
// CHECK-NEXT: |-TemplateTypeParmType {{.+}} 'U' dependent depth 0 index 1
// CHECK-NEXT: | `-TemplateTypeParm {{.+}} 'U'
// CHECK-NEXT: |-TemplateTypeParmType {{.+}} 'U' dependent depth 0 index 1
// CHECK-NEXT: | `-TemplateTypeParm {{.+}} 'U'
// CHECK-NEXT: `-TemplateTypeParmType {{.+}} 'U' dependent depth 0 index 1
// CHECK-NEXT: `-TemplateTypeParm {{.+}} 'U'

} // namespace GH64625

namespace GH83368 {

template <int N> struct A {
int f1[N];
};

A a{.f1 = {1}};

// CHECK-LABEL: Dumping GH83368::<deduction guide for A>:
// CHECK-NEXT: FunctionTemplateDecl 0x{{.+}} <{{.+}}:[[#@LINE - 7]]:1, col:25> col:25 implicit <deduction guide for A>
// CHECK-NEXT: |-NonTypeTemplateParmDecl {{.+}} <col:11, col:15> col:15 referenced 'int' depth 0 index 0 N
// CHECK: |-CXXDeductionGuideDecl {{.+}} <col:25> col:25 implicit <deduction guide for A> 'auto (int (&&)[N]) -> A<N>' aggregate
// CHECK-NEXT: | `-ParmVarDecl {{.+}} <col:25> col:25 'int (&&)[N]'
// CHECK-NEXT: `-CXXDeductionGuideDecl {{.+}} <col:25> col:25 implicit used <deduction guide for A> 'auto (int (&&)[1]) -> GH83368::A<1>' implicit_instantiation aggregate
// CHECK-NEXT: |-TemplateArgument integral '1'
// CHECK-NEXT: `-ParmVarDecl {{.+}} <col:25> col:25 'int (&&)[1]'
// CHECK-NEXT: FunctionProtoType {{.+}} 'auto (int (&&)[N]) -> A<N>' dependent trailing_return
// CHECK-NEXT: |-InjectedClassNameType {{.+}} 'A<N>' dependent
// CHECK-NEXT: | `-CXXRecord {{.+}} 'A'
// CHECK-NEXT: `-RValueReferenceType {{.+}} 'int (&&)[N]' dependent
// CHECK-NEXT: `-DependentSizedArrayType {{.+}} 'int[N]' dependent
// CHECK-NEXT: |-BuiltinType {{.+}} 'int'
// CHECK-NEXT: `-DeclRefExpr {{.+}} <col:10> 'int' NonTypeTemplateParm {{.+}} 'N' 'int'

} // namespace GH83368
Loading