r186564 - Fix volatile _Complex alignment test on platforms where 64-bit floating point isn't 64-bit aligned

Stephen Lin swlin at post.harvard.edu
Thu Jul 18 17:25:37 PDT 2013


Hey, thanks for using the new directive! :)

By the way, for any cfe'ers who don't follow llvm-commits, the
semantics and justification for the new FileCheck directive are
described in the llvm.org docs
(http://llvm.org/docs/CommandGuide/FileCheck.html) and in the message
describing the patch:

http://permalink.gmane.org/gmane.comp.compilers.llvm.cvs/151764

(I've mass converted most of the llvm CodeGen and Transforms tests to
use the new directive, where applicable, via some scripting; I might
do so in clang as well, at some point, but it's a bit harder given the
greater diversity of tests as well as things like name mangling...)

-Stephen


On Wed, Jul 17, 2013 at 11:11 PM, JF Bastien <jfb at google.com> wrote:
> Author: jfb
> Date: Thu Jul 18 01:11:45 2013
> New Revision: 186564
>
> URL: http://llvm.org/viewvc/llvm-project?rev=186564&view=rev
> Log:
> Fix volatile _Complex alignment test on platforms where 64-bit floating point isn't 64-bit aligned
>
> Add x86-64 triple, and check its datalayout. Also add some comments, and use the new CHECK-LABEL.
>
> Modified:
>     cfe/trunk/test/CodeGen/volatile-complex.c
>
> Modified: cfe/trunk/test/CodeGen/volatile-complex.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/volatile-complex.c?rev=186564&r1=186563&r2=186564&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGen/volatile-complex.c (original)
> +++ cfe/trunk/test/CodeGen/volatile-complex.c Thu Jul 18 01:11:45 2013
> @@ -1,12 +1,20 @@
> -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
> +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
> +
> +// Validate that volatile _Complex loads and stores are generated
> +// properly, including their alignment (even when overaligned).
> +//
> +// This test assumes that floats are 32-bit aligned and doubles are
> +// 64-bit aligned, and uses x86-64 as a target that should have this
> +// datalayout.
> +
> +// CHECK: target datalayout = "{{.*}}f32:32:32-f64:64:64{{.*}}"
>
>  volatile _Complex float cf;
>  volatile _Complex double cd;
>  volatile _Complex float cf32 __attribute__((aligned(32)));
>  volatile _Complex double cd32 __attribute__((aligned(32)));
>
> -
> -// CHECK: define void @test_cf()
> +// CHECK-LABEL: define void @test_cf()
>  void test_cf() {
>    // CHECK:      load volatile float* getelementptr inbounds ({ float, float }* @cf, i32 0, i32 0), align 4
>    // CHECK-NEXT: load volatile float* getelementptr inbounds ({ float, float }* @cf, i32 0, i32 1), align 4
> @@ -19,7 +27,7 @@ void test_cf() {
>    // CHECK-NEXT: ret void
>  }
>
> -// CHECK: define void @test_cd()
> +// CHECK-LABEL: define void @test_cd()
>  void test_cd() {
>    // CHECK:      load volatile double* getelementptr inbounds ({ double, double }* @cd, i32 0, i32 0), align 8
>    // CHECK-NEXT: load volatile double* getelementptr inbounds ({ double, double }* @cd, i32 0, i32 1), align 8
> @@ -32,7 +40,7 @@ void test_cd() {
>    // CHECK-NEXT: ret void
>  }
>
> -// CHECK: define void @test_cf32()
> +// CHECK-LABEL: define void @test_cf32()
>  void test_cf32() {
>    // CHECK:      load volatile float* getelementptr inbounds ({ float, float }* @cf32, i32 0, i32 0), align 32
>    // CHECK-NEXT: load volatile float* getelementptr inbounds ({ float, float }* @cf32, i32 0, i32 1), align 4
> @@ -45,7 +53,7 @@ void test_cf32() {
>    // CHECK-NEXT: ret void
>  }
>
> -// CHECK: define void @test_cd32()
> +// CHECK-LABEL: define void @test_cd32()
>  void test_cd32() {
>    // CHECK:      load volatile double* getelementptr inbounds ({ double, double }* @cd32, i32 0, i32 0), align 32
>    // CHECK-NEXT: load volatile double* getelementptr inbounds ({ double, double }* @cd32, i32 0, i32 1), align 8
>
>
> _______________________________________________
> 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