From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGenObjCXX/address-safety-attr.mm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 clang/test/CodeGenObjCXX/address-safety-attr.mm (limited to 'clang/test/CodeGenObjCXX/address-safety-attr.mm') diff --git a/clang/test/CodeGenObjCXX/address-safety-attr.mm b/clang/test/CodeGenObjCXX/address-safety-attr.mm new file mode 100644 index 0000000..a54ca99 --- /dev/null +++ b/clang/test/CodeGenObjCXX/address-safety-attr.mm @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -o - %s -faddress-sanitizer | FileCheck -check-prefix ASAN %s + +@interface MyClass ++ (int) addressSafety:(int*)a; +@end + +@implementation MyClass + +// CHECK-NOT: +[MyClass load]{{.*}} address_safety +// CHECK: +[MyClass load]{{.*}} +// ASAN: +[MyClass load]{{.*}} address_safety ++(void) load { } + +// CHECK-NOT: +[MyClass addressSafety:]{{.*}} address_safety +// CHECK: +[MyClass addressSafety:]{{.*}} +// ASAN: +[MyClass addressSafety:]{{.*}} address_safety ++ (int) addressSafety:(int*)a { return *a; } + +@end -- cgit v1.2.3