Home | History | Annotate | Download | only in Linux
      1 // Check the presense of interface symbols in compiled file.
      2 
      3 // RUN: %clang_asan -O2 %s -o %t.exe
      4 // RUN: nm -D %t.exe | grep " T " | sed "s/.* T //" \
      5 // RUN:    | grep "__asan_" | sed "s/___asan_/__asan_/" \
      6 // RUN:    | grep -v "__asan_malloc_hook" \
      7 // RUN:    | grep -v "__asan_free_hook" \
      8 // RUN:    | grep -v "__asan_symbolize" \
      9 // RUN:    | grep -v "__asan_default_options" \
     10 // RUN:    | grep -v "__asan_on_error" > %t.symbols
     11 // RUN: cat %p/../../../asan_interface_internal.h \
     12 // RUN:    | sed "s/\/\/.*//" | sed "s/typedef.*//" \
     13 // RUN:    | grep -v "OPTIONAL" \
     14 // RUN:    | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" \
     15 // RUN:    > %t.interface
     16 // RUN: echo __asan_report_load1 >> %t.interface
     17 // RUN: echo __asan_report_load2 >> %t.interface
     18 // RUN: echo __asan_report_load4 >> %t.interface
     19 // RUN: echo __asan_report_load8 >> %t.interface
     20 // RUN: echo __asan_report_load16 >> %t.interface
     21 // RUN: echo __asan_report_store1 >> %t.interface
     22 // RUN: echo __asan_report_store2 >> %t.interface
     23 // RUN: echo __asan_report_store4 >> %t.interface
     24 // RUN: echo __asan_report_store8 >> %t.interface
     25 // RUN: echo __asan_report_store16 >> %t.interface
     26 // RUN: echo __asan_report_load_n >> %t.interface
     27 // RUN: echo __asan_report_store_n >> %t.interface
     28 // RUN: cat %t.interface | sort -u | diff %t.symbols -
     29 
     30 // FIXME: nm -D on powerpc somewhy shows ASan interface symbols residing
     31 // in "initialized data section".
     32 // REQUIRES: x86_64-supported-target,i386-supported-target
     33 
     34 int main() { return 0; }
     35