1 ; RUN: not opt -S -passes=verify < %s 2>&1 | FileCheck %s
3 ;; Global variables cannot be scalable vectors, since we don't
4 ;; know the size at compile time.
6 ; CHECK: Globals cannot contain scalable types
7 ; CHECK-NEXT: ptr @ScalableVecGlobal
8 @ScalableVecGlobal = global <vscale x 4 x i32> zeroinitializer
10 ; CHECK-NEXT: Globals cannot contain scalable types
11 ; CHECK-NEXT: ptr @ScalableVecArrayGlobal
12 @ScalableVecArrayGlobal = global [ 8 x <vscale x 4 x i32> ] zeroinitializer
14 ; CHECK-NEXT: Globals cannot contain scalable types
15 ; CHECK-NEXT: ptr @ScalableVecStructGlobal
16 @ScalableVecStructGlobal = global { i32, <vscale x 4 x i32> } zeroinitializer
18 ; CHECK-NEXT: Globals cannot contain scalable types
19 ; CHECK-NEXT: ptr @StructTestGlobal
20 %struct.test = type { <vscale x 1 x double>, <vscale x 1 x double> }
21 @StructTestGlobal = global %struct.test zeroinitializer
23 ; CHECK-NEXT: Globals cannot contain scalable types
24 ; CHECK-NEXT: ptr @StructArrayTestGlobal
25 %struct.array.test = type { [2 x <vscale x 1 x double>] }
26 @StructArrayTestGlobal = global %struct.array.test zeroinitializer
28 ; CHECK-NEXT: Globals cannot contain scalable types
29 ; CHECK-NEXT: ptr @StructTargetTestGlobal
30 %struct.target.test = type { target("aarch64.svcount"), target("aarch64.svcount") }
31 @StructTargetTestGlobal = global %struct.target.test zeroinitializer