Home | History | Annotate | Download | only in Driver
      1 // Test AddressSanitizer ld flags.
      2 
      3 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
      4 // RUN:     -target i386-unknown-linux -faddress-sanitizer \
      5 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
      6 // RUN:   | FileCheck --check-prefix=CHECK-LINUX %s
      7 // CHECK-LINUX: "{{.*}}ld{{(.exe)?}}"
      8 // CHECK-LINUX-NOT: "-lc"
      9 // CHECK-LINUX: libclang_rt.asan-i386.a"
     10 // CHECK-LINUX: "-lpthread"
     11 // CHECK-LINUX: "-ldl"
     12 // CHECK-LINUX: "-export-dynamic"
     13 
     14 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
     15 // RUN:     -target arm-linux-androideabi -faddress-sanitizer \
     16 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
     17 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
     18 // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}"
     19 // CHECK-ANDROID-NOT: "-lc"
     20 // CHECK-ANDROID: "-u" "__asan_preinit" "-lasan"
     21 // CHECK-ANDROID: "-lasan_preload" "-ldl"
     22 
     23 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
     24 // RUN:     -target arm-linux-androideabi -faddress-sanitizer \
     25 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
     26 // RUN:     -shared \
     27 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SHARED %s
     28 // CHECK-ANDROID-SHARED: "{{.*}}ld{{(.exe)?}}"
     29 // CHECK-ANDROID-SHARED-NOT: "-lc"
     30 // CHECK-ANDROID-SHARED-NOT: "-lasan"
     31 // CHECK-ANDROID-SHARED: "-lasan_preload" "-ldl"
     32