|
|
@@ -39,10 +39,18 @@ var test_i15: i15;
|
|
|
// CHECK:STDERR:
|
|
|
var test_i1000000000: i1000000000;
|
|
|
// TODO: This diagnostic is not very good.
|
|
|
-// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:33: error: integer literal with value 10000000000000000000 does not fit in i32 [IntLiteralTooLargeForI32]
|
|
|
+// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+12]]:33: error: expected expression [ExpectedExpr]
|
|
|
// CHECK:STDERR: var test_i10000000000000000000: i10000000000000000000;
|
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
|
|
// CHECK:STDERR:
|
|
|
+// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+8]]:33: error: semantics TODO: `HandleInvalidParse` [SemanticsTodo]
|
|
|
+// CHECK:STDERR: var test_i10000000000000000000: i10000000000000000000;
|
|
|
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
|
|
+// CHECK:STDERR:
|
|
|
+// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:34: error: found a type literal with a bit width using 20 digits, which is greater than the limit of 18 [TooManyTypeBitWidthDigits]
|
|
|
+// CHECK:STDERR: var test_i10000000000000000000: i10000000000000000000;
|
|
|
+// CHECK:STDERR: ^
|
|
|
+// CHECK:STDERR:
|
|
|
var test_i10000000000000000000: i10000000000000000000;
|
|
|
|
|
|
// --- uN.carbon
|
|
|
@@ -76,10 +84,18 @@ var test_u15: u15;
|
|
|
// CHECK:STDERR:
|
|
|
var test_u1000000000: u1000000000;
|
|
|
// TODO: This diagnostic is not very good.
|
|
|
-// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:33: error: integer literal with value 10000000000000000000 does not fit in i32 [IntLiteralTooLargeForI32]
|
|
|
+// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+12]]:33: error: expected expression [ExpectedExpr]
|
|
|
+// CHECK:STDERR: var test_u10000000000000000000: u10000000000000000000;
|
|
|
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
|
|
+// CHECK:STDERR:
|
|
|
+// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+8]]:33: error: semantics TODO: `HandleInvalidParse` [SemanticsTodo]
|
|
|
// CHECK:STDERR: var test_u10000000000000000000: u10000000000000000000;
|
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
|
|
// CHECK:STDERR:
|
|
|
+// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:34: error: found a type literal with a bit width using 20 digits, which is greater than the limit of 18 [TooManyTypeBitWidthDigits]
|
|
|
+// CHECK:STDERR: var test_u10000000000000000000: u10000000000000000000;
|
|
|
+// CHECK:STDERR: ^
|
|
|
+// CHECK:STDERR:
|
|
|
var test_u10000000000000000000: u10000000000000000000;
|
|
|
|
|
|
// --- fail_fN_bad_width.carbon
|
|
|
@@ -183,58 +199,7 @@ var test_f128: f128;
|
|
|
// CHECK:STDOUT: %.6: i32 = int_literal 1000000000 [template]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: imports {
|
|
|
-// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
|
-// CHECK:STDOUT: .Int = %import_ref
|
|
|
-// CHECK:STDOUT: import Core//prelude
|
|
|
-// CHECK:STDOUT: import Core//prelude/operators
|
|
|
-// CHECK:STDOUT: import Core//prelude/types
|
|
|
-// CHECK:STDOUT: import Core//prelude/operators/arithmetic
|
|
|
-// CHECK:STDOUT: import Core//prelude/operators/as
|
|
|
-// CHECK:STDOUT: import Core//prelude/operators/bitwise
|
|
|
-// CHECK:STDOUT: import Core//prelude/operators/comparison
|
|
|
-// CHECK:STDOUT: import Core//prelude/types/bool
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %import_ref: %Int.type = import_ref Core//prelude/types, inst+29, loaded [template = constants.%Int]
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: file {
|
|
|
-// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
|
-// CHECK:STDOUT: .Core = imports.%Core
|
|
|
-// CHECK:STDOUT: .test_i0 = %test_i0
|
|
|
-// CHECK:STDOUT: .test_i1 = %test_i1
|
|
|
-// CHECK:STDOUT: .test_i15 = %test_i15
|
|
|
-// CHECK:STDOUT: .test_i1000000000 = %test_i1000000000
|
|
|
-// CHECK:STDOUT: .test_i10000000000000000000 = %test_i10000000000000000000
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %Core.import = import Core
|
|
|
-// CHECK:STDOUT: %i0.ref: <error> = name_ref i0, <error> [template = <error>]
|
|
|
-// CHECK:STDOUT: %test_i0.var: ref <error> = var test_i0
|
|
|
-// CHECK:STDOUT: %test_i0: ref <error> = bind_name test_i0, %test_i0.var
|
|
|
-// CHECK:STDOUT: %.loc12_14.1: i32 = int_literal 1 [template = constants.%.1]
|
|
|
-// CHECK:STDOUT: %int.make_type_signed.loc12: init type = call constants.%Int(%.loc12_14.1) [template = constants.%.3]
|
|
|
-// CHECK:STDOUT: %.loc12_14.2: type = value_of_initializer %int.make_type_signed.loc12 [template = constants.%.3]
|
|
|
-// CHECK:STDOUT: %.loc12_14.3: type = converted %int.make_type_signed.loc12, %.loc12_14.2 [template = constants.%.3]
|
|
|
-// CHECK:STDOUT: %test_i1.var: ref %.3 = var test_i1
|
|
|
-// CHECK:STDOUT: %test_i1: ref %.3 = bind_name test_i1, %test_i1.var
|
|
|
-// CHECK:STDOUT: %.loc17_15.1: i32 = int_literal 15 [template = constants.%.4]
|
|
|
-// CHECK:STDOUT: %int.make_type_signed.loc17: init type = call constants.%Int(%.loc17_15.1) [template = constants.%.5]
|
|
|
-// CHECK:STDOUT: %.loc17_15.2: type = value_of_initializer %int.make_type_signed.loc17 [template = constants.%.5]
|
|
|
-// CHECK:STDOUT: %.loc17_15.3: type = converted %int.make_type_signed.loc17, %.loc17_15.2 [template = constants.%.5]
|
|
|
-// CHECK:STDOUT: %test_i15.var: ref %.5 = var test_i15
|
|
|
-// CHECK:STDOUT: %test_i15: ref %.5 = bind_name test_i15, %test_i15.var
|
|
|
-// CHECK:STDOUT: %.loc22_23.1: i32 = int_literal 1000000000 [template = constants.%.6]
|
|
|
-// CHECK:STDOUT: %int.make_type_signed.loc22: init type = call constants.%Int(%.loc22_23.1) [template = <error>]
|
|
|
-// CHECK:STDOUT: %.loc22_23.2: type = value_of_initializer %int.make_type_signed.loc22 [template = <error>]
|
|
|
-// CHECK:STDOUT: %.loc22_23.3: type = converted %int.make_type_signed.loc22, %.loc22_23.2 [template = <error>]
|
|
|
-// CHECK:STDOUT: %test_i1000000000.var: ref <error> = var test_i1000000000
|
|
|
-// CHECK:STDOUT: %test_i1000000000: ref <error> = bind_name test_i1000000000, %test_i1000000000.var
|
|
|
-// CHECK:STDOUT: %int.make_type_signed.loc28: init type = call constants.%Int(<invalid>) [template = <error>]
|
|
|
-// CHECK:STDOUT: %.loc28_33.1: type = value_of_initializer %int.make_type_signed.loc28 [template = <error>]
|
|
|
-// CHECK:STDOUT: %.loc28_33.2: type = converted %int.make_type_signed.loc28, %.loc28_33.1 [template = <error>]
|
|
|
-// CHECK:STDOUT: %test_i10000000000000000000.var: ref <error> = var test_i10000000000000000000
|
|
|
-// CHECK:STDOUT: %test_i10000000000000000000: ref <error> = bind_name test_i10000000000000000000, %test_i10000000000000000000.var
|
|
|
-// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: file {}
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: fn @Int(%size.param_patt: i32) -> type = "int.make_type_signed";
|
|
|
// CHECK:STDOUT:
|
|
|
@@ -310,58 +275,7 @@ var test_f128: f128;
|
|
|
// CHECK:STDOUT: %.6: i32 = int_literal 1000000000 [template]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: imports {
|
|
|
-// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
|
-// CHECK:STDOUT: .UInt = %import_ref
|
|
|
-// CHECK:STDOUT: import Core//prelude
|
|
|
-// CHECK:STDOUT: import Core//prelude/operators
|
|
|
-// CHECK:STDOUT: import Core//prelude/types
|
|
|
-// CHECK:STDOUT: import Core//prelude/operators/arithmetic
|
|
|
-// CHECK:STDOUT: import Core//prelude/operators/as
|
|
|
-// CHECK:STDOUT: import Core//prelude/operators/bitwise
|
|
|
-// CHECK:STDOUT: import Core//prelude/operators/comparison
|
|
|
-// CHECK:STDOUT: import Core//prelude/types/bool
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Core//prelude/types, inst+43, loaded [template = constants.%UInt]
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: file {
|
|
|
-// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
|
-// CHECK:STDOUT: .Core = imports.%Core
|
|
|
-// CHECK:STDOUT: .test_u0 = %test_u0
|
|
|
-// CHECK:STDOUT: .test_u1 = %test_u1
|
|
|
-// CHECK:STDOUT: .test_u15 = %test_u15
|
|
|
-// CHECK:STDOUT: .test_u1000000000 = %test_u1000000000
|
|
|
-// CHECK:STDOUT: .test_u10000000000000000000 = %test_u10000000000000000000
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %Core.import = import Core
|
|
|
-// CHECK:STDOUT: %u0.ref: <error> = name_ref u0, <error> [template = <error>]
|
|
|
-// CHECK:STDOUT: %test_u0.var: ref <error> = var test_u0
|
|
|
-// CHECK:STDOUT: %test_u0: ref <error> = bind_name test_u0, %test_u0.var
|
|
|
-// CHECK:STDOUT: %.loc12_14.1: i32 = int_literal 1 [template = constants.%.1]
|
|
|
-// CHECK:STDOUT: %int.make_type_unsigned.loc12: init type = call constants.%UInt(%.loc12_14.1) [template = constants.%.3]
|
|
|
-// CHECK:STDOUT: %.loc12_14.2: type = value_of_initializer %int.make_type_unsigned.loc12 [template = constants.%.3]
|
|
|
-// CHECK:STDOUT: %.loc12_14.3: type = converted %int.make_type_unsigned.loc12, %.loc12_14.2 [template = constants.%.3]
|
|
|
-// CHECK:STDOUT: %test_u1.var: ref %.3 = var test_u1
|
|
|
-// CHECK:STDOUT: %test_u1: ref %.3 = bind_name test_u1, %test_u1.var
|
|
|
-// CHECK:STDOUT: %.loc17_15.1: i32 = int_literal 15 [template = constants.%.4]
|
|
|
-// CHECK:STDOUT: %int.make_type_unsigned.loc17: init type = call constants.%UInt(%.loc17_15.1) [template = constants.%.5]
|
|
|
-// CHECK:STDOUT: %.loc17_15.2: type = value_of_initializer %int.make_type_unsigned.loc17 [template = constants.%.5]
|
|
|
-// CHECK:STDOUT: %.loc17_15.3: type = converted %int.make_type_unsigned.loc17, %.loc17_15.2 [template = constants.%.5]
|
|
|
-// CHECK:STDOUT: %test_u15.var: ref %.5 = var test_u15
|
|
|
-// CHECK:STDOUT: %test_u15: ref %.5 = bind_name test_u15, %test_u15.var
|
|
|
-// CHECK:STDOUT: %.loc22_23.1: i32 = int_literal 1000000000 [template = constants.%.6]
|
|
|
-// CHECK:STDOUT: %int.make_type_unsigned.loc22: init type = call constants.%UInt(%.loc22_23.1) [template = <error>]
|
|
|
-// CHECK:STDOUT: %.loc22_23.2: type = value_of_initializer %int.make_type_unsigned.loc22 [template = <error>]
|
|
|
-// CHECK:STDOUT: %.loc22_23.3: type = converted %int.make_type_unsigned.loc22, %.loc22_23.2 [template = <error>]
|
|
|
-// CHECK:STDOUT: %test_u1000000000.var: ref <error> = var test_u1000000000
|
|
|
-// CHECK:STDOUT: %test_u1000000000: ref <error> = bind_name test_u1000000000, %test_u1000000000.var
|
|
|
-// CHECK:STDOUT: %int.make_type_unsigned.loc28: init type = call constants.%UInt(<invalid>) [template = <error>]
|
|
|
-// CHECK:STDOUT: %.loc28_33.1: type = value_of_initializer %int.make_type_unsigned.loc28 [template = <error>]
|
|
|
-// CHECK:STDOUT: %.loc28_33.2: type = converted %int.make_type_unsigned.loc28, %.loc28_33.1 [template = <error>]
|
|
|
-// CHECK:STDOUT: %test_u10000000000000000000.var: ref <error> = var test_u10000000000000000000
|
|
|
-// CHECK:STDOUT: %test_u10000000000000000000: ref <error> = bind_name test_u10000000000000000000, %test_u10000000000000000000.var
|
|
|
-// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: file {}
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: fn @UInt(%size.param_patt: i32) -> type = "int.make_type_unsigned";
|
|
|
// CHECK:STDOUT:
|