[cfe-commits] r156321 - /cfe/trunk/test/CodeGen/catch-undef-behavior.c

NAKAMURA Takumi geek4civic at gmail.com
Mon May 7 15:10:35 PDT 2012


Seems to fail on gcc hosts, ... possibly due to BB order.

; x86_64-linux with g++44
define void @foo() nounwind {
  %u = alloca %union.anon, align 4
  %1 = bitcast %union.anon* %u to i32*
  %2 = bitcast i32* %1 to i8*
  %3 = call i64 @llvm.objectsize.i64(i8* %2, i1 false)
  br label %5

; <label>:4                                       ; preds = %5
  call void @llvm.trap() noreturn nounwind
  unreachable

; <label>:5                                       ; preds = %0
  %6 = icmp uge i64 %3, 4
  br i1 %6, label %7, label %4

; <label>:7                                       ; preds = %5
  store i32 1, i32* %1, align 4
  ret void
}

2012/5/8 Nuno Lopes <nunoplopes at sapo.pt>:
> Author: nlopes
> Date: Mon May  7 15:23:03 2012
> New Revision: 156321
>
> URL: http://llvm.org/viewvc/llvm-project?rev=156321&view=rev
> Log:
> make this test a little more useful. I'll add more tests for bound checking once -fbounds-checking patch gets in
>
> Modified:
>    cfe/trunk/test/CodeGen/catch-undef-behavior.c
>
> Modified: cfe/trunk/test/CodeGen/catch-undef-behavior.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/catch-undef-behavior.c?rev=156321&r1=156320&r2=156321&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGen/catch-undef-behavior.c (original)
> +++ cfe/trunk/test/CodeGen/catch-undef-behavior.c Mon May  7 15:23:03 2012
> @@ -1,7 +1,17 @@
> -// RUN: %clang_cc1 -fcatch-undefined-behavior -emit-llvm-only %s
> +// RUN: %clang_cc1 -fcatch-undefined-behavior -emit-llvm %s -o - | FileCheck %s
>
>  // PR6805
> +// CHECK: @foo
>  void foo() {
>   union { int i; } u;
> +  // CHECK: objectsize
> +  // CHECK-NEXT: icmp uge
>   u.i=1;
>  }
> +
> +// CHECK: @bar
> +int bar(int *a) {
> +  // CHECK: objectsize
> +  // CHECK-NEXT: icmp uge
> +  return *a;
> +}
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list