Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -44,7 +43,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -40,7 +39,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -40,7 +39,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -44,7 +43,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -44,7 +43,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -44,7 +43,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -40,7 +39,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -40,7 +39,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -44,7 +43,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -44,7 +43,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPE Enable Statistical Profiling extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -40,7 +39,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
// CHECK-NEXT: FEAT_SPECRES Enable v8.5a execution and data prediction invalidation instructions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -44,7 +43,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// CHECK-NEXT: FEAT_LRCPC2 Enable v8.4-A RCPC instructions with Immediate Offsets
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand All @@ -40,7 +39,6 @@
// CHECK-NEXT: FEAT_PMUv3 Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension
// CHECK-NEXT: FEAT_RAS, FEAT_RASv1p1 Enable ARMv8 Reliability, Availability and Serviceability Extensions
// CHECK-NEXT: FEAT_RDM Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions
// CHECK-NEXT: FEAT_RME Enable Realm Management Extension
// CHECK-NEXT: FEAT_RNG Enable Random Number generation instructions
// CHECK-NEXT: FEAT_SB Enable v8.5 Speculation Barrier
// CHECK-NEXT: FEAT_SEL2 Enable v8.4-A Secure Exception Level 2 extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
// CHECK-NEXT: FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA Enable Armv8.7-A LD64B/ST64B Accelerator Extension
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
// CHECK-NEXT: FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA Enable Armv8.7-A LD64B/ST64B Accelerator Extension
// CHECK-NEXT: FEAT_LSE Enable ARMv8.1 Large System Extension (LSE) atomic instructions
// CHECK-NEXT: FEAT_LSE2 Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules
// CHECK-NEXT: FEAT_MEC Enable Memory Encryption Contexts Extension
// CHECK-NEXT: FEAT_MPAM Enable v8.4-A Memory system Partitioning and Monitoring extension
// CHECK-NEXT: FEAT_MTE, FEAT_MTE2 Enable Memory Tagging Extension
// CHECK-NEXT: FEAT_NV, FEAT_NV2 Enable v8.4-A Nested Virtualization Enchancement
Expand Down
1 change: 1 addition & 0 deletions clang/test/Driver/print-supported-extensions-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
// CHECK-NEXT: xtheadsync 1.0 'xtheadsync' (T-Head multicore synchronization instructions)
// CHECK-NEXT: xtheadvdot 1.0 'xtheadvdot' (T-Head Vector Extensions for Dot)
// CHECK-NEXT: xventanacondops 1.0 'XVentanaCondOps' (Ventana Conditional Ops)
// CHECK-NEXT: xwchc 2.2 'Xwchc' (WCH/QingKe additional compressed opcodes)
// CHECK-EMPTY:
// CHECK-NEXT: Experimental extensions
// CHECK-NEXT: zicfilp 0.4 'Zicfilp' (Landing pad)
Expand Down
27 changes: 26 additions & 1 deletion clang/test/Driver/sanitizer-ld.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@
// RUN: -static-libsan \
// RUN: | FileCheck --check-prefix=CHECK-ASAN-ANDROID-STATICLIBASAN %s
//
// RUN: %clang -### %s 2>&1 \
// RUN: --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=address \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: -static-libasan \
// RUN: | FileCheck --check-prefix=CHECK-ASAN-ANDROID-STATICLIBASAN %s
//
// CHECK-ASAN-ANDROID-STATICLIBASAN: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
// CHECK-ASAN-ANDROID-STATICLIBASAN: libclang_rt.asan.a"
// CHECK-ASAN-ANDROID-STATICLIBASAN-NOT: "-lpthread"
Expand Down Expand Up @@ -639,6 +646,24 @@
// CHECK-NSAN-LINUX: libclang_rt.nsan.a"
// CHECK-NSAN-LINUX: "-lpthread" "-lrt" "-lm" "-ldl" "-lresolv"

// RUN: %clang -### %s 2>&1 --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=numerical -shared-libsan \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-NSAN-SHARED-LINUX %s

// CHECK-NSAN-SHARED-LINUX: libclang_rt.nsan.so"
// CHECK-NSAN-SHARED-LINUX-NOT: "-lpthread"
// CHECK-NSAN-SHARED-LINUX-NOT: "-ldl"
// CHECK-NSAN-SHARED-LINUX-NOT: "--dynamic-list

// RUN: %clang -### %s 2>&1 --target=x86_64-unknown-linux -fsanitize=numerical,undefined \
// RUN: -resource-dir=%S/Inputs/resource_dir \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-NSAN-UBSAN %s

// CHECK-NSAN-UBSAN: "--whole-archive" "{{[^"]*}}libclang_rt.nsan.a" "--no-whole-archive"
// CHECK-NSAN-UBSAN-NOT: libclang_rt.ubsan

// CFI by itself does not link runtime libraries.
// RUN: not %clang -fsanitize=cfi -### %s 2>&1 \
// RUN: --target=x86_64-unknown-linux -fuse-ld=ld -rtlib=platform \
Expand Down Expand Up @@ -728,8 +753,8 @@
// CHECK-SAFESTACK-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-SAFESTACK-LINUX-NOT: "-lc"
// CHECK-SAFESTACK-LINUX-NOT: whole-archive
// CHECK-SAFESTACK-LINUX: libclang_rt.safestack.a"
// CHECK-SAFESTACK-LINUX: "-u" "__safestack_init"
// CHECK-SAFESTACK-LINUX: libclang_rt.safestack.a"
// CHECK-SAFESTACK-LINUX: "-lpthread"
// CHECK-SAFESTACK-LINUX: "-ldl"
// CHECK-SAFESTACK-LINUX: "-lresolv"
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Frontend/module-file-info-not-a-module.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// RUN: not %clang_cc1 -module-file-info %s 2>&1 | FileCheck %s

// CHECK: fatal error: file '{{.*}}module-file-info-not-a-module.c' is not a module file
304 changes: 304 additions & 0 deletions clang/test/InstallAPI/reexport-with-linker-symbols.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,304 @@
; RUN: rm -rf %t
; RUN: split-file %s %t

; RUN: yaml2obj %t/umbrella.yaml -o %t/System/Library/Frameworks/Umbrella.framework/Umbrella

; RUN: clang-installapi -target arm64-apple-macosx14 -install_name \
; RUN: /System/Library/Frameworks/Umbrella.framework/Versions/A/Umbrella \
; RUN: --verify-against=%t/System/Library/Frameworks/Umbrella.framework/Umbrella \
; RUN: -L%t/usr/lib -F%t/System/Library/Frameworks \
; RUN: %t/System/Library/Frameworks/Umbrella.framework --verify-mode=Pedantic -reexport-lBar \
; RUN: -o %t/Umbrella.tbd 2>&1 | FileCheck -allow-empty %s
; RUN: llvm-readtapi -compare %t/Umbrella.tbd %t/expected.tbd 2>&1 | FileCheck -allow-empty %s

; CHECK-NOT: error
; CHECK-NOT: warning

;--- System/Library/Frameworks/Umbrella.framework/Headers/Umbrella.h
extern const char ld_previous __asm("$ld$previous$/usr/lib/libLdPreviousBindPrevious.1.dylib$$1$11.0$16.0$_function$");
extern void function();

;--- umbrella.yaml
--- !mach-o
FileHeader:
magic: 0xFEEDFACF
cputype: 0x100000C
cpusubtype: 0x0
filetype: 0x6
ncmds: 16
sizeofcmds: 856
flags: 0x85
reserved: 0x0
LoadCommands:
- cmd: LC_SEGMENT_64
cmdsize: 312
segname: __TEXT
vmaddr: 0
vmsize: 16384
fileoff: 0
filesize: 16384
maxprot: 5
initprot: 5
nsects: 3
flags: 0
Sections:
- sectname: __text
segname: __TEXT
addr: 0x3FB0
size: 4
offset: 0x3FB0
align: 2
reloff: 0x0
nreloc: 0
flags: 0x80000400
reserved1: 0x0
reserved2: 0x0
reserved3: 0x0
content: C0035FD6
- sectname: __const
segname: __TEXT
addr: 0x3FB4
size: 1
offset: 0x3FB4
align: 0
reloff: 0x0
nreloc: 0
flags: 0x0
reserved1: 0x0
reserved2: 0x0
reserved3: 0x0
content: '00'
- sectname: __unwind_info
segname: __TEXT
addr: 0x3FB8
size: 72
offset: 0x3FB8
align: 2
reloff: 0x0
nreloc: 0
flags: 0x0
reserved1: 0x0
reserved2: 0x0
reserved3: 0x0
content: 010000001C000000000000001C000000000000001C00000002000000B03F00003400000034000000B53F00000000000034000000030000000C000100100001000000000000000002
- cmd: LC_SEGMENT_64
cmdsize: 72
segname: __LINKEDIT
vmaddr: 16384
vmsize: 16384
fileoff: 16384
filesize: 584
maxprot: 1
initprot: 1
nsects: 0
flags: 0
- cmd: LC_ID_DYLIB
cmdsize: 96
dylib:
name: 24
timestamp: 1
current_version: 0
compatibility_version: 0
Content: '/System/Library/Frameworks/Umbrella.framework/Versions/A/Umbrella'
ZeroPadBytes: 7
- cmd: LC_DYLD_CHAINED_FIXUPS
cmdsize: 16
dataoff: 16384
datasize: 48
- cmd: LC_DYLD_EXPORTS_TRIE
cmdsize: 16
dataoff: 16432
datasize: 104
- cmd: LC_SYMTAB
cmdsize: 24
symoff: 16560
nsyms: 2
stroff: 16592
strsize: 96
- cmd: LC_DYSYMTAB
cmdsize: 80
ilocalsym: 0
nlocalsym: 0
iextdefsym: 0
nextdefsym: 2
iundefsym: 2
nundefsym: 0
tocoff: 0
ntoc: 0
modtaboff: 0
nmodtab: 0
extrefsymoff: 0
nextrefsyms: 0
indirectsymoff: 0
nindirectsyms: 0
extreloff: 0
nextrel: 0
locreloff: 0
nlocrel: 0
- cmd: LC_UUID
cmdsize: 24
uuid: CCD7F304-D97B-3521-A980-CC936CCD34E8
- cmd: LC_BUILD_VERSION
cmdsize: 32
platform: 1
minos: 917504
sdk: 983040
ntools: 1
Tools:
- tool: 3
version: 62525440
- cmd: LC_SOURCE_VERSION
cmdsize: 16
version: 0
- cmd: LC_SEGMENT_SPLIT_INFO
cmdsize: 16
dataoff: 16536
datasize: 16
- cmd: LC_REEXPORT_DYLIB
cmdsize: 48
dylib:
name: 24
timestamp: 2
current_version: 65536
compatibility_version: 65536
Content: '/usr/lib/libBar.dylib'
ZeroPadBytes: 3
- cmd: LC_LOAD_DYLIB
cmdsize: 56
dylib:
name: 24
timestamp: 2
current_version: 88539136
compatibility_version: 65536
Content: '/usr/lib/libSystem.B.dylib'
ZeroPadBytes: 6
- cmd: LC_FUNCTION_STARTS
cmdsize: 16
dataoff: 16552
datasize: 8
- cmd: LC_DATA_IN_CODE
cmdsize: 16
dataoff: 16560
datasize: 0
- cmd: LC_CODE_SIGNATURE
cmdsize: 16
dataoff: 16688
datasize: 280
LinkEditData:
ExportTrie:
TerminalSize: 0
NodeOffset: 0
Name: ''
Flags: 0x0
Address: 0x0
Other: 0x0
ImportName: ''
Children:
- TerminalSize: 3
NodeOffset: 94
Name: '$ld$previous$/usr/lib/libLdPreviousBindPrevious.1.dylib$$1$11.0$16.0$_function$'
Flags: 0x0
Address: 0x3FB4
Other: 0x0
ImportName: ''
- TerminalSize: 3
NodeOffset: 99
Name: _function
Flags: 0x0
Address: 0x3FB0
Other: 0x0
ImportName: ''
NameList:
- n_strx: 2
n_type: 0xF
n_sect: 2
n_desc: 0
n_value: 16308
- n_strx: 82
n_type: 0xF
n_sect: 1
n_desc: 0
n_value: 16304
StringTable:
- ' '
- '$ld$previous$/usr/lib/libLdPreviousBindPrevious.1.dylib$$1$11.0$16.0$_function$'
- _function
- ''
- ''
- ''
- ''
FunctionStarts: [ 0x3FB0 ]
ChainedFixups: [ 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x2C, 0x0,
0x0, 0x0, 0x2C, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ]
...

;--- /usr/lib/libBar.dylib
{
"main_library": {
"exported_symbols": [
{
"text": {
"global": [
"$ld$previous$/usr/lib/libLdPreviousBindPrevious.1.dylib$$1$11.0$16.0$_function$"
]
}
}
],
"flags": [
{
"attributes": [
"not_app_extension_safe"
]
}
],
"install_names": [
{
"name": "/usr/lib/libBar.dylib"
}
],
"target_info": [
{
"min_deployment": "13",
"target": "arm64-macos"
}
]
},
"tapi_tbd_version": 5
}

;--- expected.tbd
{
"main_library": {
"compatibility_versions": [ { "version": "0" } ],
"current_versions": [ { "version": "0" } ],
"exported_symbols": [
{
"data": {
"global": [
"$ld$previous$/usr/lib/libLdPreviousBindPrevious.1.dylib$$1$11.0$16.0$_function$"
]
},
"text": { "global": [ "_function" ] }
}
],
"flags": [
{ "attributes": [ "not_app_extension_safe" ] }
],
"install_names": [
{ "name": "/System/Library/Frameworks/Umbrella.framework/Versions/A/Umbrella" }
],
"reexported_libraries": [
{ "names": [ "/usr/lib/libBar.dylib" ] }
],
"target_info": [
{
"min_deployment": "14",
"target": "arm64-macos"
}
]
},
"tapi_tbd_version": 5
}
50 changes: 12 additions & 38 deletions clang/test/Sema/arm-interrupt-attr.c
Original file line number Diff line number Diff line change
@@ -1,52 +1,26 @@
// RUN: %clang_cc1 %s -triple arm-apple-darwin -target-feature +vfp2 -verify -fsyntax-only
// RUN: %clang_cc1 %s -triple thumb-apple-darwin -target-feature +vfp3 -verify -fsyntax-only
// RUN: %clang_cc1 %s -triple armeb-none-eabi -target-feature +vfp4 -verify -fsyntax-only
// RUN: %clang_cc1 %s -triple thumbeb-none-eabi -target-feature +neon -verify -fsyntax-only
// RUN: %clang_cc1 %s -triple thumbeb-none-eabi -target-feature +neon -target-feature +soft-float -DSOFT -verify -fsyntax-only
// RUN: %clang_cc1 %s -triple arm-none-eabi -verify -fsyntax-only
// RUN: %clang_cc1 %s -triple arm-none-eabi -target-feature +vfp2 -verify -fsyntax-only

__attribute__((interrupt(IRQ))) void foo(void) {} // expected-error {{'interrupt' attribute requires a string}}
__attribute__((interrupt("irq"))) void foo1(void) {} // expected-warning {{'interrupt' attribute argument not supported: irq}}

#ifdef __ARM_FP
__attribute__((interrupt("IRQ"))) void float_irq(void); // expected-warning {{interrupt service routine with vfp enabled may clobber the interruptee's vfp state}}
#else // !defined(__ARM_FP)
__attribute__((interrupt("irq"))) void foo1(void) {} // expected-warning {{'interrupt' attribute argument not supported: irq}}
__attribute__((interrupt(IRQ))) void foo(void) {} // expected-error {{'interrupt' attribute requires a string}}
__attribute__((interrupt("IRQ", 1))) void foo2(void) {} // expected-error {{'interrupt' attribute takes no more than 1 argument}}

__attribute__((interrupt("IRQ"))) void foo3(void) {}
__attribute__((interrupt("FIQ"))) void foo4(void) {}
__attribute__((interrupt("SWI"))) void foo5(void) {}
__attribute__((interrupt("ABORT"))) void foo6(void) {}
__attribute__((interrupt("UNDEF"))) void foo7(void) {}

__attribute__((interrupt)) void foo8(void) {}
__attribute__((interrupt())) void foo9(void) {}
__attribute__((interrupt(""))) void foo10(void) {}

#ifndef SOFT
// expected-note@+2 {{'callee1' declared here}}
#endif
void callee1(void);
__attribute__((interrupt("IRQ"))) void callee2(void);
void caller1(void) {
callee1();
callee2();
}

#ifndef SOFT
__attribute__((interrupt("IRQ"))) void caller2(void) {
callee1(); // expected-warning {{call to function without interrupt attribute could clobber interruptee's VFP registers}}
callee2();
}

void (*callee3)(void);
__attribute__((interrupt("IRQ"))) void caller3(void) {
callee3(); // expected-warning {{call to function without interrupt attribute could clobber interruptee's VFP registers}}
}
#else
__attribute__((interrupt("IRQ"))) void caller2(void) {
callee1();
callee2();
}
__attribute__((interrupt("IRQ"))) void callee(void) {}

void (*callee3)(void);
__attribute__((interrupt("IRQ"))) void caller3(void) {
callee3();
void caller(void)
{
callee(); // expected-error {{interrupt service routine cannot be called directly}}
}
#endif
#endif // __ARM_FP
4 changes: 2 additions & 2 deletions clang/test/Sema/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ void test17(void) {
#define OPT(...) (__builtin_constant_p(__VA_ARGS__) && strlen(__VA_ARGS__) < 4)
// FIXME: These are incorrectly treated as ICEs because strlen is treated as
// a builtin.
ASSERT(OPT("abc"));
ASSERT(!OPT("abcd"));
ASSERT(OPT("abc")); // expected-warning {{expression is not an integer constant expression; folding it to a constant is a GNU extension}}
ASSERT(!OPT("abcd")); // expected-warning {{expression is not an integer constant expression; folding it to a constant is a GNU extension}}
// In these cases, the strlen is non-constant, but the __builtin_constant_p
// is 0: the array size is not an ICE but is foldable.
ASSERT(!OPT(test17_c));
Expand Down
12 changes: 8 additions & 4 deletions clang/test/Sema/constant-builtins-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,17 +265,21 @@ char clz52[__builtin_clzg((unsigned __int128)0x1) == BITSIZE(__int128) - 1 ? 1 :
char clz53[__builtin_clzg((unsigned __int128)0x1, 42) == BITSIZE(__int128) - 1 ? 1 : -1];
char clz54[__builtin_clzg((unsigned __int128)0xf) == BITSIZE(__int128) - 4 ? 1 : -1];
char clz55[__builtin_clzg((unsigned __int128)0xf, 42) == BITSIZE(__int128) - 4 ? 1 : -1];
char clz56[__builtin_clzg((unsigned __int128)(1 << (BITSIZE(__int128) - 1))) == 0 ? 1 : -1];
char clz57[__builtin_clzg((unsigned __int128)(1 << (BITSIZE(__int128) - 1)), 42) == 0 ? 1 : -1];
char clz56[__builtin_clzg((unsigned __int128)(1 << (BITSIZE(__int128) - 1))) == 0 ? 1 : -1]; // expected-warning {{variable length array folded to constant array as an extension}}
// expected-note@-1 {{shift count 127 >= width of type 'int' (32 bits)}}
char clz57[__builtin_clzg((unsigned __int128)(1 << (BITSIZE(__int128) - 1)), 42) == 0 ? 1 : -1]; // expected-warning {{variable length array folded to constant array as an extension}}
// expected-note@-1 {{shift count 127 >= width of type 'int' (32 bits)}}
#endif
int clz58 = __builtin_clzg((unsigned _BitInt(128))0); // expected-error {{not a compile-time constant}}
char clz59[__builtin_clzg((unsigned _BitInt(128))0, 42) == 42 ? 1 : -1];
char clz60[__builtin_clzg((unsigned _BitInt(128))0x1) == BITSIZE(_BitInt(128)) - 1 ? 1 : -1];
char clz61[__builtin_clzg((unsigned _BitInt(128))0x1, 42) == BITSIZE(_BitInt(128)) - 1 ? 1 : -1];
char clz62[__builtin_clzg((unsigned _BitInt(128))0xf) == BITSIZE(_BitInt(128)) - 4 ? 1 : -1];
char clz63[__builtin_clzg((unsigned _BitInt(128))0xf, 42) == BITSIZE(_BitInt(128)) - 4 ? 1 : -1];
char clz64[__builtin_clzg((unsigned _BitInt(128))(1 << (BITSIZE(_BitInt(128)) - 1))) == 0 ? 1 : -1];
char clz65[__builtin_clzg((unsigned _BitInt(128))(1 << (BITSIZE(_BitInt(128)) - 1)), 42) == 0 ? 1 : -1];
char clz64[__builtin_clzg((unsigned _BitInt(128))(1 << (BITSIZE(_BitInt(128)) - 1))) == 0 ? 1 : -1]; // expected-warning {{variable length array folded to constant array as an extension}}
// expected-note@-1 {{shift count 127 >= width of type 'int' (32 bits)}}
char clz65[__builtin_clzg((unsigned _BitInt(128))(1 << (BITSIZE(_BitInt(128)) - 1)), 42) == 0 ? 1 : -1]; // expected-warning {{variable length array folded to constant array as an extension}}
// expected-note@-1 {{shift count 127 >= width of type 'int' (32 bits)}}

char ctz1[__builtin_ctz(1) == 0 ? 1 : -1];
char ctz2[__builtin_ctz(8) == 3 ? 1 : -1];
Expand Down
2 changes: 2 additions & 0 deletions clang/test/Sema/integer-overflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ void check_integer_overflows_in_function_calls(void) {
}
void check_integer_overflows_in_array_size(void) {
int arr[4608 * 1024 * 1024]; // expected-warning {{overflow in expression; result is 536'870'912 with type 'int'}}
// expected-warning@-1 {{variable length array folded to constant array as an extension}}
// expected-note@-2 {{value 4831838208 is outside the range of representable values of type 'int'}}
}

struct s {
Expand Down
8 changes: 8 additions & 0 deletions clang/test/Sema/shift-count-negative.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// RUN: %clang_cc1 -x c -fsyntax-only -verify=expected,c -pedantic %s
// RUN: %clang_cc1 -x c++ -fsyntax-only -verify=expected,cpp %s

enum shiftof {
X = (1<<-29) // c-warning {{expression is not an integer constant expression; folding it to a constant is a GNU extension}}
// cpp-error@-1 {{expression is not an integral constant expression}}
// expected-note@-2 {{negative shift count -29}}
};
9 changes: 9 additions & 0 deletions clang/test/Sema/shift-count-overflow.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// RUN: %clang_cc1 -fsyntax-only -verify=expected,c -pedantic %s
// RUN: %clang_cc1 -x c++ -std=c++98 -fsyntax-only -verify=expected,cpp %s
// RUN: %clang_cc1 -x c++ -std=c++11 -fsyntax-only -verify=expected,cpp %s

enum shiftof {
X = (1<<32) // c-warning {{expression is not an integer constant expression; folding it to a constant is a GNU extension}}
// cpp-error@-1 {{expression is not an integral constant expression}}
// expected-note@-2 {{shift count 32 >= width of type 'int'}}
};
13 changes: 13 additions & 0 deletions clang/test/Sema/shift-negative-value.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// RUN: %clang_cc1 -x c -fsyntax-only -verify=expected,c -pedantic %s
// RUN: %clang_cc1 -x c++ -fsyntax-only -verify=expected,cpp -Wshift-negative-value %s
// RUN: %clang_cc1 -x c++ -fsyntax-only -verify=expected,cpp -Wall %s
// RUN: %clang_cc1 -x c++ -std=c++98 -fsyntax-only -verify=expected,cpp -Wshift-negative-value %s
// RUN: %clang_cc1 -x c++ -std=c++98 -fsyntax-only -verify=expected,cpp -Wall %s
// RUN: %clang_cc1 -x c++ -std=c++11 -fsyntax-only -verify=expected,cpp -Wshift-negative-value %s
// RUN: %clang_cc1 -x c++ -std=c++11 -fsyntax-only -verify=expected,cpp -Wall %s

enum shiftof {
X = (-1<<29) // c-warning {{expression is not an integer constant expression; folding it to a constant is a GNU extension}}
// cpp-error@-1 {{expression is not an integral constant expression}}
// expected-note@-2 {{left shift of negative value -1}}
};
6 changes: 4 additions & 2 deletions clang/test/Sema/vla-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
// a different codepath when we have already emitted an error.)

int PotentiallyEvaluatedSizeofWarn(int n) {
return (int)sizeof *(0 << 32,(int(*)[n])0); // expected-warning {{left operand of comma operator has no effect}} expected-warning {{shift count >= width of type}}
return (int)sizeof *(0 << 32,(int(*)[n])0); /* expected-warning {{shift count >= width of type}}
expected-warning {{left operand of comma operator has no effect}} */
}

void PotentiallyEvaluatedTypeofWarn(int n) {
__typeof(*(0 << 32,(int(*)[n])0)) x; // expected-warning {{left operand of comma operator has no effect}} expected-warning {{shift count >= width of type}}
__typeof(*(0 << 32,(int(*)[n])0)) x; /* expected-warning {{shift count >= width of type}}
expected-warning {{left operand of comma operator has no effect}} */
(void)x;
}

Expand Down
16 changes: 10 additions & 6 deletions clang/test/SemaCXX/enum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ void PR8089() {
// expressions with UB to be non-constant.
enum { overflow = 123456 * 234567 };
#if __cplusplus >= 201103L
// expected-warning@-2 {{not an integral constant expression}}
// expected-note@-3 {{value 28958703552 is outside the range of representable values}}
#else
// expected-warning@-5 {{overflow in expression; result is -1'106'067'520 with type 'int'}}
// expected-warning@-2 {{expression is not an integral constant expression; folding it to a constant is a GNU extension}}
// expected-note@-3 {{value 28958703552 is outside the range of representable values of type 'int'}}
#else
// expected-error@-5 {{expression is not an integral constant expression}}
// expected-note@-6 {{value 28958703552 is outside the range of representable values of type 'int'}}
// expected-warning@-7 {{overflow in expression; result is -1'106'067'520 with type 'int'}}
#endif

// FIXME: This is not consistent with the above case.
Expand All @@ -112,8 +114,10 @@ enum NoFold : int { overflow2 = 123456 * 234567 };
// expected-error@-2 {{enumerator value is not a constant expression}}
// expected-note@-3 {{value 28958703552 is outside the range of representable values}}
#else
// expected-warning@-5 {{overflow in expression; result is -1'106'067'520 with type 'int'}}
// expected-warning@-6 {{extension}}
// expected-warning@-5 {{enumeration types with a fixed underlying type are a C++11 extension}}
// expected-warning@-6 {{overflow in expression; result is -1'106'067'520 with type 'int'}}
// expected-error@-7 {{expression is not an integral constant expression}}
// expected-note@-8 {{value 28958703552 is outside the range of representable values of type 'int'}}
#endif

// PR28903
Expand Down
33 changes: 33 additions & 0 deletions clang/test/SemaCXX/pr98102.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
// expected-no-diagnostics

template <bool v>
struct BC {
static constexpr bool value = v;
};

template <typename T, typename Arg>
struct Constructible : BC<__is_constructible(T, Arg)> {};

template <typename T>
using Requires = T::value;

template <typename T>
struct optional {
template <typename U, Requires<Constructible<T, U>> = true>
optional(U) {}
};

struct MO {};
struct S : MO {};
struct TB {
TB(optional<S>) {}
};

class TD : TB, MO {
using TB::TB;
};

void foo() {
static_assert(Constructible<TD, TD>::value);
}
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/shift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void test() {
c = 1 << -1; // expected-warning {{shift count is negative}}
c = 1 >> -1; // expected-warning {{shift count is negative}}
c = 1 << (unsigned)-1; // expected-warning {{shift count >= width of type}}
// expected-warning@-1 {{implicit conversion}}
// expected-warning@-1 {{implicit conversion from 'int' to 'char' changes value from -2147483648 to 0}}
c = 1 >> (unsigned)-1; // expected-warning {{shift count >= width of type}}
c = 1 << c;
c <<= 0;
Expand Down
13 changes: 10 additions & 3 deletions clang/tools/driver/cc1_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static int PrintSupportedExtensions(std::string TargetStr) {
DescMap.insert({feature.Key, feature.Desc});

if (MachineTriple.isRISCV())
llvm::riscvExtensionsHelp(DescMap);
llvm::RISCVISAInfo::printSupportedExtensions(DescMap);
else if (MachineTriple.isAArch64())
llvm::AArch64::PrintSupportedExtensions();
else if (MachineTriple.isARM())
Expand Down Expand Up @@ -190,13 +190,20 @@ static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {
for (const llvm::SubtargetFeatureKV &feature : Features)
EnabledFeatureNames.insert(feature.Key);

if (!MachineTriple.isAArch64()) {
if (MachineTriple.isAArch64())
llvm::AArch64::printEnabledExtensions(EnabledFeatureNames);
else if (MachineTriple.isRISCV()) {
llvm::StringMap<llvm::StringRef> DescMap;
for (const llvm::SubtargetFeatureKV &feature : Features)
DescMap.insert({feature.Key, feature.Desc});
llvm::RISCVISAInfo::printEnabledExtensions(MachineTriple.isArch64Bit(),
EnabledFeatureNames, DescMap);
} else {
// The option was already checked in Driver::HandleImmediateArgs,
// so we do not expect to get here if we are not a supported architecture.
assert(0 && "Unhandled triple for --print-enabled-extensions option.");
return 1;
}
llvm::AArch64::printEnabledExtensions(EnabledFeatureNames);

return 0;
}
Expand Down
5 changes: 3 additions & 2 deletions compiler-rt/cmake/Modules/AddCompilerRT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ function(add_compiler_rt_runtime name type)
${ARGN})
set(libnames)
# Until we support this some other way, build compiler-rt runtime without LTO
# to allow non-LTO projects to link with it.
if(COMPILER_RT_HAS_FNO_LTO_FLAG)
# to allow non-LTO projects to link with it. GPU targets can currently only be
# distributed as LLVM-IR and ignore this.
if(COMPILER_RT_HAS_FNO_LTO_FLAG AND NOT COMPILER_RT_GPU_BUILD)
set(NO_LTO_FLAGS "-fno-lto")
else()
set(NO_LTO_FLAGS "")
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9} ${HEXAGON}
${LOONGARCH64})
set(ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64} ${MIPS32} ${MIPS64}
${HEXAGON} ${LOONGARCH64})
${HEXAGON} ${LOONGARCH64} ${SPARC} ${SPARCV9})
set(ALL_CFI_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS64}
${HEXAGON} ${LOONGARCH64})
set(ALL_SCUDO_STANDALONE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/cmake/Modules/BuiltinTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ endfunction()
function(builtin_check_c_compiler_flag flag output)
if(NOT DEFINED ${output})
message(STATUS "Performing Test ${output}")
try_compile_only(result FLAGS ${flag})
try_compile_only(result FLAGS ${flag} ${CMAKE_REQUIRED_FLAGS})
set(${output} ${result} CACHE INTERNAL "Compiler supports ${flag}")
if(${result})
message(STATUS "Performing Test ${output} - Success")
Expand Down
27 changes: 26 additions & 1 deletion compiler-rt/cmake/Modules/CompilerRTUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ macro(test_target_arch arch def)
endmacro()

macro(detect_target_arch)
check_symbol_exists(__AMDGPU__ "" __AMDGPU)
check_symbol_exists(__arm__ "" __ARM)
check_symbol_exists(__AVR__ "" __AVR)
check_symbol_exists(__aarch64__ "" __AARCH64)
Expand All @@ -154,6 +155,7 @@ macro(detect_target_arch)
check_symbol_exists(__loongarch__ "" __LOONGARCH)
check_symbol_exists(__mips__ "" __MIPS)
check_symbol_exists(__mips64__ "" __MIPS64)
check_symbol_exists(__NVPTX__ "" __NVPTX)
check_symbol_exists(__powerpc__ "" __PPC)
check_symbol_exists(__powerpc64__ "" __PPC64)
check_symbol_exists(__powerpc64le__ "" __PPC64LE)
Expand All @@ -164,7 +166,9 @@ macro(detect_target_arch)
check_symbol_exists(__wasm32__ "" __WEBASSEMBLY32)
check_symbol_exists(__wasm64__ "" __WEBASSEMBLY64)
check_symbol_exists(__ve__ "" __VE)
if(__ARM)
if(__AMDGPU)
add_default_target_arch(amdgcn)
elseif(__ARM)
add_default_target_arch(arm)
elseif(__AVR)
add_default_target_arch(avr)
Expand Down Expand Up @@ -192,6 +196,8 @@ macro(detect_target_arch)
add_default_target_arch(mips64)
elseif(__MIPS)
add_default_target_arch(mips)
elseif(__NVPTX)
add_default_target_arch(nvptx64)
elseif(__PPC64) # must be checked before __PPC
add_default_target_arch(powerpc64)
elseif(__PPC64LE)
Expand Down Expand Up @@ -397,6 +403,21 @@ macro(construct_compiler_rt_default_triple)
set(COMPILER_RT_DEFAULT_TARGET_ARCH "i386")
endif()

# If we are directly targeting a GPU we need to check that the compiler is
# compatible and pass some default arguments.
if(COMPILER_RT_DEFAULT_TARGET_ONLY)

# Pass the necessary flags to make flag detection work.
if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "amdgcn")
set(COMPILER_RT_GPU_BUILD ON)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nogpulib")
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "nvptx")
set(COMPILER_RT_GPU_BUILD ON)
set(CMAKE_REQUIRED_FLAGS
"${CMAKE_REQUIRED_FLAGS} -flto -c -Wno-unused-command-line-argument")
endif()
endif()

# Determine if test target triple is specified explicitly, and doesn't match the
# default.
if(NOT COMPILER_RT_DEFAULT_TARGET_TRIPLE STREQUAL LLVM_TARGET_TRIPLE)
Expand Down Expand Up @@ -475,6 +496,10 @@ function(get_compiler_rt_target arch variable)
endif()
endif()
set(target "${arch}${triple_suffix}")
elseif("${arch}" MATCHES "^amdgcn")
set(target "amdgcn-amd-amdhsa")
elseif("${arch}" MATCHES "^nvptx")
set(target "nvptx64-nvidia-cuda")
else()
set(target "${arch}${triple_suffix}")
endif()
Expand Down
7 changes: 7 additions & 0 deletions compiler-rt/cmake/base-config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ macro(test_targets)
test_target_arch(x86_64 "" "")
endif()
endif()
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "amdgcn")
test_target_arch(amdgcn "" "--target=amdgcn-amd-amdhsa" "-nogpulib"
"-flto" "-fconvergent-functions"
"-Xclang -mcode-object-version=none")
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "loongarch64")
test_target_arch(loongarch64 "" "")
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc64le|ppc64le")
Expand Down Expand Up @@ -254,6 +258,9 @@ macro(test_targets)
test_target_arch(mips "" "-mips32r2" "-mabi=32" "-D_LARGEFILE_SOURCE=1" "-D_FILE_OFFSET_BITS=64")
test_target_arch(mips64 "" "-mips64r2" "-mabi=64")
endif()
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "nvptx")
test_target_arch(nvptx64 "" "--nvptx64-nvidia-cuda" "-nogpulib" "-flto"
"-fconvergent-functions" "-c")
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "arm")
if(WIN32)
test_target_arch(arm "" "" "")
Expand Down
13 changes: 10 additions & 3 deletions compiler-rt/cmake/builtin-config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ builtin_check_c_compiler_flag(-fno-profile-generate COMPILER_RT_HAS_FNO_PROFILE_
builtin_check_c_compiler_flag(-fno-profile-instr-generate COMPILER_RT_HAS_FNO_PROFILE_INSTR_GENERATE_FLAG)
builtin_check_c_compiler_flag(-fno-profile-instr-use COMPILER_RT_HAS_FNO_PROFILE_INSTR_USE_FLAG)
builtin_check_c_compiler_flag(-Wno-pedantic COMPILER_RT_HAS_WNO_PEDANTIC)
builtin_check_c_compiler_flag(-nogpulib COMPILER_RT_HAS_NOGPULIB_FLAG)
builtin_check_c_compiler_flag(-flto COMPILER_RT_HAS_FLTO_FLAG)
builtin_check_c_compiler_flag(-fconvergent-functions COMPILER_RT_HAS_FCONVERGENT_FUNCTIONS_FLAG)
builtin_check_c_compiler_flag("-Xclang -mcode-object-version=none" COMPILER_RT_HAS_CODE_OBJECT_VERSION_FLAG)
builtin_check_c_compiler_flag(-Wbuiltin-declaration-mismatch COMPILER_RT_HAS_WBUILTIN_DECLARATION_MISMATCH_FLAG)
builtin_check_c_compiler_flag(/Zl COMPILER_RT_HAS_ZL_FLAG)

Expand Down Expand Up @@ -52,6 +56,7 @@ else()
set(OS_NAME "${CMAKE_SYSTEM_NAME}")
endif()

set(AMDGPU amdgcn)
set(ARM64 aarch64)
set(ARM32 arm armhf armv4t armv5te armv6 armv6m armv7m armv7em armv7 armv7s armv7k armv8m.base armv8m.main armv8.1m.main)
set(AVR avr)
Expand All @@ -61,6 +66,7 @@ set(X86_64 x86_64)
set(LOONGARCH64 loongarch64)
set(MIPS32 mips mipsel)
set(MIPS64 mips64 mips64el)
set(NVPTX nvptx64)
set(PPC32 powerpc powerpcspe)
set(PPC64 powerpc64 powerpc64le)
set(RISCV32 riscv32)
Expand All @@ -78,8 +84,8 @@ if(APPLE)
endif()

set(ALL_BUILTIN_SUPPORTED_ARCH
${X86} ${X86_64} ${ARM32} ${ARM64} ${AVR}
${HEXAGON} ${MIPS32} ${MIPS64} ${PPC32} ${PPC64}
${X86} ${X86_64} ${AMDGPU} ${ARM32} ${ARM64} ${AVR}
${HEXAGON} ${MIPS32} ${MIPS64} ${NVPTX} ${PPC32} ${PPC64}
${RISCV32} ${RISCV64} ${SPARC} ${SPARCV9}
${WASM32} ${WASM64} ${VE} ${LOONGARCH64})

Expand Down Expand Up @@ -245,7 +251,8 @@ else()
${ALL_BUILTIN_SUPPORTED_ARCH})
endif()

if (OS_NAME MATCHES "Linux|SerenityOS" AND NOT LLVM_USE_SANITIZER)
if(OS_NAME MATCHES "Linux|SerenityOS" AND NOT LLVM_USE_SANITIZER AND NOT
COMPILER_RT_GPU_BUILD)
set(COMPILER_RT_HAS_CRT TRUE)
else()
set(COMPILER_RT_HAS_CRT FALSE)
Expand Down
18 changes: 18 additions & 0 deletions compiler-rt/cmake/caches/GPU.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file sets up a CMakeCache for GPU builds of compiler-rt. This supports
# amdgcn and nvptx builds targeting the builtins library.

set(COMPILER_RT_INCLUDE_TESTS OFF CACHE BOOL "")
set(COMPILER_RT_HAS_SAFESTACK OFF CACHE BOOL "")

set(COMPILER_RT_BUILD_BUILTINS ON CACHE BOOL "")
set(COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "")
set(COMPILER_RT_BUILD_CRT OFF CACHE BOOL "")
set(COMPILER_RT_BUILD_SANITIZERS OFF CACHE BOOL "")
set(COMPILER_RT_BUILD_XRAY OFF CACHE BOOL "")
set(COMPILER_RT_BUILD_LIBFUZZER OFF CACHE BOOL "")
set(COMPILER_RT_BUILD_PROFILE OFF CACHE BOOL "")
set(COMPILER_RT_BUILD_MEMPROF OFF CACHE BOOL "")
set(COMPILER_RT_BUILD_XRAY_NO_PREINIT OFF CACHE BOOL "")
set(COMPILER_RT_BUILD_ORC OFF CACHE BOOL "")
set(COMPILER_RT_BUILD_GWP_ASAN OFF CACHE BOOL "")
set(COMPILER_RT_BUILD_SCUDO_SANTDALONE_WITH_LLVM_LIBC OFF CACHE BOOL "")
14 changes: 7 additions & 7 deletions compiler-rt/cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,13 @@ else()
set(COMPILER_RT_HAS_ASAN FALSE)
endif()

if (COMPILER_RT_HAS_SANITIZER_COMMON AND HWASAN_SUPPORTED_ARCH AND
OS_NAME MATCHES "Linux|Android|Fuchsia")
set(COMPILER_RT_HAS_HWASAN TRUE)
else()
set(COMPILER_RT_HAS_HWASAN FALSE)
endif()

if (COMPILER_RT_HAS_SANITIZER_COMMON AND RTSAN_SUPPORTED_ARCH AND
OS_NAME MATCHES "Android|Darwin|Linux")
set(COMPILER_RT_HAS_RTSAN TRUE)
Expand Down Expand Up @@ -787,13 +794,6 @@ else()
set(COMPILER_RT_HAS_MSAN FALSE)
endif()

if (COMPILER_RT_HAS_SANITIZER_COMMON AND HWASAN_SUPPORTED_ARCH AND
OS_NAME MATCHES "Linux|Android|Fuchsia")
set(COMPILER_RT_HAS_HWASAN TRUE)
else()
set(COMPILER_RT_HAS_HWASAN FALSE)
endif()

if (COMPILER_RT_HAS_SANITIZER_COMMON AND MEMPROF_SUPPORTED_ARCH AND
OS_NAME MATCHES "Linux")
set(COMPILER_RT_HAS_MEMPROF TRUE)
Expand Down
6 changes: 4 additions & 2 deletions compiler-rt/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ endif()
if(COMPILER_RT_BUILD_SANITIZERS)
if(COMPILER_RT_HAS_SANITIZER_COMMON)
add_subdirectory(stats)
# Contains RTLSanCommon used even without COMPILER_RT_HAS_LSAN.
add_subdirectory(lsan)
# Contains RTUbsan used even without COMPILER_RT_HAS_UBSAN.
add_subdirectory(ubsan)
endif()

Expand All @@ -47,11 +49,11 @@ if(COMPILER_RT_BUILD_SANITIZERS)
endforeach()
endif()

if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
if(COMPILER_RT_BUILD_PROFILE)
compiler_rt_build_runtime(profile)
endif()

if(COMPILER_RT_BUILD_CTX_PROFILE AND COMPILER_RT_HAS_CTX_PROFILE)
if(COMPILER_RT_BUILD_CTX_PROFILE)
compiler_rt_build_runtime(ctx_profile)
endif()

Expand Down
21 changes: 20 additions & 1 deletion compiler-rt/lib/builtins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN
"Skip the atomic builtin (these should normally be provided by a shared library)"
On)

if(NOT FUCHSIA AND NOT COMPILER_RT_BAREMETAL_BUILD)
if(NOT FUCHSIA AND NOT COMPILER_RT_BAREMETAL_BUILD AND NOT COMPILER_RT_GPU_BUILD)
set(GENERIC_SOURCES
${GENERIC_SOURCES}
emutls.c
Expand Down Expand Up @@ -627,6 +627,8 @@ if (MINGW)
)
endif()

set(amdgcn_SOURCES ${GENERIC_SOURCES})

set(armv4t_SOURCES ${arm_min_SOURCES})
set(armv5te_SOURCES ${arm_min_SOURCES})
set(armv6_SOURCES ${arm_min_SOURCES})
Expand Down Expand Up @@ -706,6 +708,8 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES}
set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
${mips_SOURCES})

set(nvptx64_SOURCES ${GENERIC_SOURCES})

set(powerpc_SOURCES ${GENERIC_SOURCES})

set(powerpcspe_SOURCES ${GENERIC_SOURCES})
Expand Down Expand Up @@ -811,6 +815,21 @@ else ()
endif()
endif()

# Directly targeting the GPU requires a few extra flags.
if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "amdgcn|nvptx")
append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding BUILTIN_CFLAGS)
append_list_if(COMPILER_RT_HAS_NOGPULIB_FLAG -nogpulib BUILTIN_CFLAGS)
append_list_if(COMPILER_RT_HAS_FLTO_FLAG -flto BUILTIN_CFLAGS)
append_list_if(COMPILER_RT_HAS_FCONVERGENT_FUNCTIONS_FLAG
-fconvergent-functions BUILTIN_CFLAGS)

# AMDGPU targets want to use a generic ABI.
if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "amdgcn")
append_list_if(COMPILER_RT_HAS_CODE_OBJECT_VERSION_FLAG
"SHELL:-Xclang -mcode-object-version=none" BUILTIN_CFLAGS)
endif()
endif()

set(BUILTIN_DEFS "")

if(COMPILER_RT_BUILTINS_HIDE_SYMBOLS)
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/riscv/restore.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#if __riscv_xlen == 32

#ifndef __riscv_32e
#ifndef __riscv_abi_rve

.globl __riscv_restore_12
.type __riscv_restore_12,@function
Expand Down Expand Up @@ -109,7 +109,7 @@ __riscv_restore_0:

#elif __riscv_xlen == 64

#ifndef __riscv_64e
#ifndef __riscv_abi_rve

.globl __riscv_restore_12
.type __riscv_restore_12,@function
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/builtins/riscv/save.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#if __riscv_xlen == 32

#ifndef __riscv_32e
#ifndef __riscv_abi_rve

.globl __riscv_save_12
.type __riscv_save_12,@function
Expand Down Expand Up @@ -115,7 +115,7 @@ __riscv_save_0:

#elif __riscv_xlen == 64

#ifndef __riscv_64e
#ifndef __riscv_abi_rve

.globl __riscv_save_12
.type __riscv_save_12,@function
Expand Down
76 changes: 37 additions & 39 deletions compiler-rt/lib/gwp_asan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,48 +65,46 @@ set(GWP_ASAN_SEGV_HANDLER_HEADERS
set(GWP_ASAN_OPTIONS_PARSER_CFLAGS
${GWP_ASAN_CFLAGS})

if (COMPILER_RT_HAS_GWP_ASAN)
foreach(arch ${GWP_ASAN_SUPPORTED_ARCH})
add_compiler_rt_runtime(
clang_rt.gwp_asan
STATIC
ARCHS ${arch}
SOURCES ${GWP_ASAN_SOURCES}
ADDITIONAL_HEADERS ${GWP_ASAN_HEADERS}
CFLAGS ${GWP_ASAN_CFLAGS}
PARENT_TARGET gwp_asan
)
endforeach()
foreach(arch ${GWP_ASAN_SUPPORTED_ARCH})
add_compiler_rt_runtime(
clang_rt.gwp_asan
STATIC
ARCHS ${arch}
SOURCES ${GWP_ASAN_SOURCES}
ADDITIONAL_HEADERS ${GWP_ASAN_HEADERS}
CFLAGS ${GWP_ASAN_CFLAGS}
PARENT_TARGET gwp_asan
)
endforeach()

add_compiler_rt_object_libraries(RTGwpAsan
ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
SOURCES ${GWP_ASAN_SOURCES}
ADDITIONAL_HEADERS ${GWP_ASAN_HEADERS}
CFLAGS ${GWP_ASAN_CFLAGS})
add_compiler_rt_object_libraries(RTGwpAsan
ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
SOURCES ${GWP_ASAN_SOURCES}
ADDITIONAL_HEADERS ${GWP_ASAN_HEADERS}
CFLAGS ${GWP_ASAN_CFLAGS})

add_compiler_rt_object_libraries(RTGwpAsanOptionsParser
ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
SOURCES ${GWP_ASAN_OPTIONS_PARSER_SOURCES}
ADDITIONAL_HEADERS ${GWP_ASAN_OPTIONS_PARSER_HEADERS}
CFLAGS ${GWP_ASAN_OPTIONS_PARSER_CFLAGS})
add_compiler_rt_object_libraries(RTGwpAsanOptionsParser
ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
SOURCES ${GWP_ASAN_OPTIONS_PARSER_SOURCES}
ADDITIONAL_HEADERS ${GWP_ASAN_OPTIONS_PARSER_HEADERS}
CFLAGS ${GWP_ASAN_OPTIONS_PARSER_CFLAGS})

# As above, build the pre-implemented optional backtrace support libraries.
add_compiler_rt_object_libraries(RTGwpAsanBacktraceLibc
ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
SOURCES optional/backtrace_linux_libc.cpp
ADDITIONAL_HEADERS ${GWP_ASAN_BACKTRACE_HEADERS}
CFLAGS ${GWP_ASAN_CFLAGS})
add_compiler_rt_object_libraries(RTGwpAsanSegvHandler
ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
SOURCES optional/segv_handler_posix.cpp
ADDITIONAL_HEADERS ${GWP_ASAN_SEGV_HANDLER_HEADERS}
CFLAGS ${GWP_ASAN_CFLAGS})
add_compiler_rt_object_libraries(RTGwpAsanBacktraceSanitizerCommon
ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
SOURCES optional/backtrace_sanitizer_common.cpp
ADDITIONAL_HEADERS ${GWP_ASAN_BACKTRACE_HEADERS}
CFLAGS ${GWP_ASAN_CFLAGS} ${SANITIZER_COMMON_CFLAGS})
endif()
# As above, build the pre-implemented optional backtrace support libraries.
add_compiler_rt_object_libraries(RTGwpAsanBacktraceLibc
ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
SOURCES optional/backtrace_linux_libc.cpp
ADDITIONAL_HEADERS ${GWP_ASAN_BACKTRACE_HEADERS}
CFLAGS ${GWP_ASAN_CFLAGS})
add_compiler_rt_object_libraries(RTGwpAsanSegvHandler
ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
SOURCES optional/segv_handler_posix.cpp
ADDITIONAL_HEADERS ${GWP_ASAN_SEGV_HANDLER_HEADERS}
CFLAGS ${GWP_ASAN_CFLAGS})
add_compiler_rt_object_libraries(RTGwpAsanBacktraceSanitizerCommon
ARCHS ${GWP_ASAN_SUPPORTED_ARCH}
SOURCES optional/backtrace_sanitizer_common.cpp
ADDITIONAL_HEADERS ${GWP_ASAN_BACKTRACE_HEADERS}
CFLAGS ${GWP_ASAN_CFLAGS} ${SANITIZER_COMMON_CFLAGS})

if(COMPILER_RT_INCLUDE_TESTS)
add_subdirectory(tests)
Expand Down
1 change: 1 addition & 0 deletions compiler-rt/lib/lsan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ set(LSAN_HEADERS

set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})

# Used by asan/hwasan even without COMPILER_RT_HAS_LSAN.
add_compiler_rt_object_libraries(RTLSanCommon
OS ${SANITIZER_COMMON_SUPPORTED_OS}
ARCHS ${LSAN_COMMON_SUPPORTED_ARCH}
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/msan/msan_thread.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#include "msan.h"
#include "msan_thread.h"
#include "msan_interface_internal.h"

#include "msan.h"
#include "msan_interface_internal.h"
#include "sanitizer_common/sanitizer_tls_get_addr.h"

namespace __msan {
Expand Down
103 changes: 85 additions & 18 deletions compiler-rt/lib/nsan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(NSAN_SOURCES
nsan.cpp
nsan_flags.cpp
nsan_interceptors.cpp
nsan_malloc_linux.cpp
nsan_stats.cpp
nsan_suppressions.cpp
)
Expand All @@ -24,31 +25,97 @@ append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC NSAN_CFLAGS)
set(NSAN_DYNAMIC_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS})

set(NSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
set(NSAN_DYNAMIC_CFLAGS ${NSAN_CFLAGS})

if (COMPILER_RT_HAS_NSAN)
foreach(arch ${NSAN_SUPPORTED_ARCH})
add_compiler_rt_runtime(
clang_rt.nsan
STATIC
ARCHS ${arch}
SOURCES ${NSAN_SOURCES}
$<TARGET_OBJECTS:RTInterception.${arch}>
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
$<TARGET_OBJECTS:RTSanitizerCommonCoverage.${arch}>
$<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
$<TARGET_OBJECTS:RTUbsan.${arch}>
ADDITIONAL_HEADERS ${NSAN_HEADERS}
CFLAGS ${NSAN_CFLAGS}
PARENT_TARGET nsan
)
endforeach()
set(NSAN_COMMON_RUNTIME_OBJECT_LIBS
RTInterception
RTSanitizerCommon
RTSanitizerCommonLibc
RTSanitizerCommonCoverage
RTSanitizerCommonSymbolizer
RTSanitizerCommonSymbolizerInternal
RTUbsan)

set(NSAN_DYNAMIC_LIBS
${COMPILER_RT_UNWINDER_LINK_LIBS}
${SANITIZER_CXX_ABI_LIBRARIES}
${SANITIZER_COMMON_LINK_LIBS})

append_list_if(COMPILER_RT_HAS_LIBDL dl NSAN_DYNAMIC_LIBS)
append_list_if(COMPILER_RT_HAS_LIBRT rt NSAN_DYNAMIC_LIBS)
append_list_if(COMPILER_RT_HAS_LIBM m NSAN_DYNAMIC_LIBS)
append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread NSAN_DYNAMIC_LIBS)

# Compile sources into an object library.

add_compiler_rt_object_libraries(RTNsan_dynamic
ARCHS ${NSAN_SUPPORTED_ARCH}
SOURCES ${NSAN_SOURCES}
ADDITIONAL_HEADERS ${NSAN_HEADERS}
CFLAGS ${NSAN_CFLAGS})

if(NOT APPLE)
add_compiler_rt_object_libraries(RTNsan
ARCHS ${NSAN_SUPPORTED_ARCH}
SOURCES ${NSAN_SOURCES}
ADDITIONAL_HEADERS ${NSAN_HEADERS}
CFLAGS ${NSAN_CFLAGS})

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "")
add_compiler_rt_object_libraries(RTNsan_dynamic_version_script_dummy
ARCHS ${NSAN_SUPPORTED_ARCH}
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp
CFLAGS ${NSAN_DYNAMIC_CFLAGS})
endif()

add_compiler_rt_runtime(
clang_rt.nsan
STATIC
ARCHS ${NSAN_SUPPORTED_ARCH}
OBJECT_LIBS RTNsan
${NSAN_COMMON_RUNTIME_OBJECT_LIBS}
CFLAGS ${NSAN_CFLAGS}
PARENT_TARGET nsan)

if(NOT APPLE)
foreach(arch ${NSAN_SUPPORTED_ARCH})
if (COMPILER_RT_HAS_VERSION_SCRIPT)
add_sanitizer_rt_version_list(clang_rt.nsan-dynamic-${arch}
LIBS clang_rt.nsan-${arch}
EXTRA nsan.syms.extra)
set(VERSION_SCRIPT_FLAG
-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/clang_rt.nsan-dynamic-${arch}.vers)
# The Solaris 11.4 linker supports a subset of GNU ld version scripts,
# but requires a special option to enable it.
if (COMPILER_RT_HAS_GNU_VERSION_SCRIPT_COMPAT)
list(APPEND VERSION_SCRIPT_FLAG -Wl,-z,gnu-version-script-compat)
endif()
set_property(SOURCE
${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp
APPEND PROPERTY
OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clang_rt.nsan-dynamic-${arch}.vers)
else()
set(VERSION_SCRIPT_FLAG)
endif()

add_compiler_rt_runtime(
clang_rt.nsan
SHARED
ARCHS ${arch}
OBJECT_LIBS ${NSAN_COMMON_RUNTIME_OBJECT_LIBS}
RTNsan_dynamic
# The only purpose of RTNsan_dynamic_version_script_dummy is to
# carry a dependency of the shared runtime on the version script.
# Replacing it with a straightforward
# add_dependencies(clang_rt.nsan-dynamic-${arch} clang_rt.nsan-dynamic-${arch}-version-list)
# generates an order-only dependency in ninja.
RTNsan_dynamic_version_script_dummy
CFLAGS ${NSAN_DYNAMIC_CFLAGS}
LINK_FLAGS ${NSAN_DYNAMIC_LINK_FLAGS}
${VERSION_SCRIPT_FLAG}
LINK_LIBS ${NSAN_DYNAMIC_LIBS}
PARENT_TARGET nsan)
endforeach()
endif()

if(COMPILER_RT_INCLUDE_TESTS)
Expand Down
1 change: 1 addition & 0 deletions compiler-rt/lib/nsan/nsan.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ extern bool nsan_initialized;
extern bool nsan_init_is_running;

void InitializeInterceptors();
void InitializeMallocInterceptors();

// See notes in nsan_platform.
// printf-free (see comment in nsan_interceptors.cc).
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/nsan/nsan.syms.extra
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nsan_*
__nsan_*
__ubsan_*
115 changes: 2 additions & 113 deletions compiler-rt/lib/nsan/nsan_interceptors.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- nsan_interceptors.cc ----------------------------------------------===//
//===- nsan_interceptors.cpp ----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down Expand Up @@ -29,26 +29,8 @@ using namespace __sanitizer;
using __nsan::nsan_init_is_running;
using __nsan::nsan_initialized;

constexpr uptr kEarlyAllocBufSize = 16384;
static uptr allocated_bytes;
static char early_alloc_buf[kEarlyAllocBufSize];

static bool isInEarlyAllocBuf(const void *ptr) {
return ((uptr)ptr >= (uptr)early_alloc_buf &&
((uptr)ptr - (uptr)early_alloc_buf) < sizeof(early_alloc_buf));
}

template <typename T> T min(T a, T b) { return a < b ? a : b; }

// Handle allocation requests early (before all interceptors are setup). dlsym,
// for example, calls calloc.
static void *HandleEarlyAlloc(uptr size) {
void *Mem = (void *)&early_alloc_buf[allocated_bytes];
allocated_bytes += size;
CHECK_LT(allocated_bytes, kEarlyAllocBufSize);
return Mem;
}

INTERCEPTOR(void *, memset, void *dst, int v, uptr size) {
// NOTE: This guard is needed because nsan's initialization code might call
// memset.
Expand Down Expand Up @@ -105,90 +87,6 @@ INTERCEPTOR(wchar_t *, wmemcpy, wchar_t *dst, const wchar_t *src, uptr size) {
return res;
}

INTERCEPTOR(void *, malloc, uptr size) {
// NOTE: This guard is needed because nsan's initialization code might call
// malloc.
if (nsan_init_is_running && REAL(malloc) == nullptr)
return HandleEarlyAlloc(size);

void *res = REAL(malloc)(size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

INTERCEPTOR(void *, realloc, void *ptr, uptr size) {
void *res = REAL(realloc)(ptr, size);
// FIXME: We might want to copy the types from the original allocation
// (although that would require that we know its size).
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

INTERCEPTOR(void *, calloc, uptr Nmemb, uptr size) {
// NOTE: This guard is needed because nsan's initialization code might call
// calloc.
if (nsan_init_is_running && REAL(calloc) == nullptr) {
// Note: EarlyAllocBuf is initialized with zeros.
return HandleEarlyAlloc(Nmemb * size);
}

void *res = REAL(calloc)(Nmemb, size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), Nmemb * size);
return res;
}

INTERCEPTOR(void, free, void *P) {
// There are only a few early allocation requests, so we simply skip the free.
if (isInEarlyAllocBuf(P))
return;
REAL(free)(P);
}

INTERCEPTOR(void *, valloc, uptr size) {
void *const res = REAL(valloc)(size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

INTERCEPTOR(void *, memalign, uptr align, uptr size) {
void *const res = REAL(memalign)(align, size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

INTERCEPTOR(void *, __libc_memalign, uptr align, uptr size) {
void *const res = REAL(__libc_memalign)(align, size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

INTERCEPTOR(void *, pvalloc, uptr size) {
void *const res = REAL(pvalloc)(size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

INTERCEPTOR(void *, aligned_alloc, uptr align, uptr size) {
void *const res = REAL(aligned_alloc)(align, size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

INTERCEPTOR(int, posix_memalign, void **memptr, uptr align, uptr size) {
int res = REAL(posix_memalign)(memptr, align, size);
if (res == 0 && *memptr)
__nsan_set_value_unknown(static_cast<u8 *>(*memptr), size);
return res;
}

INTERCEPTOR(char *, strfry, char *s) {
const auto Len = internal_strlen(s);
char *res = REAL(strfry)(s);
Expand Down Expand Up @@ -317,16 +215,7 @@ void __nsan::InitializeInterceptors() {
mallopt(-3, 32 * 1024); // M_MMAP_THRESHOLD
#endif

INTERCEPT_FUNCTION(malloc);
INTERCEPT_FUNCTION(calloc);
INTERCEPT_FUNCTION(free);
INTERCEPT_FUNCTION(realloc);
INTERCEPT_FUNCTION(valloc);
INTERCEPT_FUNCTION(memalign);
INTERCEPT_FUNCTION(__libc_memalign);
INTERCEPT_FUNCTION(pvalloc);
INTERCEPT_FUNCTION(aligned_alloc);
INTERCEPT_FUNCTION(posix_memalign);
InitializeMallocInterceptors();

INTERCEPT_FUNCTION(memset);
INTERCEPT_FUNCTION(wmemset);
Expand Down
123 changes: 123 additions & 0 deletions compiler-rt/lib/nsan/nsan_malloc_linux.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
//===- nsan_malloc_linux.cpp ----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Interceptors for memory allocation functions on ELF OSes.
//
//===----------------------------------------------------------------------===//

#include "interception/interception.h"
#include "nsan/nsan.h"
#include "sanitizer_common/sanitizer_allocator_dlsym.h"
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_platform.h"
#include "sanitizer_common/sanitizer_platform_interceptors.h"

#if !SANITIZER_APPLE && !SANITIZER_WINDOWS
using namespace __sanitizer;
using __nsan::nsan_initialized;

namespace {
struct DlsymAlloc : public DlSymAllocator<DlsymAlloc> {
static bool UseImpl() { return !nsan_initialized; }
};
} // namespace

INTERCEPTOR(void *, aligned_alloc, uptr align, uptr size) {
void *res = REAL(aligned_alloc)(align, size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

INTERCEPTOR(void *, calloc, uptr nmemb, uptr size) {
if (DlsymAlloc::Use())
return DlsymAlloc::Callocate(nmemb, size);

void *res = REAL(calloc)(nmemb, size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), nmemb * size);
return res;
}

INTERCEPTOR(void, free, void *ptr) {
if (DlsymAlloc::PointerIsMine(ptr))
return DlsymAlloc::Free(ptr);
REAL(free)(ptr);
}

INTERCEPTOR(void *, malloc, uptr size) {
if (DlsymAlloc::Use())
return DlsymAlloc::Allocate(size);
void *res = REAL(malloc)(size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

INTERCEPTOR(void *, realloc, void *ptr, uptr size) {
if (DlsymAlloc::Use() || DlsymAlloc::PointerIsMine(ptr))
return DlsymAlloc::Realloc(ptr, size);
void *res = REAL(realloc)(ptr, size);
// TODO: We might want to copy the types from the original allocation
// (although that would require that we know its size).
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

#if SANITIZER_INTERCEPT_REALLOCARRAY
INTERCEPTOR(void *, reallocarray, void *ptr, uptr nmemb, uptr size) {
void *res = REAL(reallocarray)(ptr, nmemb, size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), nmemb * size);
return res;
}
#endif // SANITIZER_INTERCEPT_REALLOCARRAY

INTERCEPTOR(int, posix_memalign, void **memptr, uptr align, uptr size) {
int res = REAL(posix_memalign)(memptr, align, size);
if (res == 0 && *memptr)
__nsan_set_value_unknown(static_cast<u8 *>(*memptr), size);
return res;
}

// Deprecated allocation functions (memalign, etc).
#if SANITIZER_INTERCEPT_MEMALIGN
INTERCEPTOR(void *, memalign, uptr align, uptr size) {
void *const res = REAL(memalign)(align, size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}

INTERCEPTOR(void *, __libc_memalign, uptr align, uptr size) {
void *const res = REAL(__libc_memalign)(align, size);
if (res)
__nsan_set_value_unknown(static_cast<u8 *>(res), size);
return res;
}
#endif

void __nsan::InitializeMallocInterceptors() {
INTERCEPT_FUNCTION(aligned_alloc);
INTERCEPT_FUNCTION(calloc);
INTERCEPT_FUNCTION(free);
INTERCEPT_FUNCTION(malloc);
INTERCEPT_FUNCTION(posix_memalign);
INTERCEPT_FUNCTION(realloc);
#if SANITIZER_INTERCEPT_REALLOCARRAY
INTERCEPT_FUNCTION(reallocarray);
#endif

#if SANITIZER_INTERCEPT_MEMALIGN
INTERCEPT_FUNCTION(memalign);
INTERCEPT_FUNCTION(__libc_memalign);
#endif
}

#endif
2 changes: 2 additions & 0 deletions compiler-rt/lib/safestack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ foreach(arch ${SAFESTACK_SUPPORTED_ARCH})
ARCHS ${arch}
SOURCES ${SAFESTACK_SOURCES}
$<TARGET_OBJECTS:RTInterception.${arch}>
OBJECT_LIBS RTSanitizerCommon
RTSanitizerCommonLibc
CFLAGS ${SAFESTACK_CFLAGS}
PARENT_TARGET safestack)
endforeach()
11 changes: 11 additions & 0 deletions compiler-rt/lib/safestack/safestack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,17 @@ INTERCEPTOR(int, pthread_create, pthread_t *thread,
pthread_attr_destroy(&tmpattr);
}

#if SANITIZER_SOLARIS
// Solaris pthread_attr_init initializes stacksize to 0 (the default), so
// hardcode the actual values as documented in pthread_create(3C).
if (size == 0)
# if defined(_LP64)
size = 2 * 1024 * 1024;
# else
size = 1024 * 1024;
# endif
#endif

SFS_CHECK(size);
size = RoundUpTo(size, kStackAlign);

Expand Down
35 changes: 28 additions & 7 deletions compiler-rt/lib/safestack/safestack_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "sanitizer_common/sanitizer_platform.h"

#include <dlfcn.h>
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -68,6 +69,24 @@ static void *GetRealLibcAddress(const char *symbol) {
SFS_CHECK(real_##func);
#endif

#if SANITIZER_SOLARIS
# define _REAL(func) _##func
# define DEFINE__REAL(ret_type, func, ...) \
extern "C" ret_type _REAL(func)(__VA_ARGS__)

# if !defined(_LP64) && _FILE_OFFSET_BITS == 64
# define _REAL64(func) _##func##64
# else
# define _REAL64(func) _REAL(func)
# endif
# define DEFINE__REAL64(ret_type, func, ...) \
extern "C" ret_type _REAL64(func)(__VA_ARGS__)

DEFINE__REAL64(void *, mmap, void *a, size_t b, int c, int d, int e, off_t f);
DEFINE__REAL(int, munmap, void *a, size_t b);
DEFINE__REAL(int, mprotect, void *a, size_t b, int c);
#endif

using ThreadId = uint64_t;

inline ThreadId GetTid() {
Expand All @@ -91,11 +110,10 @@ inline int TgKill(pid_t pid, ThreadId tid, int sig) {
(void)pid;
return _REAL(_lwp_kill, tid, sig);
#elif SANITIZER_SOLARIS
# ifdef SYS_lwp_kill
return syscall(SYS_lwp_kill, tid, sig);
# else
return -1;
# endif
(void)pid;
errno = thr_kill(tid, sig);
// TgKill is expected to return -1 on error, not an errno.
return errno != 0 ? -1 : 0;
#elif SANITIZER_FREEBSD
return syscall(SYS_thr_kill2, pid, tid, sig);
#else
Expand All @@ -110,8 +128,7 @@ inline void *Mmap(void *addr, size_t length, int prot, int flags, int fd,
#elif SANITIZER_FREEBSD && (defined(__aarch64__) || defined(__x86_64__))
return (void *)__syscall(SYS_mmap, addr, length, prot, flags, fd, offset);
#elif SANITIZER_SOLARIS
return (void *)(uintptr_t)syscall(SYS_mmap, addr, length, prot, flags, fd,
offset);
return _REAL64(mmap)(addr, length, prot, flags, fd, offset);
#else
return (void *)syscall(SYS_mmap, addr, length, prot, flags, fd, offset);
#endif
Expand All @@ -121,6 +138,8 @@ inline int Munmap(void *addr, size_t length) {
#if SANITIZER_NETBSD
DEFINE__REAL(int, munmap, void *a, size_t b);
return _REAL(munmap, addr, length);
#elif SANITIZER_SOLARIS
return _REAL(munmap)(addr, length);
#else
return syscall(SYS_munmap, addr, length);
#endif
Expand All @@ -130,6 +149,8 @@ inline int Mprotect(void *addr, size_t length, int prot) {
#if SANITIZER_NETBSD
DEFINE__REAL(int, mprotect, void *a, size_t b, int c);
return _REAL(mprotect, addr, length, prot);
#elif SANITIZER_SOLARIS
return _REAL(mprotect)(addr, length, prot);
#else
return syscall(SYS_mprotect, addr, length, prot);
#endif
Expand Down
11 changes: 11 additions & 0 deletions compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ void SetSigProcMask(__sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset) {
CHECK_EQ(0, internal_sigprocmask(SIG_SETMASK, set, oldset));
}

// Block asynchronous signals
void BlockSignals(__sanitizer_sigset_t *oldset) {
__sanitizer_sigset_t set;
internal_sigfillset(&set);
Expand All @@ -169,7 +170,17 @@ void BlockSignals(__sanitizer_sigset_t *oldset) {
// If this signal is blocked, such calls cannot be handled and the process may
// hang.
internal_sigdelset(&set, 31);

// Don't block synchronous signals
internal_sigdelset(&set, SIGSEGV);
internal_sigdelset(&set, SIGBUS);
internal_sigdelset(&set, SIGILL);
internal_sigdelset(&set, SIGTRAP);
internal_sigdelset(&set, SIGABRT);
internal_sigdelset(&set, SIGFPE);
internal_sigdelset(&set, SIGPIPE);
# endif

SetSigProcMask(&set, oldset);
}

Expand Down
13 changes: 13 additions & 0 deletions compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,19 @@ void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top,
stacksize = kMaxThreadStackSize;
*stack_top = segment.end;
*stack_bottom = segment.end - stacksize;

uptr maxAddr = GetMaxUserVirtualAddress();
// Edge case: the stack mapping on some systems may be off-by-one e.g.,
// fffffffdf000-1000000000000 rw-p 00000000 00:00 0 [stack]
// instead of:
// fffffffdf000- ffffffffffff
// The out-of-range stack_top can result in an invalid shadow address
// calculation, since those usually assume the parameters are in range.
if (*stack_top == maxAddr + 1)
*stack_top = maxAddr;
else
CHECK_LE(*stack_top, maxAddr);

return;
}
uptr stacksize = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ posix_spawn_file_actions_adddup2 U
posix_spawn_file_actions_addopen U
posix_spawn_file_actions_destroy U
posix_spawn_file_actions_init U
printf U
putchar U
qsort U
raise U
rand U
Expand Down
94 changes: 46 additions & 48 deletions compiler-rt/lib/scudo/standalone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,60 +195,58 @@ if(COMPILER_RT_DEFAULT_TARGET_ARCH MATCHES "mips|mips64|mipsel|mips64el")
list(APPEND SCUDO_LINK_LIBS atomic)
endif()

if(COMPILER_RT_HAS_SCUDO_STANDALONE)
add_compiler_rt_object_libraries(RTScudoStandalone
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS})
add_compiler_rt_object_libraries(RTScudoStandaloneCWrappers
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES_C_WRAPPERS}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS})
add_compiler_rt_object_libraries(RTScudoStandaloneCxxWrappers
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES_CXX_WRAPPERS}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS})

add_compiler_rt_object_libraries(RTScudoStandalone
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS})
add_compiler_rt_object_libraries(RTScudoStandaloneCWrappers
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES_C_WRAPPERS}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS})
add_compiler_rt_object_libraries(RTScudoStandaloneCxxWrappers
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES_CXX_WRAPPERS}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS})

add_compiler_rt_runtime(clang_rt.scudo_standalone
STATIC
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES} ${SCUDO_SOURCES_C_WRAPPERS}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS}
OBJECT_LIBS ${SCUDO_OBJECT_LIBS}
PARENT_TARGET scudo_standalone)
add_compiler_rt_runtime(clang_rt.scudo_standalone_cxx
STATIC
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES_CXX_WRAPPERS}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS}
PARENT_TARGET scudo_standalone)

if(COMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED)
add_compiler_rt_runtime(clang_rt.scudo_standalone
STATIC
SHARED
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES} ${SCUDO_SOURCES_C_WRAPPERS}
SOURCES ${SCUDO_SOURCES} ${SCUDO_SOURCES_C_WRAPPERS} ${SCUDO_SOURCES_CXX_WRAPPERS}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS}
OBJECT_LIBS ${SCUDO_OBJECT_LIBS}
LINK_FLAGS ${SCUDO_LINK_FLAGS}
LINK_LIBS ${SCUDO_LINK_LIBS}
PARENT_TARGET scudo_standalone)
add_compiler_rt_runtime(clang_rt.scudo_standalone_cxx
STATIC
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES_CXX_WRAPPERS}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS}
PARENT_TARGET scudo_standalone)

if(COMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED)
add_compiler_rt_runtime(clang_rt.scudo_standalone
SHARED
ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH}
SOURCES ${SCUDO_SOURCES} ${SCUDO_SOURCES_C_WRAPPERS} ${SCUDO_SOURCES_CXX_WRAPPERS}
ADDITIONAL_HEADERS ${SCUDO_HEADERS}
CFLAGS ${SCUDO_CFLAGS}
DEPS ${SCUDO_DEPS}
OBJECT_LIBS ${SCUDO_OBJECT_LIBS}
LINK_FLAGS ${SCUDO_LINK_FLAGS}
LINK_LIBS ${SCUDO_LINK_LIBS}
PARENT_TARGET scudo_standalone)
endif()
endif()

add_subdirectory(benchmarks)
if(COMPILER_RT_INCLUDE_TESTS)
add_subdirectory(tests)
endif()
add_subdirectory(benchmarks)
if(COMPILER_RT_INCLUDE_TESTS)
add_subdirectory(tests)
endif()
38 changes: 18 additions & 20 deletions compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,25 @@ macro(add_scudo_unittest testname)
RTGwpAsan RTGwpAsanBacktraceLibc RTGwpAsanSegvHandler)
endif()

if(COMPILER_RT_HAS_SCUDO_STANDALONE)
foreach(arch ${SCUDO_TEST_ARCH})
# Additional runtime objects get added along RTScudoStandalone
set(SCUDO_TEST_RTOBJECTS $<TARGET_OBJECTS:RTScudoStandalone.${arch}>)
foreach(rtobject ${TEST_ADDITIONAL_RTOBJECTS})
list(APPEND SCUDO_TEST_RTOBJECTS $<TARGET_OBJECTS:${rtobject}.${arch}>)
endforeach()
# Add the static runtime library made of all the runtime objects
set(RUNTIME RT${testname}.${arch})
add_library(${RUNTIME} STATIC ${SCUDO_TEST_RTOBJECTS})
set(ScudoUnitTestsObjects)
generate_compiler_rt_tests(ScudoUnitTestsObjects ScudoUnitTests
"${testname}-${arch}-Test" ${arch}
SOURCES ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
COMPILE_DEPS ${SCUDO_TEST_HEADERS}
DEPS scudo_standalone
RUNTIME ${RUNTIME}
CFLAGS ${SCUDO_UNITTEST_CFLAGS}
LINK_FLAGS ${SCUDO_UNITTEST_LINK_FLAGS})
foreach(arch ${SCUDO_TEST_ARCH})
# Additional runtime objects get added along RTScudoStandalone
set(SCUDO_TEST_RTOBJECTS $<TARGET_OBJECTS:RTScudoStandalone.${arch}>)
foreach(rtobject ${TEST_ADDITIONAL_RTOBJECTS})
list(APPEND SCUDO_TEST_RTOBJECTS $<TARGET_OBJECTS:${rtobject}.${arch}>)
endforeach()
endif()
# Add the static runtime library made of all the runtime objects
set(RUNTIME RT${testname}.${arch})
add_library(${RUNTIME} STATIC ${SCUDO_TEST_RTOBJECTS})
set(ScudoUnitTestsObjects)
generate_compiler_rt_tests(ScudoUnitTestsObjects ScudoUnitTests
"${testname}-${arch}-Test" ${arch}
SOURCES ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
COMPILE_DEPS ${SCUDO_TEST_HEADERS}
DEPS scudo_standalone
RUNTIME ${RUNTIME}
CFLAGS ${SCUDO_UNITTEST_CFLAGS}
LINK_FLAGS ${SCUDO_UNITTEST_LINK_FLAGS})
endforeach()
endmacro()

set(SCUDO_UNIT_TEST_SOURCES
Expand Down
229 changes: 202 additions & 27 deletions compiler-rt/lib/scudo/standalone/tests/timing_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "timing.h"

#include <cstdlib>
#include <string>

class ScudoTimingTest : public Test {
Expand All @@ -33,54 +34,228 @@ class ScudoTimingTest : public Test {

void printAllTimersStats() { Manager.printAll(); }

void getAllTimersStats(scudo::ScopedString &Str) { Manager.getAll(Str); }

scudo::TimingManager &getTimingManager() { return Manager; }

void testCallTimers() {
scudo::ScopedTimer Outer(getTimingManager(), "Level1");
{
scudo::ScopedTimer Inner1(getTimingManager(), Outer, "Level2");
{ scudo::ScopedTimer Inner2(getTimingManager(), Inner1, "Level3"); }
}
}

private:
scudo::TimingManager Manager;
};

// Given that the output of statistics of timers are dumped through
// `scudo::Printf` which is platform dependent, so we don't have a reliable way
// to catch the output and verify the details. Now we only verify the number of
// invocations on linux.
TEST_F(ScudoTimingTest, SimpleTimer) {
#if SCUDO_LINUX
testing::internal::LogToStderr();
testing::internal::CaptureStderr();
#endif

testIgnoredTimer();
testChainedCalls();
printAllTimersStats();
scudo::ScopedString Str;
getAllTimersStats(Str);

#if SCUDO_LINUX
std::string output = testing::internal::GetCapturedStderr();
EXPECT_TRUE(output.find("testIgnoredTimer (1)") == std::string::npos);
EXPECT_TRUE(output.find("testChainedCalls (1)") != std::string::npos);
EXPECT_TRUE(output.find("testFunc2 (1)") != std::string::npos);
EXPECT_TRUE(output.find("testFunc1 (1)") != std::string::npos);
#endif
std::string Output(Str.data());
EXPECT_TRUE(Output.find("testIgnoredTimer (1)") == std::string::npos);
EXPECT_TRUE(Output.find("testChainedCalls (1)") != std::string::npos);
EXPECT_TRUE(Output.find("testFunc2 (1)") != std::string::npos);
EXPECT_TRUE(Output.find("testFunc1 (1)") != std::string::npos);
}

TEST_F(ScudoTimingTest, NestedTimer) {
#if SCUDO_LINUX
testing::internal::LogToStderr();
testing::internal::CaptureStderr();
#endif

{
scudo::ScopedTimer Outer(getTimingManager(), "Outer");
{
scudo::ScopedTimer Inner1(getTimingManager(), Outer, "Inner1");
{ scudo::ScopedTimer Inner2(getTimingManager(), Inner1, "Inner2"); }
}
}
printAllTimersStats();
scudo::ScopedString Str;
getAllTimersStats(Str);

std::string Output(Str.data());
EXPECT_TRUE(Output.find("Outer (1)") != std::string::npos);
EXPECT_TRUE(Output.find("Inner1 (1)") != std::string::npos);
EXPECT_TRUE(Output.find("Inner2 (1)") != std::string::npos);
}

TEST_F(ScudoTimingTest, VerifyChainedTimerCalculations) {
{
scudo::ScopedTimer Outer(getTimingManager(), "Level1");
sleep(1);
{
scudo::ScopedTimer Inner1(getTimingManager(), Outer, "Level2");
sleep(2);
{
scudo::ScopedTimer Inner2(getTimingManager(), Inner1, "Level3");
sleep(3);
}
}
}
scudo::ScopedString Str;
getAllTimersStats(Str);
std::string Output(Str.data());

// Get the individual timer values for the average and maximum, then
// verify that the timer values are being calculated properly.
Output = Output.substr(Output.find('\n') + 1);
char *end;
unsigned long long Level1AvgNs = std::strtoull(Output.c_str(), &end, 10);
ASSERT_TRUE(end != nullptr);
unsigned long long Level1MaxNs = std::strtoull(&end[6], &end, 10);
ASSERT_TRUE(end != nullptr);
EXPECT_EQ(Level1AvgNs, Level1MaxNs);

Output = Output.substr(Output.find('\n') + 1);
unsigned long long Level2AvgNs = std::strtoull(Output.c_str(), &end, 10);
ASSERT_TRUE(end != nullptr);
unsigned long long Level2MaxNs = std::strtoull(&end[6], &end, 10);
ASSERT_TRUE(end != nullptr);
EXPECT_EQ(Level2AvgNs, Level2MaxNs);

Output = Output.substr(Output.find('\n') + 1);
unsigned long long Level3AvgNs = std::strtoull(Output.c_str(), &end, 10);
ASSERT_TRUE(end != nullptr);
unsigned long long Level3MaxNs = std::strtoull(&end[6], &end, 10);
ASSERT_TRUE(end != nullptr);
EXPECT_EQ(Level3AvgNs, Level3MaxNs);

EXPECT_GT(Level1AvgNs, Level2AvgNs);
EXPECT_GT(Level2AvgNs, Level3AvgNs);

// The time for the first timer needs to be at least six seconds.
EXPECT_GT(Level1AvgNs, 6000000000U);
// The time for the second timer needs to be at least five seconds.
EXPECT_GT(Level2AvgNs, 5000000000U);
// The time for the third timer needs to be at least three seconds.
EXPECT_GT(Level3AvgNs, 3000000000U);
// The time between the first and second timer needs to be at least one
// second.
EXPECT_GT(Level1AvgNs - Level2AvgNs, 1000000000U);
// The time between the second and third timer needs to be at least two
// second.
EXPECT_GT(Level2AvgNs - Level3AvgNs, 2000000000U);
}

TEST_F(ScudoTimingTest, VerifyMax) {
for (size_t i = 0; i < 3; i++) {
scudo::ScopedTimer Outer(getTimingManager(), "Level1");
sleep(1);
}
scudo::ScopedString Str;
getAllTimersStats(Str);
std::string Output(Str.data());

Output = Output.substr(Output.find('\n') + 1);
char *end;
unsigned long long AvgNs = std::strtoull(Output.c_str(), &end, 10);
ASSERT_TRUE(end != nullptr);
unsigned long long MaxNs = std::strtoull(&end[6], &end, 10);
ASSERT_TRUE(end != nullptr);

EXPECT_GT(MaxNs, AvgNs);
}

TEST_F(ScudoTimingTest, VerifyMultipleTimerCalls) {
for (size_t i = 0; i < 5; i++)
testCallTimers();

scudo::ScopedString Str;
getAllTimersStats(Str);
std::string Output(Str.data());
EXPECT_TRUE(Output.find("Level1 (5)") != std::string::npos);
EXPECT_TRUE(Output.find("Level2 (5)") != std::string::npos);
EXPECT_TRUE(Output.find("Level3 (5)") != std::string::npos);
}

TEST_F(ScudoTimingTest, VerifyHeader) {
{ scudo::ScopedTimer Outer(getTimingManager(), "Timer"); }
scudo::ScopedString Str;
getAllTimersStats(Str);

std::string Output(Str.data());
std::string Header(Output.substr(0, Output.find('\n')));
EXPECT_EQ(Header, "-- Average Operation Time -- -- Maximum Operation Time -- "
"-- Name (# of Calls) --");
}

TEST_F(ScudoTimingTest, VerifyTimerFormat) {
testCallTimers();
scudo::ScopedString Str;
getAllTimersStats(Str);
std::string Output(Str.data());

// Check the top level line, should look similar to:
// 11718.0(ns) 11718(ns) Level1 (1)
Output = Output.substr(Output.find('\n') + 1);

// Verify that the Average Operation Time is in the correct location.
EXPECT_EQ(".0(ns) ", Output.substr(14, 7));

// Verify that the Maximum Operation Time is in the correct location.
EXPECT_EQ("(ns) ", Output.substr(45, 5));

// Verify that the first timer name is in the correct location.
EXPECT_EQ("Level1 (1)\n", Output.substr(61, 11));

// Check a chained timer, should look similar to:
// 5331.0(ns) 5331(ns) Level2 (1)
Output = Output.substr(Output.find('\n') + 1);

// Verify that the Average Operation Time is in the correct location.
EXPECT_EQ(".0(ns) ", Output.substr(14, 7));

// Verify that the Maximum Operation Time is in the correct location.
EXPECT_EQ("(ns) ", Output.substr(45, 5));

// Verify that the first timer name is in the correct location.
EXPECT_EQ(" Level2 (1)\n", Output.substr(61, 13));

// Check a secondary chained timer, should look similar to:
// 814.0(ns) 814(ns) Level3 (1)
Output = Output.substr(Output.find('\n') + 1);

// Verify that the Average Operation Time is in the correct location.
EXPECT_EQ(".0(ns) ", Output.substr(14, 7));

// Verify that the Maximum Operation Time is in the correct location.
EXPECT_EQ("(ns) ", Output.substr(45, 5));

// Verify that the first timer name is in the correct location.
EXPECT_EQ(" Level3 (1)\n", Output.substr(61, 15));
}

#if SCUDO_LINUX
std::string output = testing::internal::GetCapturedStderr();
EXPECT_TRUE(output.find("Outer (1)") != std::string::npos);
EXPECT_TRUE(output.find("Inner1 (1)") != std::string::npos);
EXPECT_TRUE(output.find("Inner2 (1)") != std::string::npos);
TEST_F(ScudoTimingTest, VerifyPrintMatchesGet) {
testing::internal::LogToStderr();
testing::internal::CaptureStderr();
testCallTimers();

{ scudo::ScopedTimer Outer(getTimingManager(), "Timer"); }
printAllTimersStats();
std::string PrintOutput = testing::internal::GetCapturedStderr();
EXPECT_TRUE(PrintOutput.size() != 0);

scudo::ScopedString Str;
getAllTimersStats(Str);
std::string GetOutput(Str.data());
EXPECT_TRUE(GetOutput.size() != 0);

EXPECT_EQ(PrintOutput, GetOutput);
}
#endif

#if SCUDO_LINUX
TEST_F(ScudoTimingTest, VerifyReporting) {
testing::internal::LogToStderr();
testing::internal::CaptureStderr();
// Every 100 calls generates a report, but run a few extra to verify the
// report happened at call 100.
for (size_t i = 0; i < 110; i++)
scudo::ScopedTimer Outer(getTimingManager(), "VerifyReportTimer");

std::string Output = testing::internal::GetCapturedStderr();
EXPECT_TRUE(Output.find("VerifyReportTimer (100)") != std::string::npos);
}
#endif
Loading