[cfe-commits] r156321 - /cfe/trunk/test/CodeGen/catch-undef-behavior.c
Nuno Lopes
nunoplopes at sapo.pt
Mon May 7 18:57:37 PDT 2012
Ah, thanks for the heads up.
Should be fixed in r156357.
The order in that the code creates the trap BB is actually
non-deterministic, and that's the reason behind the test failing on some
hosts.
Nuno
-----Original Message-----
From: NAKAMURA Takumi
Sent: Monday, May 07, 2012 11:10 PM
Subject: Re: [cfe-commits] r156321 -
/cfe/trunk/test/CodeGen/catch-undef-behavior.c
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;
> +}
More information about the cfe-commits
mailing list