Index: compiler-rt/trunk/test/asan/TestCases/Darwin/asan_gen_prefixes.cc =================================================================== --- compiler-rt/trunk/test/asan/TestCases/Darwin/asan_gen_prefixes.cc +++ compiler-rt/trunk/test/asan/TestCases/Darwin/asan_gen_prefixes.cc @@ -1,4 +1,4 @@ -// Make sure __asan_gen_* strings have the correct prefixes on Darwin +// Make sure ___asan_gen_* strings have the correct prefixes on Darwin // ("L" in __TEXT,__cstring, "l" in __TEXT,__const // RUN: %clang_asan %s -S -o %t.s @@ -9,8 +9,8 @@ int x, y, z; int main() { return 0; } // CHECK: .section{{.*}}__TEXT,__const -// CHECK: l___asan_gen_ +// CHECK: l____asan_gen_ // CHECK: .section{{.*}}__TEXT,__cstring,cstring_literals -// CHECK: L___asan_gen_ -// CHECK: L___asan_gen_ -// CHECK: L___asan_gen_ +// CHECK: L____asan_gen_ +// CHECK: L____asan_gen_ +// CHECK: L____asan_gen_ Index: compiler-rt/trunk/test/asan/TestCases/Posix/no_asan_gen_globals.c =================================================================== --- compiler-rt/trunk/test/asan/TestCases/Posix/no_asan_gen_globals.c +++ compiler-rt/trunk/test/asan/TestCases/Posix/no_asan_gen_globals.c @@ -1,10 +1,10 @@ // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android -// Make sure __asan_gen_* strings do not end up in the symbol table. +// Make sure ___asan_gen_* strings do not end up in the symbol table. // RUN: %clang_asan %s -o %t.exe // RUN: nm %t.exe | FileCheck %s int x, y, z; int main() { return 0; } -// CHECK-NOT: __asan_gen_ +// CHECK-NOT: ___asan_gen_ Index: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp =================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -153,7 +153,7 @@ static const int kMaxAsanStackMallocSizeClass = 10; static const char *const kAsanStackMallocNameTemplate = "__asan_stack_malloc_"; static const char *const kAsanStackFreeNameTemplate = "__asan_stack_free_"; -static const char *const kAsanGenPrefix = "__asan_gen_"; +static const char *const kAsanGenPrefix = "___asan_gen_"; static const char *const kODRGenPrefix = "__odr_asan_gen_"; static const char *const kSanCovGenPrefix = "__sancov_gen_"; static const char *const kAsanSetShadowPrefix = "__asan_set_shadow_"; Index: llvm/trunk/test/DebugInfo/AArch64/asan-stack-vars.ll =================================================================== --- llvm/trunk/test/DebugInfo/AArch64/asan-stack-vars.ll +++ llvm/trunk/test/DebugInfo/AArch64/asan-stack-vars.ll @@ -73,7 +73,7 @@ @llvm.compiler.used = appending global [12 x i8*] [i8* bitcast (%struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_" to i8*), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_ to i8*), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.1, i32 0, i32 0), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.2 to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @OBJC_METH_VAR_NAME_.3, i32 0, i32 0), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.4 to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_.5, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_CLASS_METHODS_MyObject" to i8*), i8* bitcast ([1 x i8*]* @"OBJC_LABEL_CLASS_$" to i8*)], section "llvm.metadata" @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* null }] @__asan_shadow_memory_dynamic_address = external global i64 -@__asan_gen_ = private unnamed_addr constant [34 x i8] c"2 32 16 9 imageSize 64 8 6 object\00", align 1 +@___asan_gen_ = private unnamed_addr constant [34 x i8] c"2 32 16 9 imageSize 64 8 6 object\00", align 1 ; Function Attrs: noinline sanitize_address ssp uwtable define internal i8* @"\01+[MyObject doWithSize:]"(i8* %self, i8* %_cmd, [2 x double] %imageSize.coerce) #0 !dbg !14 { @@ -91,7 +91,7 @@ store i64 1102416563, i64* %6, !dbg !35 %7 = add i64 %1, 8, !dbg !35 %8 = inttoptr i64 %7 to i64*, !dbg !35 - store i64 ptrtoint ([34 x i8]* @__asan_gen_ to i64), i64* %8, !dbg !35 + store i64 ptrtoint ([34 x i8]* @___asan_gen_ to i64), i64* %8, !dbg !35 %9 = add i64 %1, 16, !dbg !35 %10 = inttoptr i64 %9 to i64*, !dbg !35 store i64 ptrtoint (i8* (i8*, i8*, [2 x double])* @"\01+[MyObject doWithSize:]" to i64), i64* %10, !dbg !35 Index: llvm/trunk/test/DebugInfo/COFF/asan-module-without-functions.ll =================================================================== --- llvm/trunk/test/DebugInfo/COFF/asan-module-without-functions.ll +++ llvm/trunk/test/DebugInfo/COFF/asan-module-without-functions.ll @@ -15,9 +15,9 @@ @c = global { i8, [63 x i8] } { i8 42, [63 x i8] zeroinitializer }, align 32 @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }] -@__asan_gen_ = private constant [7 x i8] c"asan.c\00", align 1 -@__asan_gen_1 = private unnamed_addr constant [2 x i8] c"c\00", align 1 -@0 = internal global [1 x { i32, i32, i32, i32, i32, i32 }] [{ i32, i32, i32, i32, i32, i32 } { i32 ptrtoint ({ i8, [63 x i8] }* @c to i32), i32 1, i32 64, i32 ptrtoint ([2 x i8]* @__asan_gen_1 to i32), i32 ptrtoint ([7 x i8]* @__asan_gen_ to i32), i32 0 }] +@___asan_gen_ = private constant [7 x i8] c"asan.c\00", align 1 +@___asan_gen_1 = private unnamed_addr constant [2 x i8] c"c\00", align 1 +@0 = internal global [1 x { i32, i32, i32, i32, i32, i32 }] [{ i32, i32, i32, i32, i32, i32 } { i32 ptrtoint ({ i8, [63 x i8] }* @c to i32), i32 1, i32 64, i32 ptrtoint ([2 x i8]* @___asan_gen_1 to i32), i32 ptrtoint ([7 x i8]* @___asan_gen_ to i32), i32 0 }] @llvm.global_dtors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_dtor }] define internal void @asan.module_ctor() { Index: llvm/trunk/test/DebugInfo/Generic/incorrect-variable-debugloc.ll =================================================================== --- llvm/trunk/test/DebugInfo/Generic/incorrect-variable-debugloc.ll +++ llvm/trunk/test/DebugInfo/Generic/incorrect-variable-debugloc.ll @@ -54,8 +54,8 @@ @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }] @__asan_option_detect_stack_use_after_return = external global i32 -@__asan_gen_ = private unnamed_addr constant [11 x i8] c"1 32 8 1 A\00", align 1 -@__asan_gen_1 = private unnamed_addr constant [13 x i8] c"1 32 1 3 tmp\00", align 1 +@___asan_gen_ = private unnamed_addr constant [11 x i8] c"1 32 8 1 A\00", align 1 +@___asan_gen_1 = private unnamed_addr constant [13 x i8] c"1 32 1 3 tmp\00", align 1 ; Function Attrs: noreturn sanitize_address define i32 @_Z3fn1v() #0 !dbg !22 { @@ -78,7 +78,7 @@ store i64 1102416563, i64* %9, !dbg !39 %10 = add i64 %6, 8, !dbg !39 %11 = inttoptr i64 %10 to i64*, !dbg !39 - store i64 ptrtoint ([11 x i8]* @__asan_gen_ to i64), i64* %11, !dbg !39 + store i64 ptrtoint ([11 x i8]* @___asan_gen_ to i64), i64* %11, !dbg !39 %12 = add i64 %6, 16, !dbg !39 %13 = inttoptr i64 %12 to i64*, !dbg !39 store i64 ptrtoint (i32 ()* @_Z3fn1v to i64), i64* %13, !dbg !39 @@ -136,7 +136,7 @@ store i64 1102416563, i64* %9, !dbg !48 %10 = add i64 %6, 8, !dbg !48 %11 = inttoptr i64 %10 to i64*, !dbg !48 - store i64 ptrtoint ([13 x i8]* @__asan_gen_1 to i64), i64* %11, !dbg !48 + store i64 ptrtoint ([13 x i8]* @___asan_gen_1 to i64), i64* %11, !dbg !48 %12 = add i64 %6, 16, !dbg !48 %13 = inttoptr i64 %12 to i64*, !dbg !48 store i64 ptrtoint (void (%struct.C*)* @_ZN1C5m_fn3Ev to i64), i64* %13, !dbg !48 Index: llvm/trunk/test/DebugInfo/X86/dbg_value_direct.ll =================================================================== --- llvm/trunk/test/DebugInfo/X86/dbg_value_direct.ll +++ llvm/trunk/test/DebugInfo/X86/dbg_value_direct.ll @@ -20,7 +20,7 @@ @__asan_mapping_offset = linkonce_odr constant i64 2147450880 @__asan_mapping_scale = linkonce_odr constant i64 3 @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }] -@__asan_gen_ = private unnamed_addr constant [16 x i8] c"1 32 4 5 .addr \00", align 1 +@___asan_gen_ = private unnamed_addr constant [16 x i8] c"1 32 4 5 .addr \00", align 1 ; Function Attrs: sanitize_address uwtable define void @_Z4funci(%struct.A* noalias sret %agg.result, i32) #0 "stack-protector-buffer-size"="1" !dbg !4 { @@ -33,7 +33,7 @@ store i64 1102416563, i64* %4 %5 = add i64 %1, 8 %6 = inttoptr i64 %5 to i64* - store i64 ptrtoint ([16 x i8]* @__asan_gen_ to i64), i64* %6 + store i64 ptrtoint ([16 x i8]* @___asan_gen_ to i64), i64* %6 %7 = add i64 %1, 16 %8 = inttoptr i64 %7 to i64* store i64 ptrtoint (void (%struct.A*, i32)* @_Z4funci to i64), i64* %8 Index: llvm/trunk/test/DebugInfo/X86/debug-loc-asan.ll =================================================================== --- llvm/trunk/test/DebugInfo/X86/debug-loc-asan.ll +++ llvm/trunk/test/DebugInfo/X86/debug-loc-asan.ll @@ -48,7 +48,7 @@ @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }] @__asan_option_detect_stack_use_after_return = external global i32 -@__asan_gen_ = private unnamed_addr constant [16 x i8] c"1 32 4 6 y.addr\00", align 1 +@___asan_gen_ = private unnamed_addr constant [16 x i8] c"1 32 4 6 y.addr\00", align 1 ; Function Attrs: nounwind sanitize_address uwtable define i32 @_Z3bari(i32 %y) #0 !dbg !4 { @@ -71,7 +71,7 @@ store i64 1102416563, i64* %9 %10 = add i64 %6, 8 %11 = inttoptr i64 %10 to i64* - store i64 ptrtoint ([16 x i8]* @__asan_gen_ to i64), i64* %11 + store i64 ptrtoint ([16 x i8]* @___asan_gen_ to i64), i64* %11 %12 = add i64 %6, 16 %13 = inttoptr i64 %12 to i64* store i64 ptrtoint (i32 (i32)* @_Z3bari to i64), i64* %13 Index: llvm/trunk/test/Instrumentation/AddressSanitizer/do-not-instrument-profiling-globals.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/do-not-instrument-profiling-globals.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/do-not-instrument-profiling-globals.ll @@ -5,5 +5,5 @@ @__llvm_gcov_ctr = internal global [1 x i64] zeroinitializer ; CHECK-DAG: @asan.module_ctor -; CHECK-NOT: @__asan_gen{{.*}}__llvm_gcov_ctr -; CHECK-NOT: @__asan_gen{{.*}}__profc_test +; CHECK-NOT: @___asan_gen{{.*}}__llvm_gcov_ctr +; CHECK-NOT: @___asan_gen{{.*}}__profc_test Index: llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata.ll @@ -18,9 +18,9 @@ ; CHECK: @.str = internal unnamed_addr constant { [14 x i8], [50 x i8] } { [14 x i8] c"Hello, world!\00", [50 x i8] zeroinitializer }, comdat($".str${{[01-9a-f]+}}"), align 32 ; Check emitted location descriptions: -; CHECK: [[VARNAME:@__asan_gen_.[0-9]+]] = private unnamed_addr constant [7 x i8] c"global\00", align 1 -; CHECK: [[FILENAME:@__asan_gen_.[0-9]+]] = private unnamed_addr constant [22 x i8] c"/tmp/asan-globals.cpp\00", align 1 -; CHECK: [[LOCDESCR:@__asan_gen_.[0-9]+]] = private unnamed_addr constant { [22 x i8]*, i32, i32 } { [22 x i8]* [[FILENAME]], i32 5, i32 5 } +; CHECK: [[VARNAME:@___asan_gen_.[0-9]+]] = private unnamed_addr constant [7 x i8] c"global\00", align 1 +; CHECK: [[FILENAME:@___asan_gen_.[0-9]+]] = private unnamed_addr constant [22 x i8] c"/tmp/asan-globals.cpp\00", align 1 +; CHECK: [[LOCDESCR:@___asan_gen_.[0-9]+]] = private unnamed_addr constant { [22 x i8]*, i32, i32 } { [22 x i8]* [[FILENAME]], i32 5, i32 5 } ; CHECK: @__asan_global_global = {{.*}}i64 ptrtoint ({ i32, [60 x i8] }* @global to i64){{.*}} section "asan_globals"{{.*}}, !associated ; CHECK: @__asan_global_.str = {{.*}}i64 ptrtoint ({ [14 x i8], [50 x i8] }* @.str to i64){{.*}} section "asan_globals"{{.*}}, !associated Index: llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata_array.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata_array.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/global_metadata_array.ll @@ -18,9 +18,9 @@ ; CHECK: @.str = internal unnamed_addr constant { [14 x i8], [50 x i8] } { [14 x i8] c"Hello, world!\00", [50 x i8] zeroinitializer }{{.*}}, align 32 ; Check emitted location descriptions: -; CHECK: [[VARNAME:@__asan_gen_.[0-9]+]] = private unnamed_addr constant [7 x i8] c"global\00", align 1 -; CHECK: [[FILENAME:@__asan_gen_.[0-9]+]] = private unnamed_addr constant [22 x i8] c"/tmp/asan-globals.cpp\00", align 1 -; CHECK: [[LOCDESCR:@__asan_gen_.[0-9]+]] = private unnamed_addr constant { [22 x i8]*, i32, i32 } { [22 x i8]* [[FILENAME]], i32 5, i32 5 } +; CHECK: [[VARNAME:@___asan_gen_.[0-9]+]] = private unnamed_addr constant [7 x i8] c"global\00", align 1 +; CHECK: [[FILENAME:@___asan_gen_.[0-9]+]] = private unnamed_addr constant [22 x i8] c"/tmp/asan-globals.cpp\00", align 1 +; CHECK: [[LOCDESCR:@___asan_gen_.[0-9]+]] = private unnamed_addr constant { [22 x i8]*, i32, i32 } { [22 x i8]* [[FILENAME]], i32 5, i32 5 } ; Check that location descriptors and global names were passed into __asan_register_globals: ; CHECK: i64 ptrtoint ([7 x i8]* [[VARNAME]] to i64) Index: llvm/trunk/test/Instrumentation/AddressSanitizer/instrument_global.ll =================================================================== --- llvm/trunk/test/Instrumentation/AddressSanitizer/instrument_global.ll +++ llvm/trunk/test/Instrumentation/AddressSanitizer/instrument_global.ll @@ -7,7 +7,7 @@ ; If a global is present, __asan_[un]register_globals should be called from ; module ctor/dtor -; CHECK: @__asan_gen_ = private constant [8 x i8] c"\00", align 1 +; CHECK: @___asan_gen_ = private constant [8 x i8] c"\00", align 1 ; CHECK: llvm.global_ctors ; CHECK: llvm.global_dtors