1// Test that AddressSanitizer moves constant strings into a separate section.
2
3// RUN: %clang_asan -c -o %t %s
4// RUN: llvm-objdump -s %t | FileCheck %s --implicit-check-not="Hello."
5
6// Check that "Hello.\n" is in __asan_cstring and not in __cstring.
7// CHECK: Contents of section {{.*}}__asan_cstring:
8// CHECK-NEXT: 48656c6c {{.*}} Hello.
9
10int main(int argc, char *argv[]) {
11 argv[0] = "Hello.\n";
12 return 0;
13}
14

Provided by KDAB

Privacy Policy
Improve your Profiling and Debugging skills
Find out more

source code of compiler-rt/test/asan/TestCases/Darwin/cstring_section.c