aboutsummaryrefslogblamecommitdiff
path: root/test/asan/TestCases/Darwin/cstring_section.c
blob: 952d6fcdd46568839b646a7f04b51870ede73869 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                             
// Test that AddressSanitizer moves constant strings into a separate section.

// RUN: %clang_asan -c -o %t %s
// RUN: llvm-objdump -s %t | FileCheck %s

// Check that "Hello.\n" is in __asan_cstring and not in __cstring.
// CHECK: Contents of section __asan_cstring:
// CHECK: 48656c6c {{.*}} Hello.
// CHECK: Contents of section __const:
// CHECK-NOT: 48656c6c {{.*}} Hello.
// CHECK: Contents of section __cstring:
// CHECK-NOT: 48656c6c {{.*}} Hello.

int main(int argc, char *argv[]) {
  argv[0] = "Hello.\n";
  return 0;
}