-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Fix linkage for global variables, as default setting from clang…
… is NoCommon.
- Loading branch information
Showing
18 changed files
with
54 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
// RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %file-check %s | ||
// RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t - | ||
|
||
// CHECK: hl.var @ai, <common> : !hl.lvalue<!hl.array<10, !hl.int>> | ||
// CHECK: hl.var @ai, <external> : !hl.lvalue<!hl.array<10, !hl.int>> | ||
int ai[10]; | ||
|
||
// CHECK: hl.var @aci, <common> : !hl.lvalue<!hl.array<5, !hl.int< const >>> | ||
// CHECK: hl.var @aci, <external> : !hl.lvalue<!hl.array<5, !hl.int< const >>> | ||
const int aci[5]; | ||
|
||
// CHECK: hl.var @avi, <common> : !hl.lvalue<!hl.array<5, !hl.int< volatile >>> | ||
// CHECK: hl.var @avi, <external> : !hl.lvalue<!hl.array<5, !hl.int< volatile >>> | ||
volatile int avi[5]; | ||
|
||
// CHECK: hl.var @acvi, <common> : !hl.lvalue<!hl.array<5, !hl.int< const, volatile >>> | ||
// CHECK: hl.var @acvi, <external> : !hl.lvalue<!hl.array<5, !hl.int< const, volatile >>> | ||
const volatile int acvi[5]; | ||
|
||
// CHECK: hl.var @acvui, <common> : !hl.lvalue<!hl.array<5, !hl.int< unsigned, const, volatile >>> | ||
// CHECK: hl.var @acvui, <external> : !hl.lvalue<!hl.array<5, !hl.int< unsigned, const, volatile >>> | ||
const volatile unsigned int acvui[5]; | ||
|
||
// CHECK: hl.var @af, <common> : !hl.lvalue<!hl.array<10, !hl.float>> | ||
// CHECK: hl.var @af, <external> : !hl.lvalue<!hl.array<10, !hl.float>> | ||
float af[10]; | ||
|
||
// CHECK: hl.var @a3d, <common> : !hl.lvalue<!hl.array<2, !hl.array<4, !hl.array<3, !hl.float>>>> | ||
// CHECK: hl.var @a3d, <external> : !hl.lvalue<!hl.array<2, !hl.array<4, !hl.array<3, !hl.float>>>> | ||
float a3d[2][4][3]; | ||
|
||
// CHECK: hl.var @ae, <common> : !hl.lvalue<!hl.array<404, !hl.int>> | ||
// CHECK: hl.var @ae, <external> : !hl.lvalue<!hl.array<404, !hl.int>> | ||
int ae[4 + 4*100]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %file-check %s | ||
// RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t - | ||
|
||
// CHECK: hl.var @ia, <common> : !hl.lvalue<!hl.array<10, !hl.int>> | ||
// CHECK: hl.var @ia, <external> : !hl.lvalue<!hl.array<10, !hl.int>> | ||
int ia[10]; | ||
|
||
// CHECK: hl.var @cia, <common> : !hl.lvalue<!hl.array<10, !hl.int< const >>> | ||
// CHECK: hl.var @cia, <external> : !hl.lvalue<!hl.array<10, !hl.int< const >>> | ||
const int cia[10]; | ||
|
||
// CHECK: hl.var @via, <common> : !hl.lvalue<!hl.array<10, !hl.int< volatile >>> | ||
// CHECK: hl.var @via, <external> : !hl.lvalue<!hl.array<10, !hl.int< volatile >>> | ||
volatile int via[10]; | ||
|
||
// CHECK: hl.var @cvia, <common> : !hl.lvalue<!hl.array<10, !hl.int< const, volatile >>> | ||
// CHECK: hl.var @cvia, <external> : !hl.lvalue<!hl.array<10, !hl.int< const, volatile >>> | ||
const volatile int cvia[10]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %file-check %s | ||
// RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t - | ||
|
||
// CHECK: hl.var @fp, <common> : !hl.lvalue<!hl.ptr<!hl.paren<!core.fn<(!hl.lvalue<!hl.int>) -> (!hl.int)>>>> | ||
// CHECK: hl.var @fp, <external> : !hl.lvalue<!hl.ptr<!hl.paren<!core.fn<(!hl.lvalue<!hl.int>) -> (!hl.int)>>>> | ||
int (*fp) (int); | ||
|
||
// CHECK: hl.var @cfp, <common> : !hl.lvalue<!hl.ptr<!hl.paren<!core.fn<(!hl.lvalue<!hl.int>) -> (!hl.int< const >)>>>> | ||
// CHECK: hl.var @cfp, <external> : !hl.lvalue<!hl.ptr<!hl.paren<!core.fn<(!hl.lvalue<!hl.int>) -> (!hl.int< const >)>>>> | ||
const int (*cfp)(int); | ||
|
||
// CHECK: hl.var @fpc, <common> : !hl.lvalue<!hl.ptr<!hl.paren<!core.fn<(!hl.lvalue<!hl.int< const >>) -> (!hl.int)>>>> | ||
// CHECK: hl.var @fpc, <external> : !hl.lvalue<!hl.ptr<!hl.paren<!core.fn<(!hl.lvalue<!hl.int< const >>) -> (!hl.int)>>>> | ||
int (*fpc)(const int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
// RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %vast-opt --vast-hl-lower-types | %file-check %s | ||
|
||
// CHECK: hl.var @ai, <common> : !hl.lvalue<!hl.array<10, si32>> | ||
// CHECK: hl.var @ai, <external> : !hl.lvalue<!hl.array<10, si32>> | ||
int ai[10]; | ||
|
||
// CHECK: hl.var @aci, <common> : !hl.lvalue<!hl.array<5, si32>> | ||
// CHECK: hl.var @aci, <external> : !hl.lvalue<!hl.array<5, si32>> | ||
const int aci[5]; | ||
|
||
// CHECK: hl.var @avi, <common> : !hl.lvalue<!hl.array<5, si32>> | ||
// CHECK: hl.var @avi, <external> : !hl.lvalue<!hl.array<5, si32>> | ||
volatile int avi[5]; | ||
|
||
// CHECK: hl.var @acvi, <common> : !hl.lvalue<!hl.array<5, si32>> | ||
// CHECK: hl.var @acvi, <external> : !hl.lvalue<!hl.array<5, si32>> | ||
const volatile int acvi[5]; | ||
|
||
// CHECK: hl.var @acvui, <common> : !hl.lvalue<!hl.array<5, ui32>> | ||
// CHECK: hl.var @acvui, <external> : !hl.lvalue<!hl.array<5, ui32>> | ||
const volatile unsigned int acvui[5]; | ||
|
||
// CHECK: hl.var @af, <common> : !hl.lvalue<!hl.array<10, f32>> | ||
// CHECK: hl.var @af, <external> : !hl.lvalue<!hl.array<10, f32>> | ||
float af[10]; | ||
|
||
// CHECK: hl.var @a3d, <common> : !hl.lvalue<!hl.array<2, !hl.array<4, !hl.array<3, f32>>>> | ||
// CHECK: hl.var @a3d, <external> : !hl.lvalue<!hl.array<2, !hl.array<4, !hl.array<3, f32>>>> | ||
float a3d[2][4][3]; |