46 lines · plain
1; RUN: llc < %s -mtriple x86_64-apple-darwin11 -mcpu corei7 -emit-compact-unwind-non-canonical=true -filetype=obj -o - | llvm-objdump -d --unwind-info -s - | FileCheck %s2; Regression test for http://llvm.org/bugs/show_bug.cgi?id=20800.3 4; ModuleID = 'asan_report.ii'5target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"6target triple = "x86_64-apple-macosx10.9.0"7 8@.str = private unnamed_addr constant [3 x i8] c"=>\00", align 19@.str1 = private unnamed_addr constant [3 x i8] c" \00", align 110@.str2 = private unnamed_addr constant [6 x i8] c"%s%p:\00", align 111 12; CHECK: <___asan_report_error>:13 14; subq instruction starts at 0x0a, so the second byte of the compact encoding15; (UNWIND_X86_64_FRAMELESS_STACK_SIZE in mach-o/compact_unwind_encoding.h)16; must be 0x0d.17; CHECK: {{a:.*subq.*%rsp}}18 19; CHECK: Contents of __compact_unwind section20; CHECK: ___asan_report_error21 22; Because of incorrect push instruction size in X86AsmBackend.cpp the stack23; size was also calculated incorrectly.24; CHECK-NOT: {{compact encoding:.*0x0309f800}}25; CHECK: {{compact encoding:.*0x030df800}}26 27define void @__asan_report_error(i64 %step) #0 {28 %str.i = alloca i64, align 829 %stack = alloca [256 x i64], align 830 br label %print_shadow_bytes.exit.i31 32print_shadow_bytes.exit.i: ; preds = %print_shadow_bytes.exit.i, %033 %iv.i = phi i64 [ -5, %0 ], [ %iv.next.i, %print_shadow_bytes.exit.i ]34 %reg15 = icmp eq i64 %iv.i, 035 %.str..str1.i = select i1 %reg15, ptr @.str, ptr @.str136 %reg17 = shl i64 %iv.i, 137 %reg19 = inttoptr i64 %reg17 to ptr38 call void (ptr, ptr, ...) @append(ptr %str.i, ptr @.str2, ptr %.str..str1.i, ptr %reg19)39 %iv.next.i = add nsw i64 %iv.i, %step40 br label %print_shadow_bytes.exit.i41}42 43declare void @append(ptr, ptr, ...)44 45attributes #0 = { "frame-pointer"="none" }46