[compiler-rt] r198022 - [ASan] Add a test for __asan_gen_ globals labels on Darwin.

Alexander Potapenko glider at google.com
Wed Dec 25 09:20:23 PST 2013


Author: glider
Date: Wed Dec 25 11:20:22 2013
New Revision: 198022

URL: http://llvm.org/viewvc/llvm-project?rev=198022&view=rev
Log:
[ASan] Add a test for __asan_gen_ globals labels on Darwin.

Per Nick Kledzik (http://llvm.org/bugs/show_bug.cgi?id=17976):
"""
For MacOSX, the labels in __cstring section should be 'L' labels, and the labels
in the __const section should be non-L or 'l' labels.  The later ('l') will cause
the linker to remove the label in the final executable.
"""

, so we need to ensure that the globals emitted by ASan have appropriate labels.

Added:
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/asan_gen_prefixes.cc   (with props)

Added: compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/asan_gen_prefixes.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/asan_gen_prefixes.cc?rev=198022&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/asan_gen_prefixes.cc (added)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/asan_gen_prefixes.cc Wed Dec 25 11:20:22 2013
@@ -0,0 +1,14 @@
+// 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
+// RUN: cat %t.s | FileCheck %s || exit 1
+
+int x, y, z;
+int main() { return 0; }
+// CHECK: .section{{.*}}__TEXT,__const
+// CHECK: l___asan_gen_
+// CHECK: .section{{.*}}__TEXT,__cstring,cstring_literals
+// CHECK: L___asan_gen_
+// CHECK: L___asan_gen_
+// CHECK: L___asan_gen_

Propchange: compiler-rt/trunk/lib/asan/lit_tests/TestCases/Darwin/asan_gen_prefixes.cc
------------------------------------------------------------------------------
    svn:eol-style = LF





More information about the llvm-commits mailing list