Home | History | Annotate | Download | only in CodeGen
      1 // RUN: %clang_cc1 -w -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
      2 // rdar://11759609
      3 
      4 // At or below target max alignment with no aligned attribute should align based
      5 // on the size of vector.
      6 double __attribute__((vector_size(16))) v1;
      7 // CHECK: @v1 {{.*}}, align 16
      8 double __attribute__((vector_size(32))) v2;
      9 // CHECK: @v2 {{.*}}, align 32
     10 
     11 // Alignment above target max alignment with no aligned attribute should align
     12 // based on the target max.
     13 double __attribute__((vector_size(64))) v3;
     14 // CHECK: @v3 {{.*}}, align 32
     15 double __attribute__((vector_size(1024))) v4;
     16 // CHECK: @v4 {{.*}}, align 32
     17 
     18 // Aliged attribute should always override.
     19 double __attribute__((vector_size(16), aligned(16))) v5;
     20 // CHECK: @v5 {{.*}}, align 16
     21 double __attribute__((vector_size(16), aligned(64))) v6;
     22 // CHECK: @v6 {{.*}}, align 64
     23 double __attribute__((vector_size(32), aligned(16))) v7;
     24 // CHECK: @v7 {{.*}}, align 16
     25 double __attribute__((vector_size(32), aligned(64))) v8;
     26 // CHECK: @v8 {{.*}}, align 64
     27 
     28 // Check non-power of 2 widths.
     29 double __attribute__((vector_size(24))) v9;
     30 // CHECK: @v9 {{.*}}, align 32
     31 double __attribute__((vector_size(40))) v10;
     32 // CHECK: @v10 {{.*}}, align 32
     33 
     34 // Check non-power of 2 widths with aligned attribute.
     35 double __attribute__((vector_size(24), aligned(64))) v11;
     36 // CHECK: @v11 {{.*}}, align 64
     37 double __attribute__((vector_size(80), aligned(16))) v12;
     38 // CHECK: @v12 {{.*}}, align 16
     39