File: aligned-attr-type.ispc

package info (click to toggle)
ispc 1.28.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 97,620 kB
  • sloc: cpp: 77,067; python: 8,303; yacc: 3,337; lex: 1,126; ansic: 631; sh: 475; makefile: 17
file content (22 lines) | stat: -rw-r--r-- 906 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// This test checks that the alignment attribute is correctly applied to type
// definitions and can be applied to the particular variable declarations
// overriding the type definition.

// RUN: %{ispc} --target=host --emit-llvm-text -o - %s 2>&1 | FileCheck %s

struct Sy { int8 x; int y; } __attribute__((aligned(8)));

// CHECK: @y8 = local_unnamed_addr global %v{{.*}}_varying_Sy zeroinitializer, align 8
struct Sy y8;

// CHECK: @y32 = local_unnamed_addr global %v{{.*}}_varying_Sy zeroinitializer, align 32
__attribute__((aligned(32))) struct Sy y32;

// CHECK: @y8_2 = local_unnamed_addr global %v{{.*}}_varying_Sy zeroinitializer, align 8
struct Sy y8_2;

// CHECK: @z8 = local_unnamed_addr global %v{{.*}}_varying_Sz zeroinitializer, align 8
__attribute__((aligned(8))) struct Sz { int8 x; int y; } z8;

// CHECK: @z0 = local_unnamed_addr global %v{{.*}}_varying_Sz zeroinitializer
struct Sz z0;