Skip to content

Commit a3f0553

Browse files
committed
Silence warnings in the tests
1 parent 6f27742 commit a3f0553

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Tests/LLVMTests/IRBuilderSpec.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class IRBuilderSpec : XCTestCase {
3333

3434
// IRBUILDERARITH: @a = global i32 1
3535
// IRBUILDERARITH-NEXT: @b = global i32 1
36-
var g1 = builder.addGlobal("a", type: IntType.int32)
36+
let g1 = builder.addGlobal("a", type: IntType.int32)
3737
g1.initializer = Int32(1)
38-
var g2 = builder.addGlobal("b", type: IntType.int32)
38+
let g2 = builder.addGlobal("b", type: IntType.int32)
3939
g2.initializer = Int32(1)
4040

4141
// IRBUILDERARITH-NEXT: @vec1 = global <8 x i64> <i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1>
@@ -121,9 +121,9 @@ class IRBuilderSpec : XCTestCase {
121121

122122
// IRBUILDERCMP: @a = global i32 1
123123
// IRBUILDERCMP-NEXT: @b = global i32 1
124-
var g1 = builder.addGlobal("a", type: IntType.int32)
124+
let g1 = builder.addGlobal("a", type: IntType.int32)
125125
g1.initializer = Int32(1)
126-
var g2 = builder.addGlobal("b", type: IntType.int32)
126+
let g2 = builder.addGlobal("b", type: IntType.int32)
127127
g2.initializer = Int32(1)
128128

129129
// IRBUILDERCMP: define void @main() {
@@ -175,9 +175,9 @@ class IRBuilderSpec : XCTestCase {
175175

176176
// IRBUILDERFCMP: @a = global double 1
177177
// IRBUILDERFCMP-NEXT: @b = global double 1
178-
var g1 = builder.addGlobal("a", type: FloatType.double)
178+
let g1 = builder.addGlobal("a", type: FloatType.double)
179179
g1.initializer = FloatType.double.constant(1)
180-
var g2 = builder.addGlobal("b", type: FloatType.double)
180+
let g2 = builder.addGlobal("b", type: FloatType.double)
181181
g2.initializer = FloatType.double.constant(1)
182182

183183
// IRBUILDERFCMP: define void @main() {

Tests/LLVMTests/IRGlobalSpec.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class IRGlobalSpec : XCTestCase {
1111
let module = Module(name: "IRInertGlobalTest")
1212
let builder = IRBuilder(module: module)
1313
// IRINERTGLOBAL: @external_global = external constant i32
14-
var extGlobal = builder.addGlobal("external_global", type: IntType.int32)
14+
let extGlobal = builder.addGlobal("external_global", type: IntType.int32)
1515
extGlobal.isGlobalConstant = true
1616
// IRINERTGLOBAL: @got.external_global = private unnamed_addr constant i32* @external_global
1717
var gotGlobal = builder.addGlobal("got.external_global",
@@ -21,7 +21,7 @@ class IRGlobalSpec : XCTestCase {
2121
gotGlobal.isGlobalConstant = true
2222

2323
// IRINERTGLOBAL: @external_relative_reference = global i32 trunc (i64 sub (i64 ptrtoint (i32** @got.external_global to i64), i64 ptrtoint (i32* @external_relative_reference to i64)) to i32)
24-
var ext_relative_reference = builder.addGlobal("external_relative_reference", type: IntType.int32)
24+
let ext_relative_reference = builder.addGlobal("external_relative_reference", type: IntType.int32)
2525
ext_relative_reference.initializer = Constant<Unsigned>.pointerToInt(gotGlobal, .int64)
2626
.subtracting(Constant<Unsigned>.pointerToInt(ext_relative_reference, .int64)).truncate(to: .int32)
2727
module.dump()

Tests/LLVMTests/IROperationSpec.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ class IROperationSpec : XCTestCase {
1212
let builder = IRBuilder(module: module)
1313

1414
// BINARYOP: @a = global i32 1
15-
var gi1 = builder.addGlobal("a", type: IntType.int32)
15+
let gi1 = builder.addGlobal("a", type: IntType.int32)
1616
gi1.initializer = Int32(1)
1717
// BINARYOP-NEXT: @b = global i32 1
18-
var gi2 = builder.addGlobal("b", type: IntType.int32)
18+
let gi2 = builder.addGlobal("b", type: IntType.int32)
1919
gi2.initializer = Int32(1)
2020

2121
// BINARYOP-NEXT: @c = global float 0.000000e+00
22-
var gf1 = builder.addGlobal("c", type: FloatType.float)
22+
let gf1 = builder.addGlobal("c", type: FloatType.float)
2323
gf1.initializer = FloatType.float.constant(0.0)
2424
// BINARYOP-NEXT: @d = global float 0.000000e+00
25-
var gf2 = builder.addGlobal("d", type: FloatType.float)
25+
let gf2 = builder.addGlobal("d", type: FloatType.float)
2626
gf2.initializer = FloatType.float.constant(0.0)
2727

2828
// BINARYOP: define void @main() {
@@ -96,11 +96,11 @@ class IROperationSpec : XCTestCase {
9696
let builder = IRBuilder(module: module)
9797

9898
// CASTOP: @a = global i32 1
99-
var gi = builder.addGlobal("a", type: IntType.int32)
99+
let gi = builder.addGlobal("a", type: IntType.int32)
100100
gi.initializer = Int32(1)
101101

102102
// CASTOP-NEXT: @f = global float 0.000000e+00
103-
var gf = builder.addGlobal("f", type: FloatType.float)
103+
let gf = builder.addGlobal("f", type: FloatType.float)
104104
gf.initializer = FloatType.float.constant(0.0)
105105

106106
// CASTOP: define void @main() {

0 commit comments

Comments
 (0)