[asan] add DISABLED_BuiltinLongJmpTest
authorKostya Serebryany <kcc@google.com>
Wed, 28 Nov 2012 15:01:23 +0000 (15:01 +0000)
committerKostya Serebryany <kcc@google.com>
Wed, 28 Nov 2012 15:01:23 +0000 (15:01 +0000)
llvm-svn: 168793

compiler-rt/lib/asan/tests/asan_test.cc

index fd52f64..6d76b0d 100644 (file)
@@ -637,6 +637,17 @@ NOINLINE void LongJmpFunc1(jmp_buf buf) {
   longjmp(buf, 1);
 }
 
+NOINLINE void BuiltinLongJmpFunc1(jmp_buf buf) {
+  // create three red zones for these two stack objects.
+  int a;
+  int b;
+
+  int *A = Ident(&a);
+  int *B = Ident(&b);
+  *A = *B;
+  __builtin_longjmp((void**)buf, 1);
+}
+
 NOINLINE void UnderscopeLongJmpFunc1(jmp_buf buf) {
   // create three red zones for these two stack objects.
   int a;
@@ -677,6 +688,16 @@ TEST(AddressSanitizer, LongJmpTest) {
   }
 }
 
+// http://code.google.com/p/address-sanitizer/issues/detail?id=129
+TEST(AddressSanitizer, DISABLED_BuiltinLongJmpTest) {
+  static jmp_buf buf;
+  if (!setjmp(buf)) {
+    BuiltinLongJmpFunc1(buf);
+  } else {
+    TouchStackFunc();
+  }
+}
+
 TEST(AddressSanitizer, UnderscopeLongJmpTest) {
   static jmp_buf buf;
   if (!_setjmp(buf)) {