See r367803 and similar other changes.
llvm-svn: 367887
# The following is a workaround for powerpc64le. This is the only architecture
# that requires -fno-function-sections to work properly. If lacking, the ASan
-# Linux test function-sections-are-bad.cc fails with the following error:
+# Linux test function-sections-are-bad.cpp fails with the following error:
# 'undefined symbol: __sanitizer_unaligned_load32'.
if(DEFINED TARGET_powerpc64le_CFLAGS)
append_list_if(COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG -fno-function-sections TARGET_powerpc64le_CFLAGS)
#endif
#if 0 // This test requires online symbolizer.
-// Moved to lit_tests/stack-oob-frames.cc.
+// Moved to lit_tests/stack-oob-frames.cpp.
// Reenable here once we have online symbolizer by default.
NOINLINE static void Frame0(int frame, char *a, char *b, char *c) {
char d[4] = {0};
${ASAN_RTL}/*.h &
run_lint ${ASAN_TEST_LINT_FILTER} ${ASAN_RTL}/tests/*.cpp \
${ASAN_RTL}/tests/*.h &
-run_lint ${ASAN_LIT_TEST_LINT_FILTER} ${LIT_TESTS}/asan/*/*.cc &
+run_lint ${ASAN_LIT_TEST_LINT_FILTER} ${LIT_TESTS}/asan/*/*.cpp &
# TSan
TSAN_RTL=${COMPILER_RT}/lib/tsan
FILES=${COMMON_RTL}/*.inc
TMPFILES=""
for FILE in $FILES; do
- TMPFILE="$(${MKTEMP}).$(basename ${FILE}).cc"
+ TMPFILE="$(${MKTEMP}).$(basename ${FILE}).cpp"
cp -f $FILE $TMPFILE
run_lint ${COMMON_RTL_INC_LINT_FILTER} $TMPFILE &
TMPFILES="$TMPFILES $TMPFILE"
// Check that with empty ASAN_OPTIONS, ASan reports on OS X actually crash
-// the process (abort_on_error=1). See also Linux/abort_on_error.cc.
+// the process (abort_on_error=1). See also Linux/abort_on_error.cpp.
// RUN: %clangxx_asan %s -o %t
// CHECK-FS: WRITE of size 4
extern "C" void foo(int* a) {
- // CHECK-FS: #0 0x{{.+}} in foo {{.*}}asan-symbolize-partial-report-no-external-symbolizer.cc:[[@LINE+1]]
+ // CHECK-FS: #0 0x{{.+}} in foo {{.*}}asan-symbolize-partial-report-no-external-symbolizer.cpp:[[@LINE+1]]
*a = 5;
}
if (!a)
return 0;
free(a);
- // CHECK-FS: #1 0x{{.+}} in main {{.*}}asan-symbolize-partial-report-no-external-symbolizer.cc:[[@LINE+1]]
+ // CHECK-FS: #1 0x{{.+}} in main {{.*}}asan-symbolize-partial-report-no-external-symbolizer.cpp:[[@LINE+1]]
foo(a);
return 0;
}
// CHECK-FS: WRITE of size 4
extern "C" void foo(int* a) {
- // CHECK-FS: #0 0x{{.+}} in foo {{.*}}asan-symbolize-partial-report-with-module-map.cc:[[@LINE+1]]
+ // CHECK-FS: #0 0x{{.+}} in foo {{.*}}asan-symbolize-partial-report-with-module-map.cpp:[[@LINE+1]]
*a = 5;
}
if (!a)
return 0;
free(a);
- // CHECK-FS: #1 0x{{.+}} in main {{.*}}asan-symbolize-partial-report-with-module-map.cc:[[@LINE+1]]
+ // CHECK-FS: #1 0x{{.+}} in main {{.*}}asan-symbolize-partial-report-with-module-map.cpp:[[@LINE+1]]
foo(a);
return 0;
}
// CHECK-MM: WRITE of size 4
extern "C" void foo(int* a) {
- // CHECK-MM: #0 0x{{.+}} in foo {{.*}}asan-symbolize-with-module-map.cc:[[@LINE+1]]
+ // CHECK-MM: #0 0x{{.+}} in foo {{.*}}asan-symbolize-with-module-map.cpp:[[@LINE+1]]
*a = 5;
}
if (!a)
return 0;
free(a);
- // CHECK-MM: #1 0x{{.+}} in main {{.*}}asan-symbolize-with-module-map.cc:[[@LINE+1]]
+ // CHECK-MM: #1 0x{{.+}} in main {{.*}}asan-symbolize-with-module-map.cpp:[[@LINE+1]]
foo(a);
return 0;
}
// CHECK: Using atos at user-specified path:
// CHECK: AddressSanitizer: attempting double-free{{.*}}in thread T0
// CHECK: #0 0x{{.*}} in {{.*}}free
- // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer-dyld-root-path.cc:[[@LINE-4]]
+ // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer-dyld-root-path.cpp:[[@LINE-4]]
// CHECK: freed by thread T0 here:
// CHECK: #0 0x{{.*}} in {{.*}}free
- // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer-dyld-root-path.cc:[[@LINE-8]]
+ // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer-dyld-root-path.cpp:[[@LINE-8]]
// CHECK: allocated by thread T0 here:
- // CHECK: atos-symbolizer-dyld-root-path.cc:[[@LINE-13]]
+ // CHECK: atos-symbolizer-dyld-root-path.cpp:[[@LINE-13]]
return res;
}
// CHECK: Using atos at user-specified path:
// CHECK: AddressSanitizer: attempting double-free{{.*}}in thread T0
// CHECK: #0 0x{{.*}} in {{.*}}free
- // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer.cc:[[@LINE-4]]
+ // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer.cpp:[[@LINE-4]]
// CHECK: freed by thread T0 here:
// CHECK: #0 0x{{.*}} in {{.*}}free
- // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer.cc:[[@LINE-8]]
+ // CHECK: #1 0x{{.*}} in main {{.*}}atos-symbolizer.cpp:[[@LINE-8]]
// CHECK: allocated by thread T0 here:
- // CHECK: atos-symbolizer.cc:[[@LINE-13]]
+ // CHECK: atos-symbolizer.cpp:[[@LINE-13]]
return res;
}
void faulty_func(char *p) {
*p = 'x'; // BOOM
// CHECK: AddressSanitizer: global-buffer-overflow
- // CHECK-LI: #0 0x{{.*}} in faulty_func{{.*}} {{.*}}haswell-symbolication.cc:[[@LINE-2]]
+ // CHECK-LI: #0 0x{{.*}} in faulty_func{{.*}} {{.*}}haswell-symbolication.cpp:[[@LINE-2]]
// CHECK-NOLI: #0 0x{{.*}} in faulty_func{{.*}} {{.*}}haswell-symbolication
// CHECK: is located 2 bytes to the right of global variable 'faulty_global'
// CHECK-NOT: LLVMSymbolizer: error reading file
// executing other programs.
// RUN: %clangxx_asan %s -o %t
-// RUN: %clangxx %p/../Helpers/echo-env.cc -o %t-echo-env
+// RUN: %clangxx %p/../Helpers/echo-env.cpp -o %t-echo-env
// RUN: %clangxx -DSHARED_LIB %s \
// RUN: -dynamiclib -o %t-darwin-dummy-shared-lib-so.dylib
memcpy(mybuf, x, 10);
// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
// CHECK: Process module map:
- // CHECK: uuid.cc.tmp {{.*}} <[[UUID]]>
+ // CHECK: uuid.cpp.tmp {{.*}} <[[UUID]]>
fprintf(stderr, "Done.\n");
}
// Helper binary for
-// lit_tests/TestCases/Darwin/unset-insert-libraries-on-exec.cc
+// lit_tests/TestCases/Darwin/unset-insert-libraries-on-exec.cpp
// Prints the environment variable with the given name.
#include <stdio.h>
#include <stdlib.h>
global:*badGlobal*=init
type:*badNamespace::BadClass*=init
-src:*initialization-blacklist-extra2.cc=init
+src:*initialization-blacklist-extra2.cpp=init
// Check that with empty ASAN_OPTIONS, ASan reports on Linux don't crash
-// the process (abort_on_error=0). See also Darwin/abort_on_error.cc.
+// the process (abort_on_error=0). See also Darwin/abort_on_error.cpp.
// RUN: %clangxx_asan %s -o %t
// RUN: %clangxx -O0 %s -c -o %t.o
// RUN: %clangxx_asan -O0 %t.o %libdl -o %t
-// RUN: rm -f %t.asan.options.activation-options.cc.tmp
+// RUN: rm -f %t.asan.options.activation-options.cpp.tmp
// RUN: rm -f %t.asan.options.ABCDE
-// RUN: echo "help=1" >%t.asan.options.activation-options.cc.tmp
+// RUN: echo "help=1" >%t.asan.options.activation-options.cpp.tmp
// RUN: %env_asan_opts=start_deactivated=1 \
// RUN: ASAN_ACTIVATION_OPTIONS=include=%t.asan.options.%b %run %t 2>&1 | \
int boom() {
volatile int three = 3;
char * volatile s = (char *)malloc(three);
-// CHECK: #1 0x{{.*}} in boom {{.*}}clang_gcc_abi.cc:[[@LINE-1]]
+// CHECK: #1 0x{{.*}} in boom {{.*}}clang_gcc_abi.cpp:[[@LINE-1]]
return s[three]; //BOOM
}
__attribute__((naked, noinline)) void gcc_abi() {
-// CHECK: #2 0x{{.*}} in gcc_abi {{.*}}clang_gcc_abi.cc:[[@LINE+1]]
+// CHECK: #2 0x{{.*}} in gcc_abi {{.*}}clang_gcc_abi.cpp:[[@LINE+1]]
asm volatile("str fp, [sp, #-8]!\n\t"
"str lr, [sp, #4]\n\t"
"add fp, sp, #4\n\t"
}
__attribute__((naked, noinline)) void clang_abi() {
-// CHECK: #3 0x{{.*}} in clang_abi {{.*}}clang_gcc_abi.cc:[[@LINE+1]]
+// CHECK: #3 0x{{.*}} in clang_abi {{.*}}clang_gcc_abi.cpp:[[@LINE+1]]
asm volatile("push {r11, lr}\n\t"
"mov r11, sp\n\t"
"bl gcc_abi\n\t"
int main() {
clang_abi();
-// CHECK: #4 0x{{.*}} in main {{.*}}clang_gcc_abi.cc:[[@LINE-1]]
+// CHECK: #4 0x{{.*}} in main {{.*}}clang_gcc_abi.cpp:[[@LINE-1]]
}
// independently on order in which we list source files (if we specify
// strict init-order checking).
-// RUN: %clangxx_asan -O0 %s %p/../Helpers/initialization-bug-extra.cc -o %t
+// RUN: %clangxx_asan -O0 %s %p/../Helpers/initialization-bug-extra.cpp -o %t
// RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %p/../Helpers/initialization-bug-extra.cc %s -o %t
+// RUN: %clangxx_asan -O0 %p/../Helpers/initialization-bug-extra.cpp %s -o %t
// RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s
// Do not test with optimization -- the error may be optimized away.
return y + 1;
// CHECK: {{AddressSanitizer: initialization-order-fiasco}}
// CHECK: {{READ of size .* at 0x.* thread T0}}
- // CHECK: {{#0 0x.* in .*initX.* .*initialization-bug-any-order.cc:}}[[@LINE-3]]
+ // CHECK: {{#0 0x.* in .*initX.* .*initialization-bug-any-order.cpp:}}[[@LINE-3]]
// CHECK: {{0x.* is located 0 bytes inside of global variable .*y.*}}
}
#include <stdio.h>
namespace foo { char G[100]; }
// CHECK: ERROR: AddressSanitizer: odr-violation
-// CHECK: size=100 'foo::G' {{.*}}odr-violation.cc:[[@LINE-2]]:22
+// CHECK: size=100 'foo::G' {{.*}}odr-violation.cpp:[[@LINE-2]]:22
// CHECK: size={{4|100}} 'foo::G'
int main(int argc, char **argv) {
printf("PASS: %p\n", &foo::G);
// CHECK: These globals were registered at these points:
// CHECK: ODR-EXE
-// CHECK: odr-violation.cc.dynamic
-// CHECK: SUMMARY: AddressSanitizer: odr-violation: global 'foo::G' at {{.*}}odr-violation.cc
+// CHECK: odr-violation.cpp.dynamic
+// CHECK: SUMMARY: AddressSanitizer: odr-violation: global 'foo::G' at {{.*}}odr-violation.cpp
// DISABLED: PASS
#endif
res = ptrace((enum __ptrace_request)__PTRACE_REQUEST, pid, __PTRACE_ARGS);
// CHECK: AddressSanitizer: stack-buffer-overflow
- // CHECK: {{.*ptrace.cc:}}[[@LINE-2]]
+ // CHECK: {{.*ptrace.cpp:}}[[@LINE-2]]
assert(!res);
PRINT_REG_PC(regs);
succeeded = sendto(sockfd, buf, kBufSize, 0, (struct sockaddr *)&serveraddr,
sizeof(serveraddr));
// CHECK-SENDTO: {{READ of size 10 at 0x.* thread T1}}
- // CHECK-SENDTO: {{ #1 0x.* in client_thread_udp.*recvfrom.cc:}}[[@LINE-3]]
+ // CHECK-SENDTO: {{ #1 0x.* in client_thread_udp.*recvfrom.cpp:}}[[@LINE-3]]
CHECK_ERROR(succeeded < 0, "in sending message");
return NULL;
}
recvfrom(sockfd, buf, kBufSize, 0, NULL, NULL); // BOOM
// CHECK-RECVFROM: {{WRITE of size 10 at 0x.* thread T0}}
- // CHECK-RECVFROM: {{ #1 0x.* in main.*recvfrom.cc:}}[[@LINE-2]]
+ // CHECK-RECVFROM: {{ #1 0x.* in main.*recvfrom.cpp:}}[[@LINE-2]]
// CHECK-RECVFROM: {{Address 0x.* is located in stack of thread T0 at offset}}
- // CHECK-RECVFROM-NEXT: in{{.*}}main{{.*}}recvfrom.cc
+ // CHECK-RECVFROM-NEXT: in{{.*}}main{{.*}}recvfrom.cpp
succeeded = pthread_join(client_thread, NULL);
CHECK_ERROR(succeeded, "joining thread");
return 0;
inc2(array, -1); // BOOM
// CHECK: ERROR: AddressSanitizer: heap-buffer-overflow
// CHECK: READ of size 4 at 0x{{.*}}
- // CHECK: #0 {{.*}} in inc2 {{.*}}asan-symbolize-sanity-test.cc:[[@LINE+21]]
- // CHECK: #1 {{.*}} in main {{.*}}asan-symbolize-sanity-test.cc:[[@LINE-4]]
+ // CHECK: #0 {{.*}} in inc2 {{.*}}asan-symbolize-sanity-test.cpp:[[@LINE+21]]
+ // CHECK: #1 {{.*}} in main {{.*}}asan-symbolize-sanity-test.cpp:[[@LINE-4]]
// CHECK: allocated by thread T{{.*}} here:
// CHECK: #{{.*}} in {{(wrap_|__interceptor_)?}}malloc
- // CHECK: #{{.*}} in main {{.*}}asan-symbolize-sanity-test.cc:[[@LINE-9]]
+ // CHECK: #{{.*}} in main {{.*}}asan-symbolize-sanity-test.cpp:[[@LINE-9]]
return 0;
}
#else // SHARED_LIBS
// CHECK-FILE: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
// CHECK-FILE: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
// CHECK-FILE: {{WRITE of size 1 at 0x.* thread T0}}
- // CHECK-FILE: {{ #0 0x.* in main .*closed-fds.cc:}}[[@LINE-4]]
+ // CHECK-FILE: {{ #0 0x.* in main .*closed-fds.cpp:}}[[@LINE-4]]
return 0;
}
bar2();
__sanitizer_cov_dump();
// CHECK: RESET
-// CHECK-DAG: SanitizerCoverage: ./coverage-reset.cc{{.*}}.sancov: 2 PCs written
-// CHECK-DAG: SanitizerCoverage: ./libcoverage-reset.cc{{.*}}.sancov: 2 PCs written
+// CHECK-DAG: SanitizerCoverage: ./coverage-reset.cpp{{.*}}.sancov: 2 PCs written
+// CHECK-DAG: SanitizerCoverage: ./libcoverage-reset.cpp{{.*}}.sancov: 2 PCs written
fprintf(stderr, "RESET\n");
__sanitizer_cov_reset();
bar1();
__sanitizer_cov_dump();
// CHECK: RESET
-// CHECK-DAG: SanitizerCoverage: ./coverage-reset.cc{{.*}}.sancov: 1 PCs written
-// CHECK-DAG: SanitizerCoverage: ./libcoverage-reset.cc{{.*}}.sancov: 1 PCs written
+// CHECK-DAG: SanitizerCoverage: ./coverage-reset.cpp{{.*}}.sancov: 1 PCs written
+// CHECK-DAG: SanitizerCoverage: ./libcoverage-reset.cpp{{.*}}.sancov: 1 PCs written
fprintf(stderr, "RESET\n");
__sanitizer_cov_reset();
foo2();
__sanitizer_cov_dump();
// CHECK: RESET
-// CHECK: SanitizerCoverage: ./coverage-reset.cc{{.*}}.sancov: 2 PCs written
+// CHECK: SanitizerCoverage: ./coverage-reset.cpp{{.*}}.sancov: 2 PCs written
fprintf(stderr, "RESET\n");
__sanitizer_cov_reset();
bar2();
__sanitizer_cov_dump();
// CHECK: RESET
-// CHECK: SanitizerCoverage: ./libcoverage-reset.cc{{.*}}.sancov: 2 PCs written
+// CHECK: SanitizerCoverage: ./libcoverage-reset.cpp{{.*}}.sancov: 2 PCs written
fprintf(stderr, "RESET\n");
__sanitizer_cov_reset();
// CHECK: RESET
bar2();
-// CHECK: SanitizerCoverage: ./libcoverage-reset.cc{{.*}}.sancov: 1 PCs written
+// CHECK: SanitizerCoverage: ./libcoverage-reset.cpp{{.*}}.sancov: 1 PCs written
}
#endif
my_memset(buf, 11);
// CHECK: {{.*ERROR: AddressSanitizer: stack-buffer-overflow}}
// CHECK: {{WRITE of size 11 at 0x.* thread T0}}
- // CHECK: {{0x.* in my_memset .*interception-in-shared-lib-test.cc:}}[[@LINE-10]]
+ // CHECK: {{0x.* in my_memset .*interception-in-shared-lib-test.cpp:}}[[@LINE-10]]
return 0;
}
#endif
char *parent_pointer = &local;
// B: ERROR: AddressSanitizer: invalid-pointer-pair
- // B: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-threads.cc:[[@LINE+1]]
+ // B: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-threads.cpp:[[@LINE+1]]
unsigned r = parent_pointer - pointers[0];
}
int res = ioctl(fd, FIONBIO, &nonblock + 1);
// CHECK: AddressSanitizer: stack-buffer-overflow
// CHECK: READ of size 4 at
- // CHECK: {{#.* in main .*ioctl.cc:}}[[@LINE-3]]
+ // CHECK: {{#.* in main .*ioctl.cpp:}}[[@LINE-3]]
assert(res == 0);
close(fd);
return 0;
C *buffer = new C[argc];
buffer[-2].x = 10;
// CHECK: AddressSanitizer: heap-buffer-overflow
-// CHECK: in main {{.*}}new_array_cookie_test.cc:[[@LINE-2]]
+// CHECK: in main {{.*}}new_array_cookie_test.cpp:[[@LINE-2]]
// CHECK: is located 0 bytes inside of 12-byte region
// NO_COOKIE: ZZZZZZZZ
delete [] buffer;
// CHECK: {{.*ERROR: AddressSanitizer: global-buffer-overflow}}
// CHECK: {{READ of size 4 at 0x.* thread T0}}
// CHECK: {{ #0 0x.*}}
- // CHECK: {{ #1 0x.* in main .*shared-lib-test.cc:}}[[@LINE-4]]
+ // CHECK: {{ #1 0x.* in main .*shared-lib-test.cpp:}}[[@LINE-4]]
return 0;
}
#else // SHARED_LIB
fprintf(stderr, "2: %p\n", x);
*x = 1;
// CHECK: WRITE of size 1 {{.*}} thread T0
- // CHECK: #0{{.*}}Func2{{.*}}stack-use-after-return.cc:[[@LINE-2]]
+ // CHECK: #0{{.*}}Func2{{.*}}stack-use-after-return.cpp:[[@LINE-2]]
// CHECK: is located in stack of thread T0 at offset
// CHECK: 'local'{{.*}} <== Memory access at offset {{16|32}} is inside this variable
// THREAD: WRITE of size 1 {{.*}} thread T{{[1-9]}}
- // THREAD: #0{{.*}}Func2{{.*}}stack-use-after-return.cc:[[@LINE-6]]
+ // THREAD: #0{{.*}}Func2{{.*}}stack-use-after-return.cpp:[[@LINE-6]]
// THREAD: is located in stack of thread T{{[1-9]}} at offset
// THREAD: 'local'{{.*}} <== Memory access at offset {{16|32}} is inside this variable
// CHECK-20: T0: FakeStack created:{{.*}} stack_size_log: 20
char *copy = strndup(kString, 2);
int x = copy[2 + argc]; // BOOM
// CHECK: AddressSanitizer: heap-buffer-overflow
- // CHECK: #0 {{.*}}main {{.*}}strndup_oob_test.cc:[[@LINE-2]]
+ // CHECK: #0 {{.*}}main {{.*}}strndup_oob_test.cpp:[[@LINE-2]]
// CHECK-LABEL: allocated by thread T{{.*}} here:
// CHECK: #{{[01]}} {{.*}}strndup
- // CHECK: #{{.*}}main {{.*}}strndup_oob_test.cc:[[@LINE-6]]
+ // CHECK: #{{.*}}main {{.*}}strndup_oob_test.cpp:[[@LINE-6]]
// CHECK-LABEL: SUMMARY
- // CHECK: strndup_oob_test.cc:[[@LINE-7]]
+ // CHECK: strndup_oob_test.cpp:[[@LINE-7]]
return x;
}
char *copy = strndup(kChars, 3);\r
copy = strndup(kChars, 10);\r
// CHECK: AddressSanitizer: global-buffer-overflow\r
- // CHECK: {{.*}}main {{.*}}.cc:[[@LINE-2]]\r
+ // CHECK: {{.*}}main {{.*}}.cpp:[[@LINE-2]]\r
return *copy;\r
}\r
// CHECK: stack-buffer-overflow
// CHECK: {{WRITE of size .* at 0x.* thread T0}}
// CHECK: {{in .*wait}}
- // CHECK: {{in main .*wait.cc:}}
+ // CHECK: {{in main .*wait.cpp:}}
// CHECK: is located in stack of thread T0 at offset
// CHECK: {{in main}}
return res == -1 ? 1 : 0;
// CHECK: stack-buffer-overflow
// CHECK: {{WRITE of size .* at 0x.* thread T0}}
// CHECK: {{in .*wait}}
- // CHECK: {{in main .*wait3.cc:}}
+ // CHECK: {{in main .*wait3.cpp:}}
// CHECK: is located in stack of thread T0 at offset
// CHECK: {{in main}}
return res == -1 ? 1 : 0;
// CHECK: stack-buffer-overflow
// CHECK: {{WRITE of size .* at 0x.* thread T0}}
// CHECK: {{in .*wait}}
- // CHECK: {{in main .*wait4.cc:}}
+ // CHECK: {{in main .*wait4.cpp:}}
// CHECK: is located in stack of thread T0 at offset
// CHECK: {{in main}}
return res == -1 ? 1 : 0;
// CHECK: stack-buffer-overflow
// CHECK: {{WRITE of size .* at 0x.* thread T0}}
// CHECK: {{in .*waitid}}
- // CHECK: {{in main .*waitid.cc:}}
+ // CHECK: {{in main .*waitid.cpp:}}
// CHECK: is located in stack of thread T0 at offset
// CHECK: {{in main}}
return res != -1;
s->bf2 = 2;
// CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
// CHECK: READ of size {{[124]}} at [[ADDR]]
-// CHECK: {{#0 .* make_access.*bitfield_uaf.cc}}:[[@LINE-3]]
+// CHECK: {{#0 .* make_access.*bitfield_uaf.cpp}}:[[@LINE-3]]
// CHECK: {{#1 .* main}}
}
// CHECK: [[ADDR]] is located 0 bytes inside of 4-byte region
// CHECK-LABEL: freed by thread T0 here:
// CHECK: {{#0 .* free }}
-// CHECK: {{#1 .* main .*bitfield_uaf.cc}}:[[@LINE-4]]
+// CHECK: {{#1 .* main .*bitfield_uaf.cpp}}:[[@LINE-4]]
// CHECK-LABEL: previously allocated by thread T0 here:
// CHECK: {{#0 .* malloc }}
-// CHECK: {{#1 .* main .*bitfield_uaf.cc}}:[[@LINE-8]]
+// CHECK: {{#1 .* main .*bitfield_uaf.cpp}}:[[@LINE-8]]
make_access(s);
return 0;
}
buffer[-1] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 4 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*calloc_left_oob.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*calloc_left_oob.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 4 bytes to the left of 168-byte region
// CHECK: allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* calloc }}
-// CHECK-NEXT: {{#1 .* main .*calloc_left_oob.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*calloc_left_oob.cpp}}:[[@LINE-8]]
free(buffer);
}
buffer[42] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 4 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*calloc_right_oob.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*calloc_right_oob.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes to the right of 168-byte region
// CHECK: allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* calloc }}
-// CHECK-NEXT: {{#1 .* main .*calloc_right_oob.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*calloc_right_oob.cpp}}:[[@LINE-8]]
free(buffer);
}
buffer[0] = 42;
// CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 4 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*calloc_uaf.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*calloc_uaf.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes inside of 168-byte region
// CHECK: freed by thread T0 here:
// CHECK-NEXT: {{#0 .* free }}
-// CHECK-NEXT: {{#1 .* main .*calloc_uaf.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*calloc_uaf.cpp}}:[[@LINE-8]]
// CHECK: previously allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* calloc }}
-// CHECK-NEXT: {{#1 .* main .*calloc_uaf.cc}}:[[@LINE-12]]
+// CHECK-NEXT: {{#1 .* main .*calloc_uaf.cpp}}:[[@LINE-12]]
}
// __local_stdio_printf_options function isn't instrumented for coverage.
// RUN: rm -rf %t && mkdir %t && cd %t
-// RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -Od %p/dll_host.cc -Fet.exe
+// RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -Od %p/dll_host.cpp -Fet.exe
// RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -LD -Od %s -Fet.dll
// RUN: %run ./t.exe t.dll 2>&1 | FileCheck %s
free(buffer);
A<char*> a(buffer);
// CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
-// CHECK: foo::bar<42>{{.*}}demangled_names.cc
-// CHECK: foo::spam{{.*}}demangled_names.cc
-// CHECK: baz<char *,1>{{.*}}demangled_names.cc
-// CHECK: A<char *>::~A<char *>{{.*}}demangled_names.cc
+// CHECK: foo::bar<42>{{.*}}demangled_names.cpp
+// CHECK: foo::spam{{.*}}demangled_names.cpp
+// CHECK: baz<char *,1>{{.*}}demangled_names.cpp
+// CHECK: A<char *>::~A<char *>{{.*}}demangled_names.cpp
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: %run %t %t.dll | FileCheck %s
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: %run %t %t.dll | FileCheck %s
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: %run %t %t.dll 2>&1 | FileCheck %s
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -O2 %s -Fe%t.dll
// RUNX: %run %t %t.dll 2>&1 | FileCheck %s
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
//
// RUN: %clang_cl_asan /Gw -LD -Od %s -Fe%t.dll
// RUN: %env_asan_opts=report_globals=2 %run %t %t.dll 2>&1 | FileCheck %s --check-prefix=NOSTRIP
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
// CHECK: READ of size 7 at [[ADDR]] thread T0
// CHECK-NEXT: __asan_wrap_memchr
// CHECK-NEXT: memchr
-// CHECK-NEXT: test_function {{.*}}dll_intercept_memchr.cc:[[@LINE-5]]
+// CHECK-NEXT: test_function {{.*}}dll_intercept_memchr.cpp:[[@LINE-5]]
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
-// CHECK-NEXT: test_function {{.*}}dll_intercept_memchr.cc
+// CHECK-NEXT: test_function {{.*}}dll_intercept_memchr.cpp
// CHECK: 'buff'{{.*}} <== Memory access at offset {{.*}} overflows this variable
return 0;
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -Wno-fortify-source -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
// CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 6 at [[ADDR]] thread T0
// CHECK-NEXT: __asan_{{.*}}memcpy
-// CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy.cc:[[@LINE-4]]
+// CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy.cpp:[[@LINE-4]]
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
-// CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy.cc
+// CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy.cpp
// CHECK: 'buff2'{{.*}} <== Memory access at offset {{.*}} overflows this variable
return 0;
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
// CHECK: WRITE of size 6 at [[ADDR]] thread T0
// CHECK-NEXT: __asan_{{.*}}mem{{.*}}
// CHECK-NEXT: call_memcpy
-// CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy_indirect.cc:[[@LINE-5]]
+// CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy_indirect.cpp:[[@LINE-5]]
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
-// CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy_indirect.cc
+// CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy_indirect.cpp
// CHECK: 'buff2'{{.*}} <== Memory access at offset {{.*}} overflows this variable
return 0;
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -Wno-fortify-source -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
// CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 6 at [[ADDR]] thread T0
// CHECK-NEXT: __asan_memset
-// CHECK-NEXT: test_function {{.*}}dll_intercept_memset.cc:[[@LINE-4]]
+// CHECK-NEXT: test_function {{.*}}dll_intercept_memset.cpp:[[@LINE-4]]
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
-// CHECK-NEXT: test_function {{.*}}dll_intercept_memset.cc
+// CHECK-NEXT: test_function {{.*}}dll_intercept_memset.cpp
// CHECK: 'buff'{{.*}} <== Memory access at offset {{.*}} overflows this variable
return 0;
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
// FIXME: Should be READ of size 1, see issue 155.
// CHECK: READ of size {{[0-9]+}} at [[ADDR]] thread T0
// CHECK-NEXT: {{#0 .*}}strlen
-// CHECK-NEXT: {{#1 .* test_function .*}}dll_intercept_strlen.cc:[[@LINE-5]]
+// CHECK-NEXT: {{#1 .* test_function .*}}dll_intercept_strlen.cpp:[[@LINE-5]]
//
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
-// CHECK-NEXT: test_function {{.*}}dll_intercept_strlen.cc:
+// CHECK-NEXT: test_function {{.*}}dll_intercept_strlen.cpp:
return len > 42;
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
buffer[-1] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: test_function {{.*}}dll_malloc_left_oob.cc:[[@LINE-3]]
-// CHECK-NEXT: main {{.*}}dll_host.cc
+// CHECK-NEXT: test_function {{.*}}dll_malloc_left_oob.cpp:[[@LINE-3]]
+// CHECK-NEXT: main {{.*}}dll_host.cpp
//
// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
// CHECK-LABEL: allocated by thread T0 here:
// CHECK-NEXT: malloc
-// CHECK-NEXT: test_function {{.*}}dll_malloc_left_oob.cc:[[@LINE-10]]
-// CHECK-NEXT: main {{.*}}dll_host.cc
+// CHECK-NEXT: test_function {{.*}}dll_malloc_left_oob.cpp:[[@LINE-10]]
+// CHECK-NEXT: main {{.*}}dll_host.cpp
// CHECK-LABEL: SUMMARY
free(buffer);
return 0;
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
buffer[0] = 42;
// CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 4 at [[ADDR]] thread T0
-// CHECK-NEXT: test_function {{.*}}dll_malloc_uaf.cc:[[@LINE-3]]
+// CHECK-NEXT: test_function {{.*}}dll_malloc_uaf.cpp:[[@LINE-3]]
// CHECK-NEXT: main {{.*}}dll_host
//
// CHECK: [[ADDR]] is located 0 bytes inside of 42-byte region
// CHECK-LABEL: freed by thread T0 here:
// CHECK-NEXT: free
-// CHECK-NEXT: test_function {{.*}}dll_malloc_uaf.cc:[[@LINE-10]]
+// CHECK-NEXT: test_function {{.*}}dll_malloc_uaf.cpp:[[@LINE-10]]
// CHECK-NEXT: main {{.*}}dll_host
//
// CHECK-LABEL: previously allocated by thread T0 here:
// CHECK-NEXT: malloc
-// CHECK-NEXT: test_function {{.*}}dll_malloc_uaf.cc:[[@LINE-16]]
+// CHECK-NEXT: test_function {{.*}}dll_malloc_uaf.cpp:[[@LINE-16]]
// CHECK-NEXT: main {{.*}}dll_host
return 0;
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
_exit(1);
// CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: noreturn_f{{.*}}dll_noreturn.cc:[[@LINE-4]]
-// CHECK-NEXT: test_function{{.*}}dll_noreturn.cc
-// CHECK-NEXT: main{{.*}}dll_host.cc
+// CHECK-NEXT: noreturn_f{{.*}}dll_noreturn.cpp:[[@LINE-4]]
+// CHECK-NEXT: test_function{{.*}}dll_noreturn.cpp
+// CHECK-NEXT: main{{.*}}dll_host.cpp
//
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame
-// CHECK-NEXT: noreturn_f{{.*}}dll_noreturn.cc
+// CHECK-NEXT: noreturn_f{{.*}}dll_noreturn.cpp
// CHECK: 'buffer'{{.*}} <== Memory access at offset [[OFFSET]] underflows this variable
// CHECK-LABEL: SUMMARY
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
extern "C" __declspec(dllexport)
int test_function() {
NullDeref((int*)0);
- // CHECK: {{ #1 0x.* in test_function .*\dll_null_deref.cc:}}[[@LINE-1]]
+ // CHECK: {{ #1 0x.* in test_function .*\dll_null_deref.cpp:}}[[@LINE-1]]
// CHECK: AddressSanitizer can not provide additional info.
return 0;
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
buffer[-1] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: test_function {{.*}}dll_operator_array_new_left_oob.cc:[[@LINE-3]]
-// CHECK-NEXT: main {{.*}}dll_host.cc
+// CHECK-NEXT: test_function {{.*}}dll_operator_array_new_left_oob.cpp:[[@LINE-3]]
+// CHECK-NEXT: main {{.*}}dll_host.cpp
//
// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
// CHECK-LABEL: allocated by thread T0 here:
// operator new/delete in DLLs when using -MT CRT.
// FIXME: The 'operator new' frame should have [].
// CHECK: operator new
-// CHECK-NEXT: test_function {{.*}}dll_operator_array_new_left_oob.cc:[[@LINE-13]]
-// CHECK-NEXT: main {{.*}}dll_host.cc
+// CHECK-NEXT: test_function {{.*}}dll_operator_array_new_left_oob.cpp:[[@LINE-13]]
+// CHECK-NEXT: main {{.*}}dll_host.cpp
// CHECK-LABEL: SUMMARY
delete [] buffer;
return 0;
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
buffer[-(1 + sizeof(void*) / 4)].x = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 4 at [[ADDR]] thread T0
-// CHECK-NEXT: test_function {{.*}}dll_operator_array_new_with_dtor_left_oob.cc:[[@LINE-3]]
-// CHECK-NEXT: main {{.*}}dll_host.cc
+// CHECK-NEXT: test_function {{.*}}dll_operator_array_new_with_dtor_left_oob.cpp:[[@LINE-3]]
+// CHECK-NEXT: main {{.*}}dll_host.cpp
//
// FIXME: Currently it says "4 bytes ... left of 172-byte region",
// should be "8 bytes ... left of 168-byte region", see
// FIXME: The operator new frame should have [].
// CHECK-LABEL: allocated by thread T0 here:
// CHECK: operator new
-// CHECK-NEXT: test_function {{.*}}dll_operator_array_new_with_dtor_left_oob.cc:[[@LINE-16]]
-// CHECK-NEXT: main {{.*}}dll_host.cc
+// CHECK-NEXT: test_function {{.*}}dll_operator_array_new_with_dtor_left_oob.cpp:[[@LINE-16]]
+// CHECK-NEXT: main {{.*}}dll_host.cpp
// CHECK-LABEL: SUMMARY
delete [] buffer;
return 0;
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
should_crash(&buffer[96]);
// CHECK: AddressSanitizer: use-after-poison on address [[ADDR:0x[0-9a-f]+]]
// CHECK-NEXT: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: should_crash{{.*}}\dll_poison_unpoison.cc
-// CHECK-NEXT: test_function{{.*}}\dll_poison_unpoison.cc:[[@LINE-4]]
+// CHECK-NEXT: should_crash{{.*}}\dll_poison_unpoison.cpp
+// CHECK-NEXT: test_function{{.*}}\dll_poison_unpoison.cpp:[[@LINE-4]]
// CHECK-NEXT: main
//
// CHECK: [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame
-// CHECK-NEXT: test_function{{.*}}\dll_poison_unpoison.cc
+// CHECK-NEXT: test_function{{.*}}\dll_poison_unpoison.cpp
// CHECK: 'buffer'{{.*}} <== Memory access at offset [[OFFSET]] is inside this variable
return 0;
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
//
// Check both -GS and -GS- builds:
// RUN: %clang_cl_asan -GS -LD -Od %s -Fe%t.dll
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: %env_asan_opts=detect_stack_use_after_return=1 not %run %t %t.dll 2>&1 | FileCheck %s
*x = 42;
// CHECK: AddressSanitizer: stack-use-after-return
// CHECK: WRITE of size 1 at [[ADDR:.*]] thread T0
-// CHECK-NEXT: test_function{{.*}}dll_stack_use_after_return.cc:[[@LINE-3]]
+// CHECK-NEXT: test_function{{.*}}dll_stack_use_after_return.cpp:[[@LINE-3]]
// CHECK-NEXT: main
//
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame
-// CHECK-NEXT: #0 {{.*}} foo{{.*}}dll_stack_use_after_return.cc
+// CHECK-NEXT: #0 {{.*}} foo{{.*}}dll_stack_use_after_return.cpp
// CHECK: 'stack_buffer'{{.*}} <== Memory access at offset [[OFFSET]] is inside this variable
return 0;
}
-// RUN: %clang_cl_asan -Od %p/dll_host.cc -Fe%t
+// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
// RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s
stack_buffer[subscript] = 42;
// CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T1
-// CHECK-NEXT: thread_proc{{.*}}dll_thread_stack_array_left_oob.cc:[[@LINE-3]]
+// CHECK-NEXT: thread_proc{{.*}}dll_thread_stack_array_left_oob.cpp:[[@LINE-3]]
//
// CHECK: Address [[ADDR]] is located in stack of thread T1 at offset [[OFFSET:.*]] in frame
-// CHECK-NEXT: thread_proc{{.*}}dll_thread_stack_array_left_oob.cc
+// CHECK-NEXT: thread_proc{{.*}}dll_thread_stack_array_left_oob.cpp
//
// CHECK: 'stack_buffer'{{.*}} <== Memory access at offset [[OFFSET]] underflows this variable
int test_function() {
HANDLE thr = CreateThread(NULL, 0, thread_proc, NULL, 0, NULL);
// CHECK-LABEL: Thread T1 created by T0 here:
-// CHECK: test_function{{.*}}dll_thread_stack_array_left_oob.cc:[[@LINE-2]]
-// CHECK-NEXT: main{{.*}}dll_host.cc
+// CHECK: test_function{{.*}}dll_thread_stack_array_left_oob.cpp:[[@LINE-2]]
+// CHECK-NEXT: main{{.*}}dll_host.cpp
// CHECK-LABEL: SUMMARY
if (thr == 0)
return 1;
free(x);
// CHECK: AddressSanitizer: attempting double-free on [[ADDR:0x[0-9a-f]+]]
// CHECK-NEXT: {{#0 .* free }}
-// CHECK-NEXT: {{#1 .* main .*double_free.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#1 .* main .*double_free.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes inside of 168-byte region
// CHECK-LABEL: freed by thread T0 here:
// CHECK-NEXT: {{#0 .* free }}
-// CHECK-NEXT: {{#1 .* main .*double_free.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*double_free.cpp}}:[[@LINE-8]]
// CHECK-LABEL: previously allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* malloc }}
-// CHECK-NEXT: {{#1 .* main .*double_free.cc}}:[[@LINE-12]]
+// CHECK-NEXT: {{#1 .* main .*double_free.cpp}}:[[@LINE-12]]
return 0;
}
// CHECK: AddressSanitizer: attempting double-free on [[ADDR:0x[0-9a-f]+]]
// FIXME: The 'operator delete' frame should have [].
// CHECK-NEXT: {{#0 .* operator delete}}
-// CHECK-NEXT: {{#1 .* main .*double_operator_delete.cc}}:[[@LINE-4]]
+// CHECK-NEXT: {{#1 .* main .*double_operator_delete.cpp}}:[[@LINE-4]]
// CHECK: [[ADDR]] is located 0 bytes inside of 168-byte region
// CHECK-LABEL: freed by thread T0 here:
// FIXME: The 'operator delete' frame should have [].
// CHECK-NEXT: {{#0 .* operator delete}}
-// CHECK-NEXT: {{#1 .* main .*double_operator_delete.cc}}:[[@LINE-10]]
+// CHECK-NEXT: {{#1 .* main .*double_operator_delete.cpp}}:[[@LINE-10]]
// CHECK-LABEL: previously allocated by thread T0 here:
// FIXME: The 'operator new' frame should have [].
// CHECK-NEXT: {{#0 .* operator new}}
-// CHECK-NEXT: {{#1 .* main .*double_operator_delete.cc}}:[[@LINE-15]]
+// CHECK-NEXT: {{#1 .* main .*double_operator_delete.cpp}}:[[@LINE-15]]
return 0;
}
memset(ZZZ, 0, 10);
int res = YYY[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in main .*fuse-lld-globals.cc:}}[[@LINE-2]]
+ // CHECK: {{ #0 0x.* in main .*fuse-lld-globals.cpp:}}[[@LINE-2]]
// CHECK: {{0x.* is located 0 bytes to the right of global variable}}
// CHECK: {{.*YYY.* of size 10}}
res += XXX[argc] + ZZZ[argc];
return x[5];
// CHECK: heap-use-after-free
// CHECK: free
- // CHECK: main{{.*}}fuse-lld.cc:[[@LINE-4]]:3
+ // CHECK: main{{.*}}fuse-lld.cpp:[[@LINE-4]]:3
// CHECK: malloc
- // CHECK: main{{.*}}fuse-lld.cc:[[@LINE-7]]:20
+ // CHECK: main{{.*}}fuse-lld.cpp:[[@LINE-7]]:20
}
// CHECK-NOT: Boo
// CHECK: AddressSanitizer: global-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: READ of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*global_const_string_oob.cc:}}[[@LINE-5]]
-// CHECK: [[ADDR]] is located 5 bytes to the right of global variable [[STR:.*]] defined in {{'.*global_const_string_oob.cc:7:.*' .*}} of size 11
+// CHECK-NEXT: {{#0 .* main .*global_const_string_oob.cpp:}}[[@LINE-5]]
+// CHECK: [[ADDR]] is located 5 bytes to the right of global variable [[STR:.*]] defined in {{'.*global_const_string_oob.cpp:7:.*' .*}} of size 11
// CHECK: [[STR]] is ascii string 'foobarspam'
return 0;
}
// CHECK: WRITE of size 6 at [[ADDR]] thread T0
// CHECK-NEXT: __asan_{{.*}}mem{{.*}}
// CHECK-NEXT: call_mem{{.*}}
-// CHECK-NEXT: main {{.*}}intercept_memcpy.cc:[[@LINE-5]]
+// CHECK-NEXT: main {{.*}}intercept_memcpy.cpp:[[@LINE-5]]
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
// CHECK-NEXT: #0 {{.*}} main
// CHECK: 'buff2'{{.*}} <== Memory access at offset {{.*}} overflows this variable
ptr[subscript] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK: {{#0 .* main .*}}intercept_strdup.cc:[[@LINE-3]]
+// CHECK: {{#0 .* main .*}}intercept_strdup.cpp:[[@LINE-3]]
// CHECK: [[ADDR]] is located 1 bytes to the left of 6-byte region
// CHECK: allocated by thread T0 here:
//
//
// The local call to _strdup above may be the second or third frame depending
// on whether we're using the dynamic config.
-// CHECK: #{{[12]}} {{.*}} in main {{.*}}intercept_strdup.cc:[[@LINE-21]]
+// CHECK: #{{[12]}} {{.*}} in main {{.*}}intercept_strdup.cpp:[[@LINE-21]]
free(ptr);
}
// FIXME: Should be READ of size 1, see issue 155.
// CHECK: READ of size {{[0-9]+}} at [[ADDR]] thread T0
// CHECK: strlen
-// CHECK-NEXT: main {{.*}}intercept_strlen.cc:[[@LINE-5]]
+// CHECK-NEXT: main {{.*}}intercept_strlen.cpp:[[@LINE-5]]
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
-// CHECK-NEXT: main {{.*}}intercept_strlen.cc
+// CHECK-NEXT: main {{.*}}intercept_strlen.cpp
// CHECK: 'str'{{.*}} <== Memory access at offset {{.*}} overflows this variable
return len < 6;
}
buffer[-1] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*malloc_left_oob.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*malloc_left_oob.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
// CHECK: allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* malloc }}
-// CHECK-NEXT: {{#1 .* main .*malloc_left_oob.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*malloc_left_oob.cpp}}:[[@LINE-8]]
free(buffer);
}
buffer[42] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*malloc_right_oob.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*malloc_right_oob.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes to the right of 42-byte region
// CHECK: allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* malloc }}
-// CHECK-NEXT: {{#1 .* main .*malloc_right_oob.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*malloc_right_oob.cpp}}:[[@LINE-8]]
free(buffer);
}
buffer[0] = 42;
// CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*malloc_uaf.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*malloc_uaf.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes inside of 42-byte region
// CHECK: freed by thread T0 here:
// CHECK-NEXT: {{#0 .* free }}
-// CHECK-NEXT: {{#1 .* main .*malloc_uaf.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*malloc_uaf.cpp}}:[[@LINE-8]]
// CHECK: previously allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* malloc }}
-// CHECK-NEXT: {{#1 .* main .*malloc_uaf.cc}}:[[@LINE-12]]
+// CHECK-NEXT: {{#1 .* main .*malloc_uaf.cpp}}:[[@LINE-12]]
}
}
int main() {
NullDeref((int*)0);
- // CHECK: {{ #1 0x.* in main.*null_deref.cc:}}[[@LINE-1]]:3
+ // CHECK: {{ #1 0x.* in main.*null_deref.cpp:}}[[@LINE-1]]:3
// CHECK: AddressSanitizer can not provide additional info.
}
__declspec(dllexport) void foo2() {
NullDeref((int*)0);
- // CHECK: {{ #1 0x.* in foo2.*null_deref_multiple_dlls.cc:}}[[@LINE-1]]
+ // CHECK: {{ #1 0x.* in foo2.*null_deref_multiple_dlls.cpp:}}[[@LINE-1]]
// CHECK: AddressSanitizer can not provide additional info.
}
#else
buffer[-1] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*operator_array_new_left_oob.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*operator_array_new_left_oob.cpp}}:[[@LINE-3]]
//
// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
// CHECK-LABEL: allocated by thread T0 here:
// FIXME: The 'operator new' frame should have [].
// CHECK-NEXT: {{#0 .* operator new}}
-// CHECK-NEXT: {{#1 .* main .*operator_array_new_left_oob.cc}}:[[@LINE-10]]
+// CHECK-NEXT: {{#1 .* main .*operator_array_new_left_oob.cpp}}:[[@LINE-10]]
delete [] buffer;
}
buffer[42] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK: {{#0 .* main .*operator_array_new_right_oob.cc}}:[[@LINE-3]]
+// CHECK: {{#0 .* main .*operator_array_new_right_oob.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes to the right of 42-byte region
// CHECK: allocated by thread T0 here:
// FIXME: The 'operator new' frame should have [].
// CHECK: {{#0 .* operator new}}
-// CHECK: {{#1 .* main .*operator_array_new_right_oob.cc}}:[[@LINE-9]]
+// CHECK: {{#1 .* main .*operator_array_new_right_oob.cpp}}:[[@LINE-9]]
delete [] buffer;
}
buffer[0] = 42;
// CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK: {{#0 .* main .*operator_array_new_uaf.cc}}:[[@LINE-3]]
+// CHECK: {{#0 .* main .*operator_array_new_uaf.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes inside of 42-byte region
// CHECK-LABEL: freed by thread T0 here:
// FIXME: The 'operator delete' frame should have [].
// CHECK: {{#0 .* operator delete}}
-// CHECK: {{#1 .* main .*operator_array_new_uaf.cc}}:[[@LINE-9]]
+// CHECK: {{#1 .* main .*operator_array_new_uaf.cpp}}:[[@LINE-9]]
// CHECK-LABEL: previously allocated by thread T0 here:
// FIXME: The 'operator new' frame should have [].
// CHECK: {{#0 .* operator new}}
-// CHECK: {{#1 .* main .*operator_array_new_uaf.cc}}:[[@LINE-14]]
+// CHECK: {{#1 .* main .*operator_array_new_uaf.cpp}}:[[@LINE-14]]
return 0;
}
buffer[-(1 + sizeof(void*) / 4)].x = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 4 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*operator_array_new_with_dtor_left_oob.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*operator_array_new_with_dtor_left_oob.cpp}}:[[@LINE-3]]
//
// FIXME: Currently it says "4 bytes ... left of 172-byte region",
// should be "8 bytes ... left of 168-byte region", see
// CHECK-LABEL: allocated by thread T0 here:
// FIXME: The 'operator new' frame should have [].
// CHECK-NEXT: {{#0 .* operator new}}
-// CHECK-NEXT: {{#1 .* main .*operator_array_new_with_dtor_left_oob.cc}}:[[@LINE-13]]
+// CHECK-NEXT: {{#1 .* main .*operator_array_new_with_dtor_left_oob.cpp}}:[[@LINE-13]]
delete [] buffer;
}
delete (x + 1);
// CHECK: AddressSanitizer: attempting free on address which was not malloc()-ed
// CHECK: {{#0 0x.* operator delete}}
-// CHECK: {{#1 .* main .*operator_delete_wrong_argument.cc}}:[[@LINE-3]]
+// CHECK: {{#1 .* main .*operator_delete_wrong_argument.cpp}}:[[@LINE-3]]
}
buffer[-1] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK: {{#0 .* main .*operator_new_left_oob.cc}}:[[@LINE-3]]
+// CHECK: {{#0 .* main .*operator_new_left_oob.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 1 bytes to the left of 1-byte region
// CHECK: allocated by thread T0 here:
// CHECK: {{#0 .* operator new}}
-// CHECK: {{#1 .* main .*operator_new_left_oob.cc}}:[[@LINE-8]]
+// CHECK: {{#1 .* main .*operator_new_left_oob.cpp}}:[[@LINE-8]]
delete buffer;
}
buffer[1] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK: {{#0 .* main .*operator_new_right_oob.cc}}:[[@LINE-3]]
+// CHECK: {{#0 .* main .*operator_new_right_oob.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes to the right of 1-byte region
// CHECK: allocated by thread T0 here:
// CHECK: {{#0 .* operator new}}
-// CHECK: {{#1 .* main .*operator_new_right_oob.cc}}:[[@LINE-8]]
+// CHECK: {{#1 .* main .*operator_new_right_oob.cpp}}:[[@LINE-8]]
delete buffer;
}
*buffer = 42;
// CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK: {{#0 .* main .*operator_new_uaf.cc}}:[[@LINE-3]]
+// CHECK: {{#0 .* main .*operator_new_uaf.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes inside of 1-byte region
// CHECK-LABEL: freed by thread T0 here:
// CHECK: {{#0 .* operator delete}}
-// CHECK: {{#1 .* main .*operator_new_uaf.cc}}:[[@LINE-8]]
+// CHECK: {{#1 .* main .*operator_new_uaf.cpp}}:[[@LINE-8]]
// CHECK-LABEL: previously allocated by thread T0 here:
// CHECK: {{#0 .* operator new}}
-// CHECK: {{#1 .* main .*operator_new_uaf.cc}}:[[@LINE-12]]
+// CHECK: {{#1 .* main .*operator_new_uaf.cpp}}:[[@LINE-12]]
return 0;
}
stack_buffer[subscript] = 42;
// CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T{{[0-9]+}}
- // CHECK: {{#0 .* work_item.*queue_user_work_item_report.cc}}:[[@LINE-3]]
+ // CHECK: {{#0 .* work_item.*queue_user_work_item_report.cpp}}:[[@LINE-3]]
SetEvent(done);
return 0;
}
buffer[-1] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*realloc_left_oob.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*realloc_left_oob.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
// CHECK: allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* realloc }}
-// CHECK-NEXT: {{#1 .* main .*realloc_left_oob.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*realloc_left_oob.cpp}}:[[@LINE-8]]
free(buffer);
}
buffer[42] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*realloc_right_oob.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*realloc_right_oob.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes to the right of 42-byte region
// CHECK: allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* realloc }}
-// CHECK-NEXT: {{#1 .* main .*realloc_right_oob.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*realloc_right_oob.cpp}}:[[@LINE-8]]
free(buffer);
}
buffer[0] = 42;
// CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*realloc_uaf.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*realloc_uaf.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes inside of 42-byte region
// CHECK: freed by thread T0 here:
// CHECK-NEXT: {{#0 .* free }}
-// CHECK-NEXT: {{#1 .* main .*realloc_uaf.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*realloc_uaf.cpp}}:[[@LINE-8]]
// CHECK: previously allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* realloc }}
-// CHECK-NEXT: {{#1 .* main .*realloc_uaf.cc}}:[[@LINE-12]]
+// CHECK-NEXT: {{#1 .* main .*realloc_uaf.cpp}}:[[@LINE-12]]
}
// CHECK: Hint: address points to the zero page.
// CHECK: {{WARNING: .*DbgHelp}}
// CHECK: {{WARNING: Failed to use and restart external symbolizer}}
- // CHECK: {{#0 0x.* in main.*report_after_syminitialize.cc:}}[[@LINE-6]]
+ // CHECK: {{#0 0x.* in main.*report_after_syminitialize.cpp:}}[[@LINE-6]]
// CHECK: AddressSanitizer can not provide additional info.
}
// CHECK: =={{[0-9:]+}}==ASan shadow was supposed to be located in the [0x2fff0000-0x3fffffff] range.
// CHECK: =={{[0-9:]+}}==Dumping process modules
-// CHECK-DAG: {{0x30000000-0x300.....}} {{.*}}\shadow_conflict_32.cc.tmp_dll.dll
-// CHECK-DAG: {{0x........-0x........}} {{.*}}\shadow_conflict_32.cc.tmp.exe
+// CHECK-DAG: {{0x30000000-0x300.....}} {{.*}}\shadow_conflict_32.cpp.tmp_dll.dll
+// CHECK-DAG: {{0x........-0x........}} {{.*}}\shadow_conflict_32.cpp.tmp.exe
// CHECK-DAG: {{0x........-0x........}} {{.*}}\ntdll.dll
buffer[subscript] = 42;
// CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*stack_array_left_oob.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*stack_array_left_oob.cpp}}:[[@LINE-3]]
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame
-// CHECK-NEXT: {{#0 .* main .*stack_array_left_oob.cc}}
+// CHECK-NEXT: {{#0 .* main .*stack_array_left_oob.cpp}}
// CHECK: 'buffer'{{.*}} <== Memory access at offset [[OFFSET]] underflows this variable
}
buffer[subscript] = 42;
// CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*stack_array_right_oob.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*stack_array_right_oob.cpp}}:[[@LINE-3]]
// CHECK: Address [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:.*]] in frame
-// CHECK-NEXT: {{#0 .* main .*stack_array_right_oob.cc}}
+// CHECK-NEXT: {{#0 .* main .*stack_array_right_oob.cpp}}
// CHECK: 'buffer'{{.*}} <== Memory access at offset [[OFFSET]] overflows this variable
}
*x = 42;
// CHECK: AddressSanitizer: stack-use-after-return
// CHECK: WRITE of size 1 at {{.*}} thread T0
-// CHECK-NEXT: {{#0 0x.* in main .*stack_use_after_return.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 0x.* in main .*stack_use_after_return.cpp}}:[[@LINE-3]]
//
// CHECK: is located in stack of thread T0 at offset [[OFFSET:.*]] in frame
-// CHECK-NEXT: {{#0 0x.* in foo.*stack_use_after_return.cc}}
+// CHECK-NEXT: {{#0 0x.* in foo.*stack_use_after_return.cpp}}
//
// CHECK: 'stack_buffer'{{.*}} <== Memory access at offset [[OFFSET]] is inside this variable
}
buffer[-1] = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*symbols_path.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*symbols_path.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
// CHECK: allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* malloc}}
-// CHECK-NEXT: {{#1 .* main .*symbols_path.cc}}:[[@LINE-8]]
+// CHECK-NEXT: {{#1 .* main .*symbols_path.cpp}}:[[@LINE-8]]
free(buffer);
}
stack_buffer[subscript] = 42;
// CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T1
-// CHECK: {{#0 .* thread_proc.*thread_stack_array_left_oob.cc}}:[[@LINE-3]]
+// CHECK: {{#0 .* thread_proc.*thread_stack_array_left_oob.cpp}}:[[@LINE-3]]
// CHECK: Address [[ADDR]] is located in stack of thread T1 at offset {{.*}} in frame
// CHECK: thread_proc
return 0;
int main() {
HANDLE thr = CreateThread(NULL, 0, thread_proc, NULL, 0, NULL);
// CHECK: Thread T1 created by T0 here:
-// CHECK: {{#[01] .* main .*thread_stack_array_left_oob.cc}}:[[@LINE-2]]
+// CHECK: {{#[01] .* main .*thread_stack_array_left_oob.cpp}}:[[@LINE-2]]
// A failure to create a thread should fail the test!
if (thr == 0) return 0;
stack_buffer[subscript] = 42;
// CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T1
-// CHECK: {{#0 .* thread_proc.*thread_stack_array_right_oob.cc}}:[[@LINE-3]]
+// CHECK: {{#0 .* thread_proc.*thread_stack_array_right_oob.cpp}}:[[@LINE-3]]
// CHECK: Address [[ADDR]] is located in stack of thread T1 at offset {{.*}} in frame
// CHECK: thread_proc
return 0;
int main(void) {
HANDLE thr = CreateThread(NULL, 0, thread_proc, NULL, 0, NULL);
// CHECK: Thread T1 created by T0 here:
-// CHECK: {{#[01] .* main .*thread_stack_array_right_oob.cc}}:[[@LINE-2]]
+// CHECK: {{#[01] .* main .*thread_stack_array_right_oob.cpp}}:[[@LINE-2]]
// A failure to create a thread should fail the test!
if (thr == 0) return 0;
free(x);
return x[5];
// CHECK: AddressSanitizer: heap-use-after-free
- // CHECK: #0 {{0x[a-f0-9]+ \(.*[\\/]unsymbolized.cc.*.exe\+(0x40|0x14000)[a-f0-9]{4}\)}}
- // CHECK: #1 {{0x[a-f0-9]+ \(.*[\\/]unsymbolized.cc.*.exe\+(0x40|0x14000)[a-f0-9]{4}\)}}
+ // CHECK: #0 {{0x[a-f0-9]+ \(.*[\\/]unsymbolized.cpp.*.exe\+(0x40|0x14000)[a-f0-9]{4}\)}}
+ // CHECK: #1 {{0x[a-f0-9]+ \(.*[\\/]unsymbolized.cpp.*.exe\+(0x40|0x14000)[a-f0-9]{4}\)}}
}
stale[0] = 42;
// CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 1 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 .* main .*use_after_realloc.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 .* main .*use_after_realloc.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes inside of 32-byte region
// CHECK: freed by thread T0 here:
// CHECK-NEXT: {{#0 .* realloc }}
-// CHECK-NEXT: {{#1 .* main .*use_after_realloc.cc}}:[[@LINE-9]]
+// CHECK-NEXT: {{#1 .* main .*use_after_realloc.cpp}}:[[@LINE-9]]
// CHECK: previously allocated by thread T0 here:
// CHECK-NEXT: {{#0 .* realloc }}
-// CHECK-NEXT: {{#1 .* main .*use_after_realloc.cc}}:[[@LINE-14]]
+// CHECK-NEXT: {{#1 .* main .*use_after_realloc.cpp}}:[[@LINE-14]]
free(buffer);
}
c->extra_field = 42;
// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 4 at [[ADDR]] thread T0
-// CHECK: {{#0 0x[0-9a-f]* in main .*wrong_downcast_on_heap.cc}}:[[@LINE-3]]
+// CHECK: {{#0 0x[0-9a-f]* in main .*wrong_downcast_on_heap.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located 0 bytes to the right of 4-byte region
// CHECK: allocated by thread T0 here:
// CHECK: #0 {{.*}} operator new
c->extra_field = 42;
// CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
// CHECK: WRITE of size 4 at [[ADDR]] thread T0
-// CHECK-NEXT: {{#0 0x[0-9a-f]* in main .*wrong_downcast_on_stack.cc}}:[[@LINE-3]]
+// CHECK-NEXT: {{#0 0x[0-9a-f]* in main .*wrong_downcast_on_stack.cpp}}:[[@LINE-3]]
// CHECK: [[ADDR]] is located in stack of thread T0 at offset [[OFFSET:[0-9]+]] in frame
// CHECK-NEXT: {{#0 0x[0-9a-f]* in main }}
// CHECK: 'p'{{.*}} <== Memory access at offset [[OFFSET]] overflows this variable
// RUN: echo "fun:*brokenFunction*" > %tmp
// RUN: echo "global:*badGlobal*" >> %tmp
-// RUN: echo "src:*blacklist-extra.cc" >> %tmp
+// RUN: echo "src:*blacklist-extra.cpp" >> %tmp
// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O0 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1
+// RUN: %p/Helpers/blacklist-extra.cpp && %run %t 2>&1
// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O1 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1
+// RUN: %p/Helpers/blacklist-extra.cpp && %run %t 2>&1
// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O2 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1
+// RUN: %p/Helpers/blacklist-extra.cpp && %run %t 2>&1
// RUN: %clangxx_asan -fsanitize-blacklist=%tmp -O3 %s -o %t \
-// RUN: %p/Helpers/blacklist-extra.cc && %run %t 2>&1
+// RUN: %p/Helpers/blacklist-extra.cpp && %run %t 2>&1
// badGlobal is accessed improperly, but we blacklisted it. Align
// it to make sure memory past the end of badGlobal will be in
return x[argc * 10]; // BOOM
}
-// This function is defined in Helpers/blacklist-extra.cc, a source file which
+// This function is defined in Helpers/blacklist-extra.cpp, a source file which
// is blacklisted by name
int externalBrokenFunction(int x);
void *p = calloc(-1, 1000);
// CHECK: {{ERROR: AddressSanitizer: calloc parameters overflow: count \* size \(.* \* 1000\) cannot be represented in type size_t}}
// CHECK: {{#0 0x.* in .*calloc}}
- // CHECK: {{#1 0x.* in main .*calloc-overflow.cc:}}[[@LINE-3]]
+ // CHECK: {{#1 0x.* in main .*calloc-overflow.cpp:}}[[@LINE-3]]
// CHECK: SUMMARY: AddressSanitizer: calloc-overflow
printf("calloc returned: %zu\n", (size_t)p);
free(x + argc - 1); // BOOM
// CHECK: AddressSanitizer: attempting double-free{{.*}}in thread T0
// CHECK: #0 0x{{.*}} in {{.*}}free
- // CHECK: #1 0x{{.*}} in main {{.*}}double-free.cc:[[@LINE-3]]
+ // CHECK: #1 0x{{.*}} in main {{.*}}double-free.cpp:[[@LINE-3]]
// CHECK: freed by thread T0 here:
// MALLOC-CTX: #0 0x{{.*}} in {{.*}}free
- // MALLOC-CTX: #1 0x{{.*}} in main {{.*}}double-free.cc:[[@LINE-7]]
+ // MALLOC-CTX: #1 0x{{.*}} in main {{.*}}double-free.cpp:[[@LINE-7]]
// CHECK: allocated by thread T0 here:
- // MALLOC-CTX: double-free.cc:[[@LINE-12]]
+ // MALLOC-CTX: double-free.cpp:[[@LINE-12]]
// CHECK-RECOVER: AddressSanitizer: attempting double-free{{.*}}in thread T0
// CHECK-RECOVER-NOT: AddressSanitizer CHECK failed:
return res;
};
int global[10];
-// GLOB: 0x{{.*}} is located 4 bytes to the right of global variable 'global' defined in '{{.*}}global-location.cc:[[@LINE-1]]:5' {{.*}} of size 40
+// GLOB: 0x{{.*}} is located 4 bytes to the right of global variable 'global' defined in '{{.*}}global-location.cpp:[[@LINE-1]]:5' {{.*}} of size 40
int C::array[10];
-// CLASS_STATIC: 0x{{.*}} is located 4 bytes to the right of global variable 'C::array' defined in '{{.*}}global-location.cc:[[@LINE-1]]:8' {{.*}} of size 40
+// CLASS_STATIC: 0x{{.*}} is located 4 bytes to the right of global variable 'C::array' defined in '{{.*}}global-location.cpp:[[@LINE-1]]:8' {{.*}} of size 40
int main(int argc, char **argv) {
int one = argc - 1;
case 'c': return C::array[one * 11];
case 'f':
static int array[10];
- // FUNC_STATIC: 0x{{.*}} is located 4 bytes to the right of global variable 'array' defined in '{{.*}}global-location.cc:[[@LINE-1]]:16' {{.*}} of size 40
+ // FUNC_STATIC: 0x{{.*}} is located 4 bytes to the right of global variable 'array' defined in '{{.*}}global-location.cpp:[[@LINE-1]]:16' {{.*}} of size 40
memset(array, 0, 10);
return array[one * 11];
case 'l':
const char *str = "0123456789";
- // LITERAL: 0x{{.*}} is located 0 bytes to the right of global variable {{.*}} defined in '{{.*}}global-location.cc:[[@LINE-1]]:23' {{.*}} of size 11
+ // LITERAL: 0x{{.*}} is located 0 bytes to the right of global variable {{.*}} defined in '{{.*}}global-location.cpp:[[@LINE-1]]:23' {{.*}} of size 11
return str[one * 11];
}
return 0;
memset(ZZZ, 0, 10);
int res = YYY[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in main .*global-overflow.cc:}}[[@LINE-2]]
+ // CHECK: {{ #0 0x.* in main .*global-overflow.cpp:}}[[@LINE-2]]
// CHECK: {{0x.* is located 0 bytes to the right of global variable}}
// CHECK: {{.*YYY.* of size 10}}
res += XXX[argc] + ZZZ[argc];
+++ /dev/null
-// RUN: %clangxx_asan -O0 %s %p/Helpers/underflow.cc -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O1 %s %p/Helpers/underflow.cc -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O2 %s %p/Helpers/underflow.cc -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s %p/Helpers/underflow.cc -o %t && not %run %t 2>&1 | FileCheck %s
-
-int XXX[2] = {2, 3};
-extern int YYY[];
-#include <string.h>
-int main(int argc, char **argv) {
- memset(XXX, 0, 2*sizeof(int));
- // CHECK: {{READ of size 4 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in main .*global-underflow.cc:}}[[@LINE+3]]
- // CHECK: {{0x.* is located 4 bytes to the left of global variable}}
- // CHECK: {{.*YYY.* of size 12}}
- int res = YYY[-1];
- return res;
-}
--- /dev/null
+// RUN: %clangxx_asan -O0 %s %p/Helpers/underflow.cpp -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O1 %s %p/Helpers/underflow.cpp -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O2 %s %p/Helpers/underflow.cpp -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s %p/Helpers/underflow.cpp -o %t && not %run %t 2>&1 | FileCheck %s
+
+int XXX[2] = {2, 3};
+extern int YYY[];
+#include <string.h>
+int main(int argc, char **argv) {
+ memset(XXX, 0, 2*sizeof(int));
+ // CHECK: {{READ of size 4 at 0x.* thread T0}}
+ // CHECK: {{ #0 0x.* in main .*global-underflow.cpp:}}[[@LINE+3]]
+ // CHECK: {{0x.* is located 4 bytes to the left of global variable}}
+ // CHECK: {{.*YYY.* of size 12}}
+ int res = YYY[-1];
+ return res;
+}
memset(x, 0, 10);
int res = x[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in main .*heap-overflow.cc:}}[[@LINE-2]]
+ // CHECK: {{ #0 0x.* in main .*heap-overflow.cpp:}}[[@LINE-2]]
// CHECK: {{0x.* is located 0 bytes to the right of 10-byte region}}
// CHECK: {{allocated by thread T0 here:}}
stale_stack[100]++;
// CHECK: ERROR: AddressSanitizer: stack-use-after-return on address
// CHECK: is located in stack of thread T0 at offset {{116|132}} in frame
- // CHECK: in LeakStack{{.*}}heavy_uar_test.cc:
+ // CHECK: in LeakStack{{.*}}heavy_uar_test.cpp:
// CHECK: [{{16|32}}, {{1040|1056}}) 'x'
return 0;
}
// (3) destructor of A reads uninitialized global C from another module.
// We do *not* want to report init-order bug in this case.
-// RUN: %clangxx_asan -O0 %s %p/Helpers/init-order-atexit-extra.cc -o %t
+// RUN: %clangxx_asan -O0 %s %p/Helpers/init-order-atexit-extra.cpp -o %t
// RUN: %env_asan_opts=strict_init_order=true not %run %t 2>&1 | FileCheck %s
#include <stdio.h>
// Test for blacklist functionality of initialization-order checker.
-// RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-blacklist-extra.cc\
-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
+// RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-blacklist-extra.cpp\
+// RUN: %p/Helpers/initialization-blacklist-extra2.cpp \
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
-// RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-blacklist-extra.cc\
-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
+// RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-blacklist-extra.cpp\
+// RUN: %p/Helpers/initialization-blacklist-extra2.cpp \
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
-// RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-blacklist-extra.cc\
-// RUN: %p/Helpers/initialization-blacklist-extra2.cc \
+// RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-blacklist-extra.cpp\
+// RUN: %p/Helpers/initialization-blacklist-extra2.cpp \
// RUN: -fsanitize-blacklist=%p/Helpers/initialization-blacklist.txt -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
// Test to make sure basic initialization order errors are caught.
-// RUN: %clangxx_asan %macos_min_target_10_11 -O0 %s %p/Helpers/initialization-bug-extra2.cc -o %t-INIT-ORDER-EXE
+// RUN: %clangxx_asan %macos_min_target_10_11 -O0 %s %p/Helpers/initialization-bug-extra2.cpp -o %t-INIT-ORDER-EXE
// RUN: %env_asan_opts=check_initialization_order=true not %run %t-INIT-ORDER-EXE 2>&1 | FileCheck %s
// Do not test with optimization -- the error may be optimized away.
// constructor implies that it was initialized during constant initialization,
// not dynamic initialization).
-// RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t
+// RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
-// RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t
+// RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
-// RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t
+// RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
-// RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-constexpr-extra.cc --std=c++11 -o %t
+// RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-constexpr-extra.cpp --std=c++11 -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
class Integer {
// A collection of various initializers which shouldn't trip up initialization
// order checking. If successful, this will just return 0.
-// RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-nobug-extra.cc -o %t
+// RUN: %clangxx_asan -O0 %s %p/Helpers/initialization-nobug-extra.cpp -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
-// RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-nobug-extra.cc -o %t
+// RUN: %clangxx_asan -O1 %s %p/Helpers/initialization-nobug-extra.cpp -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
-// RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-nobug-extra.cc -o %t
+// RUN: %clangxx_asan -O2 %s %p/Helpers/initialization-nobug-extra.cpp -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
-// RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-nobug-extra.cc -o %t
+// RUN: %clangxx_asan -O3 %s %p/Helpers/initialization-nobug-extra.cpp -o %t
// RUN: %env_asan_opts=check_initialization_order=true %run %t 2>&1
// Simple access:
}
void set(int i, int val) { a[i] = val; }
// CHECK: ERROR: AddressSanitizer: intra-object-overflow
-// CHECK: #0 {{.*}}Foo::set{{.*}}intra-object-overflow.cc:[[@LINE-2]]
+// CHECK: #0 {{.*}}Foo::set{{.*}}intra-object-overflow.cpp:[[@LINE-2]]
private:
int pre1, pre2;
int a[11];
int idx = argc == 2 ? atoi(argv[1]) : 0;
Foo *foo = new Foo;
foo->set(idx, 42);
-// CHECK: #1 {{.*}}main{{.*}}intra-object-overflow.cc:[[@LINE-1]]
+// CHECK: #1 {{.*}}main{{.*}}intra-object-overflow.cpp:[[@LINE-1]]
// CHECK: is located 84 bytes inside of 128-byte region
delete foo;
}
int res = x[argc];
free(x + 5); // BOOM
// CHECK: AddressSanitizer: attempting free on address{{.*}}in thread T0
- // CHECK: invalid-free.cc:[[@LINE-2]]
+ // CHECK: invalid-free.cpp:[[@LINE-2]]
// CHECK: is located 5 bytes inside of 10-byte region
// CHECK: allocated by thread T0 here:
- // MALLOC-CTX: invalid-free.cc:[[@LINE-8]]
+ // MALLOC-CTX: invalid-free.cpp:[[@LINE-8]]
return res;
}
char *heap2 = (char *)malloc(42);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(heap1, heap2);
free(heap1);
free(heap2);
heap1 = (char *)malloc(1024);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(heap1, heap1 + 1025);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(heap1 + 1024, heap1 + 1025);
free(heap1);
heap1 = (char *)malloc(4096);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(heap1, heap1 + 4097);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(heap1, 0);
// Global variables.
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(&global1[0], &global2[10]);
char *p = &small_global[0];
foo(p, p); // OK
foo(p, p + 7); // OK
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(p, p + 8);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(p - 1, p);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(p, p - 1);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(p - 1, p + 8);
p = &large_global[0];
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(p - 1, p);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(p, p - 1);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(p, &global1[0]);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(p, &small_global[0]);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(p, 0);
// Stack variables.
char stack1, stack2;
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(&stack1, &stack2);
// Mixtures.
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(heap1, &stack1);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
foo(heap1, &global1[0]);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
foo(&stack1, &global1[0]);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-compare-errors.cpp:[[@LINE+1]]
foo(&stack1, 0);
free(heap1);
char *heap2 = (char *)malloc(42);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cpp:[[@LINE+1]]
foo(heap1, heap2);
// Global variables.
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cpp:[[@LINE+1]]
foo(&global1[0], &global2[10]);
// Stack variables.
char stack1, stack2;
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cpp:[[@LINE+1]]
foo(&stack1, &stack2);
// Mixtures.
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cpp:[[@LINE+1]]
foo(heap1, &stack1);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cpp:[[@LINE+1]]
foo(heap1, &global1[0]);
// CHECK: ERROR: AddressSanitizer: invalid-pointer-pair
- // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cc:[[@LINE+1]]
+ // CHECK: #{{[0-9]+ .*}} in main {{.*}}invalid-pointer-pairs-subtract-errors.cpp:[[@LINE+1]]
foo(&stack1, &global1[0]);
free(heap1);
// [[PTR1:0x[0-9a-f]+]] [[PTR2:0x[0-9a-f]+]]
switch (c) {
case 'g':
- // CMP: #{{[0-9]+ .*}} in f({{char, char\*, char\*|char,char \*,char \*}}) {{.*}}invalid-pointer-pairs.cc:[[@LINE+1]]
+ // CMP: #{{[0-9]+ .*}} in f({{char, char\*, char\*|char,char \*,char \*}}) {{.*}}invalid-pointer-pairs.cpp:[[@LINE+1]]
return p > q;
case 's':
- // SUB: #{{[0-9]+ .*}} in f({{char, char\*, char\*|char,char \*,char \*}}) {{.*}}invalid-pointer-pairs.cc:[[@LINE+1]]
+ // SUB: #{{[0-9]+ .*}} in f({{char, char\*, char\*|char,char \*,char \*}}) {{.*}}invalid-pointer-pairs.cpp:[[@LINE+1]]
return p - q;
case 'k': {
// OK-NOT: ERROR
case 'f': {
char *p3 = p + 20;
free(p);
- // FREE: #{{[0-9]+ .*}} in f({{char, char\*, char\*|char,char \*,char \*}}) {{.*}}invalid-pointer-pairs.cc:[[@LINE+2]]
+ // FREE: #{{[0-9]+ .*}} in f({{char, char\*, char\*|char,char \*,char \*}}) {{.*}}invalid-pointer-pairs.cpp:[[@LINE+2]]
// FREE: freed by thread
return p < p3;
}
x[zero + 103]++; // we should report this exact line
// atos incorrectly extracts the symbol name for the static functions on
// Darwin.
- // CHECK-Linux: {{#0 0x.* in LargeFunction.*large_func_test.cc:}}[[@LINE-3]]
- // CHECK-Darwin: {{#0 0x.* in .*LargeFunction.*large_func_test.cc}}:[[@LINE-4]]
+ // CHECK-Linux: {{#0 0x.* in LargeFunction.*large_func_test.cpp:}}[[@LINE-3]]
+ // CHECK-Darwin: {{#0 0x.* in .*LargeFunction.*large_func_test.cpp}}:[[@LINE-4]]
x[10]++;
x[11]++;
int main(int argc, char **argv) {
int *x = new int[100];
LargeFunction(x, argc - 1);
- // CHECK: {{ #1 0x.* in main .*large_func_test.cc:}}[[@LINE-1]]
+ // CHECK: {{ #1 0x.* in main .*large_func_test.cpp:}}[[@LINE-1]]
// CHECK: {{0x.* is located 12 bytes to the right of 400-byte region}}
// CHECK: {{allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in operator new.*}}
// CHECK-Darwin: {{ #0 0x.* in .*_Zna.*}}
- // CHECK: {{ #1 0x.* in main .*large_func_test.cc:}}[[@LINE-7]]
+ // CHECK: {{ #1 0x.* in main .*large_func_test.cpp:}}[[@LINE-7]]
delete[] x;
}
void *p = malloc(kMaxAllowedMallocSizePlusOne);
// CHECK: {{ERROR: AddressSanitizer: requested allocation size .* \(.* after adjustments for alignment, red zones etc\.\) exceeds maximum supported size}}
// CHECK: {{#0 0x.* in .*malloc}}
- // CHECK: {{#1 0x.* in main .*malloc-size-too-big.cc:}}[[@LINE-3]]
+ // CHECK: {{#1 0x.* in main .*malloc-size-too-big.cpp:}}[[@LINE-3]]
// CHECK: SUMMARY: AddressSanitizer: allocation-size-too-big
printf("malloc returned: %zu\n", (size_t)p);
// TWO: previously allocated by thread T{{.*}} here:
// TWO-NEXT: #0 0x{{.*}}
- // TWO-NEXT: #1 0x{{.*}} in main {{.*}}malloc_context_size.cc
+ // TWO-NEXT: #1 0x{{.*}} in main {{.*}}malloc_context_size.cpp
// TWO: SUMMARY: AddressSanitizer: heap-use-after-free
}
ptr[10]++; // BOOM
// atos on Mac cannot extract the symbol name correctly. Also, on FreeBSD 9.2
// the demangling function rejects local names with 'L' in front of them.
- // CHECK: {{ #0 0x.* in .*NullDeref.*null_deref.cc}}
+ // CHECK: {{ #0 0x.* in .*NullDeref.*null_deref.cpp}}
}
int main() {
NullDeref((int*)0);
- // CHECK: {{ #1 0x.* in main.*null_deref.cc}}
+ // CHECK: {{ #1 0x.* in main.*null_deref.cpp}}
// CHECK: AddressSanitizer can not provide additional info.
}
delete[] x;
return x[0];
// SOURCE: ERROR: AddressSanitizer: heap-use-after-free
- // SOURCE: SUMMARY: AddressSanitizer: heap-use-after-free {{.*}}print_summary.cc:[[@LINE-2]]{{.*}} main
+ // SOURCE: SUMMARY: AddressSanitizer: heap-use-after-free {{.*}}print_summary.cpp:[[@LINE-2]]{{.*}} main
// MODULE: ERROR: AddressSanitizer: heap-use-after-free
// MODULE: SUMMARY: AddressSanitizer: heap-use-after-free ({{.*}}+0x{{.*}})
// MISSING: ERROR: AddressSanitizer: heap-use-after-free
memset(x, 0, 10);
int res = x[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in main .*stack-buffer-overflow.cc:}}[[@LINE-2]]
+ // CHECK: {{ #0 0x.* in main .*stack-buffer-overflow.cpp:}}[[@LINE-2]]
// CHECK: {{Address 0x.* is located in stack of thread T0 at offset}}
- // CHECK-NEXT: in{{.*}}main{{.*}}stack-buffer-overflow.cc
+ // CHECK-NEXT: in{{.*}}main{{.*}}stack-buffer-overflow.cpp
return res;
}
// CHECK: strcat-param-overlap: memory ranges
// CHECK: [{{0x.*,[ ]*0x.*}}) and [{{0x.*,[ ]*0x.*}}) overlap
// CHECK: {{#0 0x.* in .*strcat}}
- // CHECK: {{#1 0x.* in bad_function.*strcat-overlap.cc:}}[[@LINE+2]]
- // CHECK: {{#2 0x.* in main .*strcat-overlap.cc:}}[[@LINE+5]]
+ // CHECK: {{#1 0x.* in bad_function.*strcat-overlap.cpp:}}[[@LINE+2]]
+ // CHECK: {{#2 0x.* in main .*strcat-overlap.cpp:}}[[@LINE+5]]
strcat(buffer, buffer + 1); // BOOM
}
// CHECK: strcpy-param-overlap: memory ranges
// CHECK: [{{0x.*,[ ]*0x.*}}) and [{{0x.*,[ ]*0x.*}}) overlap
// CHECK: {{#0 0x.* in .*strcpy}}
- // CHECK: {{#1 0x.* in bad_function.*strcpy-overlap.cc:}}[[@LINE+2]]
- // CHECK: {{#2 0x.* in main .*strcpy-overlap.cc:}}[[@LINE+5]]
+ // CHECK: {{#1 0x.* in bad_function.*strcpy-overlap.cpp:}}[[@LINE+2]]
+ // CHECK: {{#2 0x.* in main .*strcpy-overlap.cpp:}}[[@LINE+5]]
strcpy(buffer, buffer + 1); // BOOM
}
char *copy = strdup(kString);
int x = copy[4 + argc]; // BOOM
// CHECK: AddressSanitizer: heap-buffer-overflow
- // CHECK: #0 {{.*}}main {{.*}}strdup_oob_test.cc:[[@LINE-2]]
+ // CHECK: #0 {{.*}}main {{.*}}strdup_oob_test.cpp:[[@LINE-2]]
// CHECK-LABEL: allocated by thread T{{.*}} here:
// CHECK: #{{[01]}} {{.*}}strdup
- // CHECK: #{{.*}}main {{.*}}strdup_oob_test.cc:[[@LINE-6]]
+ // CHECK: #{{.*}}main {{.*}}strdup_oob_test.cpp:[[@LINE-6]]
// CHECK-LABEL: SUMMARY
- // CHECK: strdup_oob_test.cc:[[@LINE-7]]
+ // CHECK: strdup_oob_test.cpp:[[@LINE-7]]
return x;
}
// CHECK: strncat-param-overlap: memory ranges
// CHECK: [{{0x.*,[ ]*0x.*}}) and [{{0x.*,[ ]*0x.*}}) overlap
// CHECK: {{#0 0x.* in .*strncat}}
- // CHECK: {{#1 0x.* in bad_function.*strncat-overlap.cc:}}[[@LINE+2]]
- // CHECK: {{#2 0x.* in main .*strncat-overlap.cc:}}[[@LINE+5]]
+ // CHECK: {{#1 0x.* in bad_function.*strncat-overlap.cpp:}}[[@LINE+2]]
+ // CHECK: {{#2 0x.* in main .*strncat-overlap.cpp:}}[[@LINE+5]]
strncat(buffer, buffer + 1, 3); // BOOM
}
// CHECK: {{WRITE of size 10 at 0x.* thread T0}}
// CHECK-Linux: {{ #0 0x.* in .*strncpy}}
// CHECK-Darwin: {{ #0 0x.* in wrap_strncpy}}
- // CHECK: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-4]]
+ // CHECK: {{ #1 0x.* in main .*strncpy-overflow.cpp:}}[[@LINE-4]]
// CHECK: {{0x.* is located 0 bytes to the right of 9-byte region}}
// CHECK: {{allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*malloc}}
- // CHECK-Linux: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-10]]
+ // CHECK-Linux: {{ #1 0x.* in main .*strncpy-overflow.cpp:}}[[@LINE-10]]
// CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}}
- // CHECK-Darwin: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-13]]
+ // CHECK-Darwin: {{ #1 0x.* in main .*strncpy-overflow.cpp:}}[[@LINE-13]]
return short_buffer[8];
}
// CHECK: strncpy-param-overlap: memory ranges
// CHECK: [{{0x.*,[ ]*0x.*}}) and [{{0x.*,[ ]*0x.*}}) overlap
// CHECK: {{#0 0x.* in .*strncpy}}
- // CHECK: {{#1 0x.* in bad_function.*strncpy-overlap.cc:}}[[@LINE+2]]
- // CHECK: {{#2 0x.* in main .*strncpy-overlap.cc:}}[[@LINE+5]]
+ // CHECK: {{#1 0x.* in bad_function.*strncpy-overlap.cpp:}}[[@LINE+2]]
+ // CHECK: {{#2 0x.* in main .*strncpy-overlap.cpp:}}[[@LINE+5]]
strncpy(buffer, buffer + 1, 5); // BOOM
}
switch (argv[1][0]) {
case 'A': res = __sanitizer_unaligned_load16(x + 15); break;
// CHECK-A ERROR: AddressSanitizer: heap-buffer-overflow on address
-// CHECK-A: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-2]]
+// CHECK-A: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-2]]
// CHECK-A: is located 0 bytes to the right of 16-byte region
case 'B': res = __sanitizer_unaligned_load32(x + 14); break;
-// CHECK-B: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
+// CHECK-B: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-1]]
case 'C': res = __sanitizer_unaligned_load32(x + 13); break;
-// CHECK-C: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
+// CHECK-C: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-1]]
case 'D': res = __sanitizer_unaligned_load64(x + 15); break;
-// CHECK-D: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
+// CHECK-D: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-1]]
case 'E': res = __sanitizer_unaligned_load64(x + 9); break;
-// CHECK-E: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
+// CHECK-E: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-1]]
case 'K': __sanitizer_unaligned_store16(x + 15, 0); break;
// CHECK-K ERROR: AddressSanitizer: heap-buffer-overflow on address
-// CHECK-K: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-2]]
+// CHECK-K: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-2]]
// CHECK-K: is located 0 bytes to the right of 16-byte region
case 'L': __sanitizer_unaligned_store32(x + 15, 0); break;
-// CHECK-L: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
+// CHECK-L: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-1]]
case 'M': __sanitizer_unaligned_store32(x + 13, 0); break;
-// CHECK-M: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
+// CHECK-M: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-1]]
case 'N': __sanitizer_unaligned_store64(x + 10, 0); break;
-// CHECK-N: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
+// CHECK-N: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-1]]
case 'O': __sanitizer_unaligned_store64(x + 14, 0); break;
-// CHECK-O: main{{.*}}unaligned_loads_and_stores.cc:[[@LINE-1]]
+// CHECK-O: main{{.*}}unaligned_loads_and_stores.cpp:[[@LINE-1]]
}
delete x;
return res;
// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
// CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in main .*use-after-delete.cc:}}[[@LINE-4]]
+ // CHECK: {{ #0 0x.* in main .*use-after-delete.cpp:}}[[@LINE-4]]
// CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
// CHECK: {{freed by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in operator delete\[\]}}
- // CHECK-Linux: {{ #1 0x.* in main .*use-after-delete.cc:}}[[@LINE-10]]
+ // CHECK-Linux: {{ #1 0x.* in main .*use-after-delete.cpp:}}[[@LINE-10]]
// CHECK: {{previously allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in operator new\[\]}}
- // CHECK-Linux: {{ #1 0x.* in main .*use-after-delete.cc:}}[[@LINE-16]]
+ // CHECK-Linux: {{ #1 0x.* in main .*use-after-delete.cpp:}}[[@LINE-16]]
// CHECK: Shadow byte legend (one shadow byte represents {{[0-9]+}} application bytes):
// CHECK: Global redzone:
// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
// CHECK: {{WRITE of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in main .*use-after-free-right.cc:}}[[@LINE-4]]
+ // CHECK: {{ #0 0x.* in main .*use-after-free-right.cpp:}}[[@LINE-4]]
// CHECK: {{0x.* is located 0 bytes inside of 1-byte region .0x.*,0x.*}}
// CHECK: {{freed by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*free}}
- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-10]]
+ // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cpp:}}[[@LINE-10]]
// CHECK-Darwin: {{ #0 0x.* in wrap_free}}
- // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-13]]
+ // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free-right.cpp:}}[[@LINE-13]]
// CHECK: {{previously allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*malloc}}
- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-19]]
+ // CHECK-Linux: {{ #1 0x.* in main .*use-after-free-right.cpp:}}[[@LINE-19]]
// CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}}
- // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free-right.cc:}}[[@LINE-22]]
+ // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free-right.cpp:}}[[@LINE-22]]
}
// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
// CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in main .*use-after-free.cc:}}[[@LINE-4]]
+ // CHECK: {{ #0 0x.* in main .*use-after-free.cpp:}}[[@LINE-4]]
// CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
// CHECK: {{freed by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*free}}
- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:}}[[@LINE-10]]
+ // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cpp:}}[[@LINE-10]]
// CHECK-Darwin: {{ #0 0x.* in wrap_free}}
- // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free.cc:}}[[@LINE-13]]
+ // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free.cpp:}}[[@LINE-13]]
// CHECK: {{previously allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*malloc}}
- // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cc:}}[[@LINE-19]]
+ // CHECK-Linux: {{ #1 0x.* in main .*use-after-free.cpp:}}[[@LINE-19]]
// CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}}
- // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free.cc:}}[[@LINE-22]]
+ // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free.cpp:}}[[@LINE-22]]
// CHECK: Shadow byte legend (one shadow byte represents {{[0-9]+}} application bytes):
// CHECK: Global redzone:
// CHECK: ASan internal:
__asan_poison_memory_region(x, 16);
int res = x[argc * 10]; // BOOOM
// CHECK: ERROR: AddressSanitizer: use-after-poison
- // CHECK: main{{.*}}use-after-poison.cc:[[@LINE-2]]
+ // CHECK: main{{.*}}use-after-poison.cpp:[[@LINE-2]]
delete [] x;
return res;
}
f = [&x]() {
return x; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in {{.*}}use-after-scope-capture.cc:[[@LINE-2]]
+ // CHECK: #0 0x{{.*}} in {{.*}}use-after-scope-capture.cpp:[[@LINE-2]]
};
}
return f(); // BOOM
~IntHolder() {
printf("Value: %d\n", *val_); // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in IntHolder::~IntHolder{{.*}}.cc:[[@LINE-2]]
+ // CHECK: #0 0x{{.*}} in IntHolder::~IntHolder{{.*}}.cpp:[[@LINE-2]]
}
void set(int *val) { val_ = val; }
int *get() { return val_; }
}
return *p; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in main {{.*}}.cc:[[@LINE-2]]
+ // CHECK: #0 0x{{.*}} in main {{.*}}.cpp:[[@LINE-2]]
}
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
// CHECK: READ of size 4 at 0x{{.*}} thread T0
// CHECK: #0 0x{{.*}} in main
- // CHECK: {{.*}}use-after-scope-inlined.cc:[[@LINE-4]]
+ // CHECK: {{.*}}use-after-scope-inlined.cpp:[[@LINE-4]]
// CHECK: Address 0x{{.*}} is located in stack of thread T0 at offset [[OFFSET:[^ ]*]] in frame
// CHECK: {{.*}} in main
// CHECK: This frame has
}
return *p; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-loop-bug.cc:[[@LINE-2]]
+ // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-loop-bug.cpp:[[@LINE-2]]
// CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame
// {{\[}}[[OFFSET]], {{[0-9]+}}) 'x'
}
}
return *p; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-loop-removed.cc:[[@LINE-2]]
+ // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-loop-removed.cpp:[[@LINE-2]]
// CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame
// {{\[}}[[OFFSET]], {{[0-9]+}}) 'x'
}
}
return **p; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in main {{.*}}.cc:[[@LINE-2]]
+ // CHECK: #0 0x{{.*}} in main {{.*}}.cpp:[[@LINE-2]]
}
save({argc});
int x = saved->val; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cc:[[@LINE-2]]
+ // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cpp:[[@LINE-2]]
return x;
}
saved = &IntHolder().Self();
int x = saved->val; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp2.cc:[[@LINE-2]]
+ // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp2.cpp:[[@LINE-2]]
return x;
}
ptr.Access();
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #{{[0-9]+}} 0x{{.*}} in {{(void )?test.*\((void)?\) .*}}use-after-scope-types.cc
+ // CHECK: #{{[0-9]+}} 0x{{.*}} in {{(void )?test.*\((void)?\) .*}}use-after-scope-types.cpp
// CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame
// {{\[}}[[OFFSET]], {{[0-9]+}}) 'x'
}
}
*p = 5; // BOOM
// CHECK: ERROR: AddressSanitizer: stack-use-after-scope
- // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope.cc:[[@LINE-2]]
+ // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope.cpp:[[@LINE-2]]
// CHECK: Address 0x{{.*}} is located in stack of thread T{{.*}} at offset [[OFFSET:[^ ]+]] in frame
// {{\[}}[[OFFSET]], {{[0-9]+}}) 'x'
return 0;
config.available_features.add('osx-autointerception')
config.available_features.add('osx-ld64-live_support')
else:
- # The ASAN initialization-bug.cc test should XFAIL on OS X systems
+ # The ASAN initialization-bug.cpp test should XFAIL on OS X systems
# older than El Capitan. By marking the test as being unsupported with
# this "feature", we can pass the test on newer OS X versions and other
# platforms.