diff --git a/lib/Sema/SemanticResolver.cpp b/lib/Sema/SemanticResolver.cpp index d1286b8fd2e..abd7274a94b 100644 --- a/lib/Sema/SemanticResolver.cpp +++ b/lib/Sema/SemanticResolver.cpp @@ -905,10 +905,6 @@ void SemanticResolver::visit(ESTree::ClassPropertyNode *node) { visitESTreeNode(*this, node->_key, node); } - // Create the these initializers even if no value initializer is present. - FunctionInfo *functionInfo = node->_static - ? curClassContext_->getOrCreateStaticElementsInitFunctionInfo() - : curClassContext_->getOrCreateInstanceElementsInitFunctionInfo(); // Visit the init expression, since it needs to be resolved. if (node->_value) { // We visit the initializer expression in the context of a synthesized @@ -920,8 +916,21 @@ void SemanticResolver::visit(ESTree::ClassPropertyNode *node) { // It is a Syntax Error if Initializer is present and ContainsArguments of // Initializer is true. llvh::SaveAndRestore oldForbidArguments{forbidArguments_, true}; - FunctionContext funcCtx(*this, functionInfo); + FunctionContext funcCtx( + *this, + node->_static + ? curClassContext_->getOrCreateStaticElementsInitFunctionInfo() + : curClassContext_->getOrCreateInstanceElementsInitFunctionInfo()); visitESTreeNode(*this, node->_value, node); + } else if (!typed_) { + // Create the these initializers even if no value initializer is present, in + // untyped mode. Typed classes don't need these initializers since we know + // the exact shape and construct it up front. + if (node->_static) { + curClassContext_->getOrCreateStaticElementsInitFunctionInfo(); + } else { + curClassContext_->getOrCreateInstanceElementsInitFunctionInfo(); + } } } diff --git a/test/IRGen/flow/class-construct-order.js b/test/IRGen/flow/class-construct-order.js index 97d8fdcf382..3039249493d 100644 --- a/test/IRGen/flow/class-construct-order.js +++ b/test/IRGen/flow/class-construct-order.js @@ -21,7 +21,7 @@ class C { // Auto-generated content below. Please do not modify manually. -// CHECK:scope %VS0 [exports: any, foo: any, C: any, : object, ?C.prototype: object] +// CHECK:scope %VS0 [exports: any, foo: any, C: any, ?C.prototype: object] // CHECK:scope %VS1 [x: any] diff --git a/test/IRGen/flow/class-super-method.js b/test/IRGen/flow/class-super-method.js index e099f70d79a..4b94f9d63ed 100644 --- a/test/IRGen/flow/class-super-method.js +++ b/test/IRGen/flow/class-super-method.js @@ -48,7 +48,7 @@ class B extends A { // CHECK-NEXT: ReturnInst %7: any // CHECK-NEXT:function_end -// CHECK:scope %VS1 [exports: any, A: any, B: any, : object, ?A.prototype: object, ?B.prototype: object] +// CHECK:scope %VS1 [exports: any, A: any, B: any, ?A.prototype: object, ?B.prototype: object] // CHECK:function ""(exports: any): any // CHECK-NEXT:%BB0: @@ -58,92 +58,79 @@ class B extends A { // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS1.exports]: any // CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.A]: any // CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.B]: any -// CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.]: object -// CHECK-NEXT: %8 = CreateFunctionInst (:object) %1: environment, %A(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %8: object, [%VS1.A]: any -// CHECK-NEXT: %10 = CreateFunctionInst (:object) %1: environment, %f(): functionCode -// CHECK-NEXT: %11 = AllocObjectLiteralInst (:object) empty: any, "f": string, %10: object -// CHECK-NEXT: StoreFrameInst %1: environment, %11: object, [%VS1.?A.prototype]: object -// CHECK-NEXT: StorePropertyStrictInst %11: object, %8: object, "prototype": string -// CHECK-NEXT: %14 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any -// CHECK-NEXT: %15 = CheckedTypeCastInst (:object) %14: any, type(object) -// CHECK-NEXT: %16 = CreateFunctionInst (:object) %1: environment, %B(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %16: object, [%VS1.B]: any -// CHECK-NEXT: %18 = LoadFrameInst (:object) %1: environment, [%VS1.?A.prototype]: object -// CHECK-NEXT: %19 = CreateFunctionInst (:object) %1: environment, %"f 1#"(): functionCode -// CHECK-NEXT: %20 = AllocObjectLiteralInst (:object) empty: any, "f": string, %19: object -// CHECK-NEXT: TypedStoreParentInst %18: object, %20: object -// CHECK-NEXT: StoreFrameInst %1: environment, %20: object, [%VS1.?B.prototype]: object -// CHECK-NEXT: StorePropertyStrictInst %20: object, %16: object, "prototype": string +// CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %A(): functionCode +// CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.A]: any +// CHECK-NEXT: %8 = CreateFunctionInst (:object) %1: environment, %f(): functionCode +// CHECK-NEXT: %9 = AllocObjectLiteralInst (:object) empty: any, "f": string, %8: object +// CHECK-NEXT: StoreFrameInst %1: environment, %9: object, [%VS1.?A.prototype]: object +// CHECK-NEXT: StorePropertyStrictInst %9: object, %6: object, "prototype": string +// CHECK-NEXT: %12 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any +// CHECK-NEXT: %13 = CheckedTypeCastInst (:object) %12: any, type(object) +// CHECK-NEXT: %14 = CreateFunctionInst (:object) %1: environment, %B(): functionCode +// CHECK-NEXT: StoreFrameInst %1: environment, %14: object, [%VS1.B]: any +// CHECK-NEXT: %16 = LoadFrameInst (:object) %1: environment, [%VS1.?A.prototype]: object +// CHECK-NEXT: %17 = CreateFunctionInst (:object) %1: environment, %"f 1#"(): functionCode +// CHECK-NEXT: %18 = AllocObjectLiteralInst (:object) empty: any, "f": string, %17: object +// CHECK-NEXT: TypedStoreParentInst %16: object, %18: object +// CHECK-NEXT: StoreFrameInst %1: environment, %18: object, [%VS1.?B.prototype]: object +// CHECK-NEXT: StorePropertyStrictInst %18: object, %14: object, "prototype": string // CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end -// CHECK:scope %VS2 [] - -// CHECK:function (): undefined -// CHECK-NEXT:%BB0: -// CHECK-NEXT: %0 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %1 = CreateScopeInst (:environment) %VS2: any, %0: environment -// CHECK-NEXT: ReturnInst undefined: undefined -// CHECK-NEXT:function_end - -// CHECK:scope %VS3 [x: any] +// CHECK:scope %VS2 [x: any] // CHECK:constructor A(x: number): any [typed] // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = LoadParamInst (:object) %: object // CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS3: any, %1: environment +// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS2: any, %1: environment // CHECK-NEXT: %3 = LoadParamInst (:number) %x: number -// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS3.x]: any -// CHECK-NEXT: %5 = LoadFrameInst (:object) %1: environment, [%VS1.]: object -// CHECK-NEXT: %6 = CallInst (:undefined) %5: object, %(): functionCode, true: boolean, empty: any, undefined: undefined, %0: object -// CHECK-NEXT: %7 = LoadFrameInst (:any) %2: environment, [%VS3.x]: any -// CHECK-NEXT: %8 = CheckedTypeCastInst (:number) %7: any, type(number) -// CHECK-NEXT: PrStoreInst %8: number, %0: object, 0: number, "x": string, true: boolean -// CHECK-NEXT: ReturnInst undefined: undefined +// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS2.x]: any +// CHECK-NEXT: %5 = LoadFrameInst (:any) %2: environment, [%VS2.x]: any +// CHECK-NEXT: %6 = CheckedTypeCastInst (:number) %5: any, type(number) +// CHECK-NEXT: PrStoreInst %6: number, %0: object, 0: number, "x": string, true: boolean +// CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end -// CHECK:scope %VS4 [] +// CHECK:scope %VS3 [] // CHECK:function f(): any [typed] // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = LoadParamInst (:object) %: object // CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS4: any, %1: environment +// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS3: any, %1: environment // CHECK-NEXT: %3 = PrLoadInst (:number) %0: object, 0: number, "x": string // CHECK-NEXT: %4 = BinaryMultiplyInst (:any) %3: number, 10: number // CHECK-NEXT: %5 = CheckedTypeCastInst (:number) %4: any, type(number) // CHECK-NEXT: ReturnInst %5: number // CHECK-NEXT:function_end -// CHECK:scope %VS5 [x: any] +// CHECK:scope %VS4 [x: any] // CHECK:constructor B(x: number): any [typed] // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = LoadParamInst (:object) %: object // CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS5: any, %1: environment +// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS4: any, %1: environment // CHECK-NEXT: %3 = LoadParamInst (:number) %x: number -// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS5.x]: any +// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS4.x]: any // CHECK-NEXT: %5 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any // CHECK-NEXT: %6 = CheckedTypeCastInst (:object) %5: any, type(object) // CHECK-NEXT: %7 = GetNewTargetInst (:object) %new.target: object -// CHECK-NEXT: %8 = LoadFrameInst (:any) %2: environment, [%VS5.x]: any +// CHECK-NEXT: %8 = LoadFrameInst (:any) %2: environment, [%VS4.x]: any // CHECK-NEXT: %9 = CheckedTypeCastInst (:number) %8: any, type(number) // CHECK-NEXT: %10 = CallInst [njsf] (:any) %6: object, empty: any, false: boolean, empty: any, %7: object, %0: object, %9: number // CHECK-NEXT: %11 = CheckedTypeCastInst (:undefined) %10: any, type(undefined) // CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end -// CHECK:scope %VS6 [] +// CHECK:scope %VS5 [] // CHECK:function "f 1#"(): any [typed] // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = LoadParamInst (:object) %: object // CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS6: any, %1: environment +// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS5: any, %1: environment // CHECK-NEXT: %3 = LoadFrameInst (:object) %1: environment, [%VS1.?A.prototype]: object // CHECK-NEXT: %4 = PrLoadInst (:object) %3: object, 0: number, "f": string // CHECK-NEXT: %5 = CallInst [njsf] (:any) %4: object, empty: any, false: boolean, empty: any, undefined: undefined, %0: object diff --git a/test/IRGen/flow/class-super-prop.js b/test/IRGen/flow/class-super-prop.js index d08c4306f97..4e162b99986 100644 --- a/test/IRGen/flow/class-super-prop.js +++ b/test/IRGen/flow/class-super-prop.js @@ -44,7 +44,7 @@ class B extends A { // CHECK-NEXT: ReturnInst %7: any // CHECK-NEXT:function_end -// CHECK:scope %VS1 [exports: any, A: any, B: any, : object, ?A.prototype: object, ?B.prototype: object] +// CHECK:scope %VS1 [exports: any, A: any, B: any, ?A.prototype: object, ?B.prototype: object] // CHECK:function ""(exports: any): any // CHECK-NEXT:%BB0: @@ -54,78 +54,65 @@ class B extends A { // CHECK-NEXT: StoreFrameInst %1: environment, %2: any, [%VS1.exports]: any // CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.A]: any // CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.B]: any -// CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.]: object -// CHECK-NEXT: %8 = CreateFunctionInst (:object) %1: environment, %A(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %8: object, [%VS1.A]: any -// CHECK-NEXT: %10 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreFrameInst %1: environment, %10: object, [%VS1.?A.prototype]: object -// CHECK-NEXT: StorePropertyStrictInst %10: object, %8: object, "prototype": string -// CHECK-NEXT: %13 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any -// CHECK-NEXT: %14 = CheckedTypeCastInst (:object) %13: any, type(object) -// CHECK-NEXT: %15 = CreateFunctionInst (:object) %1: environment, %B(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %15: object, [%VS1.B]: any -// CHECK-NEXT: %17 = LoadFrameInst (:object) %1: environment, [%VS1.?A.prototype]: object -// CHECK-NEXT: %18 = CreateFunctionInst (:object) %1: environment, %f(): functionCode -// CHECK-NEXT: %19 = AllocObjectLiteralInst (:object) empty: any, "f": string, %18: object -// CHECK-NEXT: TypedStoreParentInst %17: object, %19: object -// CHECK-NEXT: StoreFrameInst %1: environment, %19: object, [%VS1.?B.prototype]: object -// CHECK-NEXT: StorePropertyStrictInst %19: object, %15: object, "prototype": string +// CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %A(): functionCode +// CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.A]: any +// CHECK-NEXT: %8 = AllocObjectLiteralInst (:object) empty: any +// CHECK-NEXT: StoreFrameInst %1: environment, %8: object, [%VS1.?A.prototype]: object +// CHECK-NEXT: StorePropertyStrictInst %8: object, %6: object, "prototype": string +// CHECK-NEXT: %11 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any +// CHECK-NEXT: %12 = CheckedTypeCastInst (:object) %11: any, type(object) +// CHECK-NEXT: %13 = CreateFunctionInst (:object) %1: environment, %B(): functionCode +// CHECK-NEXT: StoreFrameInst %1: environment, %13: object, [%VS1.B]: any +// CHECK-NEXT: %15 = LoadFrameInst (:object) %1: environment, [%VS1.?A.prototype]: object +// CHECK-NEXT: %16 = CreateFunctionInst (:object) %1: environment, %f(): functionCode +// CHECK-NEXT: %17 = AllocObjectLiteralInst (:object) empty: any, "f": string, %16: object +// CHECK-NEXT: TypedStoreParentInst %15: object, %17: object +// CHECK-NEXT: StoreFrameInst %1: environment, %17: object, [%VS1.?B.prototype]: object +// CHECK-NEXT: StorePropertyStrictInst %17: object, %13: object, "prototype": string // CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end -// CHECK:scope %VS2 [] - -// CHECK:function (): undefined -// CHECK-NEXT:%BB0: -// CHECK-NEXT: %0 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %1 = CreateScopeInst (:environment) %VS2: any, %0: environment -// CHECK-NEXT: ReturnInst undefined: undefined -// CHECK-NEXT:function_end - -// CHECK:scope %VS3 [x: any] +// CHECK:scope %VS2 [x: any] // CHECK:constructor A(x: number): any [typed] // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = LoadParamInst (:object) %: object // CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS3: any, %1: environment +// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS2: any, %1: environment // CHECK-NEXT: %3 = LoadParamInst (:number) %x: number -// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS3.x]: any -// CHECK-NEXT: %5 = LoadFrameInst (:object) %1: environment, [%VS1.]: object -// CHECK-NEXT: %6 = CallInst (:undefined) %5: object, %(): functionCode, true: boolean, empty: any, undefined: undefined, %0: object -// CHECK-NEXT: %7 = LoadFrameInst (:any) %2: environment, [%VS3.x]: any -// CHECK-NEXT: %8 = CheckedTypeCastInst (:number) %7: any, type(number) -// CHECK-NEXT: PrStoreInst %8: number, %0: object, 0: number, "x": string, true: boolean -// CHECK-NEXT: ReturnInst undefined: undefined +// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS2.x]: any +// CHECK-NEXT: %5 = LoadFrameInst (:any) %2: environment, [%VS2.x]: any +// CHECK-NEXT: %6 = CheckedTypeCastInst (:number) %5: any, type(number) +// CHECK-NEXT: PrStoreInst %6: number, %0: object, 0: number, "x": string, true: boolean +// CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end -// CHECK:scope %VS4 [x: any] +// CHECK:scope %VS3 [x: any] // CHECK:constructor B(x: number): any [typed] // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = LoadParamInst (:object) %: object // CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS4: any, %1: environment +// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS3: any, %1: environment // CHECK-NEXT: %3 = LoadParamInst (:number) %x: number -// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS4.x]: any +// CHECK-NEXT: StoreFrameInst %2: environment, %3: number, [%VS3.x]: any // CHECK-NEXT: %5 = LoadFrameInst (:any) %1: environment, [%VS1.A]: any // CHECK-NEXT: %6 = CheckedTypeCastInst (:object) %5: any, type(object) // CHECK-NEXT: %7 = GetNewTargetInst (:object) %new.target: object -// CHECK-NEXT: %8 = LoadFrameInst (:any) %2: environment, [%VS4.x]: any +// CHECK-NEXT: %8 = LoadFrameInst (:any) %2: environment, [%VS3.x]: any // CHECK-NEXT: %9 = CheckedTypeCastInst (:number) %8: any, type(number) // CHECK-NEXT: %10 = CallInst [njsf] (:any) %6: object, empty: any, false: boolean, empty: any, %7: object, %0: object, %9: number // CHECK-NEXT: %11 = CheckedTypeCastInst (:undefined) %10: any, type(undefined) // CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end -// CHECK:scope %VS5 [] +// CHECK:scope %VS4 [] // CHECK:function f(): any [typed] // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = LoadParamInst (:object) %: object // CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS5: any, %1: environment +// CHECK-NEXT: %2 = CreateScopeInst (:environment) %VS4: any, %1: environment // CHECK-NEXT: %3 = PrLoadInst (:number) %0: object, 0: number, "x": string // CHECK-NEXT: ReturnInst %3: number // CHECK-NEXT:function_end diff --git a/test/Optimizer/flow/inline-constructor-small.js b/test/Optimizer/flow/inline-constructor-small.js index 6e655812d10..bfe0e80cc55 100644 --- a/test/Optimizer/flow/inline-constructor-small.js +++ b/test/Optimizer/flow/inline-constructor-small.js @@ -33,17 +33,9 @@ print(p1.x, p2.x); // CHECK-NEXT: %1 = CreateFunctionInst (:object) %0: environment, %Point(): functionCode // CHECK-NEXT: %2 = AllocObjectLiteralInst (:object) empty: any // CHECK-NEXT: StorePropertyStrictInst %2: object, %1: object, "prototype": string -// CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any, "x": string, 0: number, "y": string, 0: number -// CHECK-NEXT: TypedStoreParentInst %2: object, %4: object -// CHECK-NEXT: %6 = CallInst (:undefined) %1: object, %Point(): functionCode, true: boolean, empty: any, %1: object, %4: object, 1: number, 2: number -// CHECK-NEXT: %7 = AllocObjectLiteralInst (:object) empty: any, "x": string, 0: number, "y": string, 0: number -// CHECK-NEXT: TypedStoreParentInst %2: object, %7: object -// CHECK-NEXT: %9 = CallInst (:undefined) %1: object, %Point(): functionCode, true: boolean, empty: any, %1: object, %7: object, 3: number, 4: number -// CHECK-NEXT: %10 = TryLoadGlobalPropertyInst (:any) globalObject: object, "print": string -// CHECK-NEXT: %11 = PrLoadInst (:number) %4: object, 0: number, "x": string -// CHECK-NEXT: %12 = PrLoadInst (:number) %7: object, 0: number, "x": string -// CHECK-NEXT: %13 = CallInst (:any) %10: any, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, %11: number, %12: number -// CHECK-NEXT: ReturnInst undefined: undefined +// CHECK-NEXT: %4 = TryLoadGlobalPropertyInst (:any) globalObject: object, "print": string +// CHECK-NEXT: %5 = CallInst (:any) %4: any, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, 1: number, 3: number +// CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end // CHECK:constructor Point(x: number, y: number): undefined [typed] diff --git a/test/Optimizer/object-with-object-field-alloc.js b/test/Optimizer/object-with-object-field-alloc.js index 6cd2dfba25a..642bab9e546 100644 --- a/test/Optimizer/object-with-object-field-alloc.js +++ b/test/Optimizer/object-with-object-field-alloc.js @@ -31,25 +31,24 @@ new Foo(); // CHECK:scope %VS0 [] -// CHECK:scope %VS1 [O: object, ?O.prototype: object] +// CHECK:scope %VS1 [?O.prototype: object] // CHECK:function global(): undefined // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = CreateScopeInst (:environment) %VS0: any, empty: any // CHECK-NEXT: %1 = CreateScopeInst (:environment) %VS1: any, %0: environment -// CHECK-NEXT: %2 = CreateFunctionInst (:object) %1: environment, %O(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %2: object, [%VS1.O]: object -// CHECK-NEXT: %4 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreFrameInst %1: environment, %4: object, [%VS1.?O.prototype]: object -// CHECK-NEXT: StorePropertyStrictInst %4: object, %2: object, "prototype": string -// CHECK-NEXT: %7 = CreateFunctionInst (:object) %1: environment, %Foo(): functionCode -// CHECK-NEXT: %8 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StorePropertyStrictInst %8: object, %7: object, "prototype": string -// CHECK-NEXT: %10 = HBCAllocObjectFromBufferInst (:object) "o0": string, 0: number, "o1": string, 0: number, "o2": string, 0: number -// CHECK-NEXT: TypedStoreParentInst %8: object, %10: object -// CHECK-NEXT: %12 = CallInst (:undefined) %7: object, %Foo(): functionCode, true: boolean, empty: any, %7: object, %10: object -// CHECK-NEXT: %13 = HBCLoadConstInst (:undefined) undefined: undefined -// CHECK-NEXT: ReturnInst %13: undefined +// CHECK-NEXT: %2 = AllocObjectLiteralInst (:object) empty: any +// CHECK-NEXT: StoreFrameInst %1: environment, %2: object, [%VS1.?O.prototype]: object +// CHECK-NEXT: %4 = CreateFunctionInst (:object) %1: environment, %O(): functionCode +// CHECK-NEXT: StorePropertyStrictInst %2: object, %4: object, "prototype": string +// CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %Foo(): functionCode +// CHECK-NEXT: %7 = AllocObjectLiteralInst (:object) empty: any +// CHECK-NEXT: StorePropertyStrictInst %7: object, %6: object, "prototype": string +// CHECK-NEXT: %9 = HBCAllocObjectFromBufferInst (:object) "o0": string, 0: number, "o1": string, 0: number, "o2": string, 0: number +// CHECK-NEXT: TypedStoreParentInst %7: object, %9: object +// CHECK-NEXT: %11 = CallInst (:undefined) %6: object, %Foo(): functionCode, true: boolean, empty: any, %6: object, %9: object +// CHECK-NEXT: %12 = HBCLoadConstInst (:undefined) undefined: undefined +// CHECK-NEXT: ReturnInst %12: undefined // CHECK-NEXT:function_end // CHECK:constructor O(): undefined [typed] @@ -65,19 +64,19 @@ new Foo(); // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = LoadParamInst (:object) %: object // CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %2 = LoadFrameInst (:object) %1: environment, [%VS1.O]: object -// CHECK-NEXT: %3 = LoadFrameInst (:object) %1: environment, [%VS1.?O.prototype]: object -// CHECK-NEXT: %4 = HBCAllocObjectFromBufferInst (:object) "i": string, 0: number -// CHECK-NEXT: TypedStoreParentInst %3: object, %4: object -// CHECK-NEXT: %6 = CallInst (:undefined) %2: object, %O(): functionCode, true: boolean, empty: any, %2: object, %4: object -// CHECK-NEXT: PrStoreInst %4: object, %0: object, 0: number, "o0": string, false: boolean +// CHECK-NEXT: %2 = LoadFrameInst (:object) %1: environment, [%VS1.?O.prototype]: object +// CHECK-NEXT: %3 = HBCAllocObjectFromBufferInst (:object) "i": string, 0: number +// CHECK-NEXT: TypedStoreParentInst %2: object, %3: object +// CHECK-NEXT: %5 = HBCLoadConstInst (:number) 7: number +// CHECK-NEXT: PrStoreInst %5: number, %3: object, 0: number, "i": string, true: boolean +// CHECK-NEXT: PrStoreInst %3: object, %0: object, 0: number, "o0": string, false: boolean // CHECK-NEXT: %8 = HBCAllocObjectFromBufferInst (:object) "i": string, 0: number -// CHECK-NEXT: TypedStoreParentInst %3: object, %8: object -// CHECK-NEXT: %10 = CallInst (:undefined) %2: object, %O(): functionCode, true: boolean, empty: any, %2: object, %8: object +// CHECK-NEXT: TypedStoreParentInst %2: object, %8: object +// CHECK-NEXT: PrStoreInst %5: number, %8: object, 0: number, "i": string, true: boolean // CHECK-NEXT: PrStoreInst %8: object, %0: object, 1: number, "o1": string, false: boolean // CHECK-NEXT: %12 = HBCAllocObjectFromBufferInst (:object) "i": string, 0: number -// CHECK-NEXT: TypedStoreParentInst %3: object, %12: object -// CHECK-NEXT: %14 = CallInst (:undefined) %2: object, %O(): functionCode, true: boolean, empty: any, %2: object, %12: object +// CHECK-NEXT: TypedStoreParentInst %2: object, %12: object +// CHECK-NEXT: PrStoreInst %5: number, %12: object, 0: number, "i": string, true: boolean // CHECK-NEXT: PrStoreInst %12: object, %0: object, 2: number, "o2": string, false: boolean // CHECK-NEXT: %16 = HBCLoadConstInst (:undefined) undefined: undefined // CHECK-NEXT: ReturnInst %16: undefined diff --git a/test/Optimizer/uninit-prop-access-opt.js b/test/Optimizer/uninit-prop-access-opt.js index 26efe316143..154042a956c 100644 --- a/test/Optimizer/uninit-prop-access-opt.js +++ b/test/Optimizer/uninit-prop-access-opt.js @@ -49,7 +49,7 @@ print(f()); // CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end -// CHECK:scope %VS1 [O: object, Foo: undefined|object, : object, ?O.prototype: object, : object, ?Foo.prototype: object] +// CHECK:scope %VS1 [O: object, Foo: undefined|object, ?O.prototype: object, ?Foo.prototype: object] // CHECK:function ""(exports: number): undefined [allCallsitesKnownInStrictMode] // CHECK-NEXT:%BB0: @@ -57,23 +57,19 @@ print(f()); // CHECK-NEXT: %1 = CreateScopeInst (:environment) %VS1: any, %0: environment // CHECK-NEXT: StoreFrameInst %1: environment, undefined: undefined, [%VS1.Foo]: undefined|object // CHECK-NEXT: %3 = CreateFunctionInst (:object) %1: environment, %f(): functionCode -// CHECK-NEXT: %4 = CreateFunctionInst (:object) %1: environment, %(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %4: object, [%VS1.]: object -// CHECK-NEXT: %6 = CreateFunctionInst (:object) %1: environment, %O(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.O]: object -// CHECK-NEXT: %8 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreFrameInst %1: environment, %8: object, [%VS1.?O.prototype]: object -// CHECK-NEXT: StorePropertyStrictInst %8: object, %6: object, "prototype": string -// CHECK-NEXT: %11 = CreateFunctionInst (:object) %1: environment, %(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %11: object, [%VS1.]: object -// CHECK-NEXT: %13 = CreateFunctionInst (:object) %1: environment, %Foo(): functionCode -// CHECK-NEXT: StoreFrameInst %1: environment, %13: object, [%VS1.Foo]: undefined|object -// CHECK-NEXT: %15 = AllocObjectLiteralInst (:object) empty: any -// CHECK-NEXT: StoreFrameInst %1: environment, %15: object, [%VS1.?Foo.prototype]: object -// CHECK-NEXT: StorePropertyStrictInst %15: object, %13: object, "prototype": string -// CHECK-NEXT: %18 = TryLoadGlobalPropertyInst (:any) globalObject: object, "print": string -// CHECK-NEXT: %19 = CallInst [njsf] (:undefined) %3: object, %f(): functionCode, true: boolean, %1: environment, undefined: undefined, 0: number -// CHECK-NEXT: %20 = CallInst (:any) %18: any, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, undefined: undefined +// CHECK-NEXT: %4 = CreateFunctionInst (:object) %1: environment, %O(): functionCode +// CHECK-NEXT: StoreFrameInst %1: environment, %4: object, [%VS1.O]: object +// CHECK-NEXT: %6 = AllocObjectLiteralInst (:object) empty: any +// CHECK-NEXT: StoreFrameInst %1: environment, %6: object, [%VS1.?O.prototype]: object +// CHECK-NEXT: StorePropertyStrictInst %6: object, %4: object, "prototype": string +// CHECK-NEXT: %9 = CreateFunctionInst (:object) %1: environment, %Foo(): functionCode +// CHECK-NEXT: StoreFrameInst %1: environment, %9: object, [%VS1.Foo]: undefined|object +// CHECK-NEXT: %11 = AllocObjectLiteralInst (:object) empty: any +// CHECK-NEXT: StoreFrameInst %1: environment, %11: object, [%VS1.?Foo.prototype]: object +// CHECK-NEXT: StorePropertyStrictInst %11: object, %9: object, "prototype": string +// CHECK-NEXT: %14 = TryLoadGlobalPropertyInst (:any) globalObject: object, "print": string +// CHECK-NEXT: %15 = CallInst [njsf] (:undefined) %3: object, %f(): functionCode, true: boolean, %1: environment, undefined: undefined, 0: number +// CHECK-NEXT: %16 = CallInst (:any) %14: any, empty: any, false: boolean, empty: any, undefined: undefined, undefined: undefined, undefined: undefined // CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end @@ -89,40 +85,25 @@ print(f()); // CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end -// CHECK:function (): undefined [allCallsitesKnownInStrictMode] -// CHECK-NEXT:%BB0: -// CHECK-NEXT: ReturnInst undefined: undefined -// CHECK-NEXT:function_end - // CHECK:constructor O(): undefined [typed] // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = LoadParamInst (:object) %: object -// CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %2 = LoadFrameInst (:object) %1: environment, [%VS1.]: object -// CHECK-NEXT: %3 = CallInst (:undefined) %2: object, %(): functionCode, true: boolean, empty: any, undefined: undefined, 0: number // CHECK-NEXT: PrStoreInst 7: number, %0: object, 0: number, "i": string, true: boolean // CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end -// CHECK:function (): undefined [allCallsitesKnownInStrictMode] -// CHECK-NEXT:%BB0: -// CHECK-NEXT: ReturnInst undefined: undefined -// CHECK-NEXT:function_end - // CHECK:constructor Foo(): undefined [typed] // CHECK-NEXT:%BB0: // CHECK-NEXT: %0 = LoadParamInst (:object) %: object // CHECK-NEXT: %1 = GetParentScopeInst (:environment) %VS1: any, %parentScope: environment -// CHECK-NEXT: %2 = LoadFrameInst (:object) %1: environment, [%VS1.]: object -// CHECK-NEXT: %3 = CallInst (:undefined) %2: object, %(): functionCode, true: boolean, empty: any, undefined: undefined, 0: number -// CHECK-NEXT: %4 = PrLoadInst (:object) %0: object, 0: number, "o": string -// CHECK-NEXT: %5 = PrLoadInst (:number) %4: object, 0: number, "i": string -// CHECK-NEXT: PrStoreInst %5: number, %0: object, 1: number, "y": string, true: boolean -// CHECK-NEXT: %7 = LoadFrameInst (:object) %1: environment, [%VS1.O]: object -// CHECK-NEXT: %8 = LoadFrameInst (:object) %1: environment, [%VS1.?O.prototype]: object -// CHECK-NEXT: %9 = AllocObjectLiteralInst (:object) empty: any, "i": string, 0: number -// CHECK-NEXT: TypedStoreParentInst %8: object, %9: object -// CHECK-NEXT: %11 = CallInst (:undefined) %7: object, %O(): functionCode, true: boolean, %1: environment, %7: object, %9: object -// CHECK-NEXT: PrStoreInst %9: object, %0: object, 0: number, "o": string, false: boolean +// CHECK-NEXT: %2 = PrLoadInst (:object) %0: object, 0: number, "o": string +// CHECK-NEXT: %3 = PrLoadInst (:number) %2: object, 0: number, "i": string +// CHECK-NEXT: PrStoreInst %3: number, %0: object, 1: number, "y": string, true: boolean +// CHECK-NEXT: %5 = LoadFrameInst (:object) %1: environment, [%VS1.O]: object +// CHECK-NEXT: %6 = LoadFrameInst (:object) %1: environment, [%VS1.?O.prototype]: object +// CHECK-NEXT: %7 = AllocObjectLiteralInst (:object) empty: any, "i": string, 0: number +// CHECK-NEXT: TypedStoreParentInst %6: object, %7: object +// CHECK-NEXT: %9 = CallInst (:undefined) %5: object, %O(): functionCode, true: boolean, empty: any, %5: object, %7: object +// CHECK-NEXT: PrStoreInst %7: object, %0: object, 0: number, "o": string, false: boolean // CHECK-NEXT: ReturnInst undefined: undefined // CHECK-NEXT:function_end diff --git a/test/Parser/arguments-field-error.js b/test/Parser/arguments-field-error.js index ab56541d63f..99270049680 100644 --- a/test/Parser/arguments-field-error.js +++ b/test/Parser/arguments-field-error.js @@ -18,3 +18,4 @@ function* foo() { // CHECK:{{.*}}arguments-field-error.js:12:15: error: invalid use of 'arguments' // CHECK-NEXT: x = () => arguments; // CHECK-NEXT: ^~~~~~~~~ +// CHECK-NEXT:Emitted 1 errors. exiting. diff --git a/test/Parser/yield-field-error.js b/test/Parser/yield-field-error.js index a57e31d1eda..553ac5a7c51 100644 --- a/test/Parser/yield-field-error.js +++ b/test/Parser/yield-field-error.js @@ -18,3 +18,4 @@ function* foo() { // CHECK:{{.*}}yield-field-error.js:12:9: error: invalid expression // CHECK-NEXT: x = yield; // CHECK-NEXT: ^ +// CHECK-NEXT:Emitted 1 errors. exiting. diff --git a/test/Sema/flow/generic-class-alias.js b/test/Sema/flow/generic-class-alias.js index 7b86dd8d097..518b457b2ea 100644 --- a/test/Sema/flow/generic-class-alias.js +++ b/test/Sema/flow/generic-class-alias.js @@ -110,10 +110,6 @@ let z: Z; // CHECK-NEXT: Scope %s.3 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.4 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.5 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.6 // CHECK:Program Scope %s.1 // CHECK-NEXT: ExpressionStatement diff --git a/test/Sema/flow/generic-class-chained-inheritance.js b/test/Sema/flow/generic-class-chained-inheritance.js index c85374c521f..155aa026674 100644 --- a/test/Sema/flow/generic-class-chained-inheritance.js +++ b/test/Sema/flow/generic-class-chained-inheritance.js @@ -81,19 +81,15 @@ class C extends B { // CHECK-NEXT: Scope %s.4 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.5 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.6 // CHECK-NEXT: Decl %d.11 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.7 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.8 +// CHECK-NEXT: Scope %s.6 // CHECK-NEXT: Decl %d.12 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.9 +// CHECK-NEXT: Scope %s.7 // CHECK-NEXT: Decl %d.13 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.10 +// CHECK-NEXT: Scope %s.8 // CHECK-NEXT: Decl %d.14 'arguments' Var Arguments // CHECK:Program Scope %s.1 diff --git a/test/Sema/flow/generic-class-chained.js b/test/Sema/flow/generic-class-chained.js index 829d68adcb7..b51a3f12f29 100644 --- a/test/Sema/flow/generic-class-chained.js +++ b/test/Sema/flow/generic-class-chained.js @@ -66,23 +66,21 @@ class C { // CHECK-NEXT: Scope %s.3 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.4 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.5 // CHECK-NEXT: Decl %d.8 'c' Let // CHECK-NEXT: Decl %d.9 'arguments' Var Arguments // CHECK-NEXT: Func strict +// CHECK-NEXT: Scope %s.5 +// CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.6 +// CHECK-NEXT: Decl %d.10 'arguments' Var Arguments // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.7 -// CHECK-NEXT: Decl %d.10 'arguments' Var Arguments // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.8 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.9 // CHECK-NEXT: Decl %d.11 'c' Let : %class.9 // CHECK-NEXT: Decl %d.12 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.10 +// CHECK-NEXT: Scope %s.9 // CHECK-NEXT: Decl %d.13 'arguments' Var Arguments // CHECK:Program Scope %s.1 diff --git a/test/Sema/flow/generic-class-cycle.js b/test/Sema/flow/generic-class-cycle.js index 19871d2f7a7..665b27ce93d 100644 --- a/test/Sema/flow/generic-class-cycle.js +++ b/test/Sema/flow/generic-class-cycle.js @@ -61,18 +61,14 @@ class BBB { // CHECK-NEXT: Decl %d.5 'BBB' Class : %class_constructor.10 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.3 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.4 // CHECK-NEXT: Decl %d.6 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.5 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.6 +// CHECK-NEXT: Scope %s.4 // CHECK-NEXT: Decl %d.7 'root' Parameter // CHECK-NEXT: Decl %d.8 'val' Parameter // CHECK-NEXT: Decl %d.9 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.7 +// CHECK-NEXT: Scope %s.5 // CHECK-NEXT: Decl %d.10 'root' Parameter : %class.2 // CHECK-NEXT: Decl %d.11 'val' Parameter : number // CHECK-NEXT: Decl %d.12 'arguments' Var Arguments diff --git a/test/Sema/flow/generic-class-dedup.js b/test/Sema/flow/generic-class-dedup.js index ea2bff197ac..c41daff657c 100644 --- a/test/Sema/flow/generic-class-dedup.js +++ b/test/Sema/flow/generic-class-dedup.js @@ -47,12 +47,10 @@ c1 = new C('abc'); // CHECK-NEXT: Decl %d.5 'C' Class : %class_constructor.6 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.3 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.4 // CHECK-NEXT: Decl %d.6 'x' Parameter // CHECK-NEXT: Decl %d.7 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.5 +// CHECK-NEXT: Scope %s.4 // CHECK-NEXT: Decl %d.8 'x' Parameter : %union.2 // CHECK-NEXT: Decl %d.9 'arguments' Var Arguments diff --git a/test/Sema/flow/generic-class-id.js b/test/Sema/flow/generic-class-id.js index 8843dde8d29..b541821e8e2 100644 --- a/test/Sema/flow/generic-class-id.js +++ b/test/Sema/flow/generic-class-id.js @@ -61,16 +61,14 @@ const s: string = i2.val; // CHECK-NEXT: Decl %d.9 'ID' Class : %class_constructor.9 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.3 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.4 // CHECK-NEXT: Decl %d.10 'val' Parameter // CHECK-NEXT: Decl %d.11 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.5 +// CHECK-NEXT: Scope %s.4 // CHECK-NEXT: Decl %d.12 'val' Parameter : number // CHECK-NEXT: Decl %d.13 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.6 +// CHECK-NEXT: Scope %s.5 // CHECK-NEXT: Decl %d.14 'val' Parameter : string // CHECK-NEXT: Decl %d.15 'arguments' Var Arguments diff --git a/test/Sema/flow/generic-class-method.js b/test/Sema/flow/generic-class-method.js index 45813af4cd6..b84ba46f165 100644 --- a/test/Sema/flow/generic-class-method.js +++ b/test/Sema/flow/generic-class-method.js @@ -68,21 +68,17 @@ class C { // CHECK-NEXT: Scope %s.3 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.4 +// CHECK-NEXT: Decl %d.7 'arguments' Var Arguments // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.5 -// CHECK-NEXT: Decl %d.7 'arguments' Var Arguments // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.6 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.7 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.8 // CHECK-NEXT: Decl %d.8 'b' Let // CHECK-NEXT: Decl %d.9 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.9 +// CHECK-NEXT: Scope %s.7 // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.10 +// CHECK-NEXT: Scope %s.8 // CHECK-NEXT: Decl %d.10 'b' Let : %class.6 // CHECK-NEXT: Decl %d.11 'arguments' Var Arguments diff --git a/test/Sema/flow/generic-class-union.js b/test/Sema/flow/generic-class-union.js index c733bdc8aaf..6253c734786 100644 --- a/test/Sema/flow/generic-class-union.js +++ b/test/Sema/flow/generic-class-union.js @@ -50,8 +50,6 @@ class B { // CHECK-NEXT: Scope %s.3 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.4 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.5 // CHECK:Program Scope %s.1 // CHECK-NEXT: ExpressionStatement diff --git a/test/Sema/flow/generic-class-var-type.js b/test/Sema/flow/generic-class-var-type.js index ab67bc415f7..f72a2759884 100644 --- a/test/Sema/flow/generic-class-var-type.js +++ b/test/Sema/flow/generic-class-var-type.js @@ -83,21 +83,17 @@ new F(); // CHECK-NEXT: Scope %s.3 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.4 +// CHECK-NEXT: Decl %d.10 'arguments' Var Arguments // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.5 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.6 -// CHECK-NEXT: Decl %d.10 'arguments' Var Arguments -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.7 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.8 // CHECK-NEXT: Decl %d.11 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.9 +// CHECK-NEXT: Scope %s.7 // CHECK-NEXT: Decl %d.12 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.10 +// CHECK-NEXT: Scope %s.8 // CHECK-NEXT: Decl %d.13 'arguments' Var Arguments // CHECK:Program Scope %s.1 diff --git a/test/Sema/flow/generic-type-alias.js b/test/Sema/flow/generic-type-alias.js index 96a0ec8a757..3fed937d784 100644 --- a/test/Sema/flow/generic-type-alias.js +++ b/test/Sema/flow/generic-type-alias.js @@ -68,8 +68,6 @@ var d: A; // CHECK-NEXT: Decl %d.8 'Cls' Class : %class_constructor.16 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.3 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.4 // CHECK:Program Scope %s.1 // CHECK-NEXT: ExpressionStatement diff --git a/test/Sema/flow/type-refinement.js b/test/Sema/flow/type-refinement.js index 6911c6162cf..0af767d01a4 100644 --- a/test/Sema/flow/type-refinement.js +++ b/test/Sema/flow/type-refinement.js @@ -78,32 +78,30 @@ function retval(c: C | null): C { // CHECK-NEXT: Scope %s.3 // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.4 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.5 // CHECK-NEXT: Decl %d.8 'cur' Parameter : %union.4 // CHECK-NEXT: Decl %d.9 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.6 +// CHECK-NEXT: Scope %s.5 // CHECK-NEXT: Decl %d.10 'cur' Parameter : %union.4 // CHECK-NEXT: Decl %d.11 'bar' Var : %function.10 // CHECK-NEXT: Decl %d.12 'arguments' Var Arguments // CHECK-NEXT: hoistedFunction bar -// CHECK-NEXT: Scope %s.7 +// CHECK-NEXT: Scope %s.6 // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.8 +// CHECK-NEXT: Scope %s.7 // CHECK-NEXT: Decl %d.13 'c' Parameter : %class.2 // CHECK-NEXT: Decl %d.14 'cv' Parameter : %union.9 // CHECK-NEXT: Decl %d.15 'arguments' Var Arguments // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.9 +// CHECK-NEXT: Scope %s.8 // CHECK-NEXT: Decl %d.16 'cur' Parameter : %union.4 // CHECK-NEXT: Decl %d.17 'a' Let : %union.4 // CHECK-NEXT: Decl %d.18 'c' Let : %class.2 // CHECK-NEXT: Decl %d.19 'arguments' Var Arguments -// CHECK-NEXT: Scope %s.10 +// CHECK-NEXT: Scope %s.9 // CHECK-NEXT: Decl %d.20 'b' Let : %class.2 // CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.11 +// CHECK-NEXT: Scope %s.10 // CHECK-NEXT: Decl %d.21 'c' Parameter : %union.4 // CHECK-NEXT: Decl %d.22 'arguments' Var Arguments @@ -144,7 +142,7 @@ function retval(c: C | null): C { // CHECK-NEXT: BlockStatement // CHECK-NEXT: IfStatement // CHECK-NEXT: Id 'cur' [D:E:%d.10 'cur'] : %union.4 -// CHECK-NEXT: BlockStatement Scope %s.7 +// CHECK-NEXT: BlockStatement Scope %s.6 // CHECK-NEXT: ExpressionStatement // CHECK-NEXT: CallExpression : void // CHECK-NEXT: Id 'bar' [D:E:%d.11 'bar'] : %function.10 @@ -165,7 +163,7 @@ function retval(c: C | null): C { // CHECK-NEXT: Id 'c' [D:E:%d.18 'c'] // CHECK-NEXT: IfStatement // CHECK-NEXT: Id 'cur' [D:E:%d.16 'cur'] : %union.4 -// CHECK-NEXT: BlockStatement Scope %s.10 +// CHECK-NEXT: BlockStatement Scope %s.9 // CHECK-NEXT: VariableDeclaration // CHECK-NEXT: VariableDeclarator // CHECK-NEXT: ImplicitCheckedCast : %class.2 diff --git a/test/Sema/flow/union-in-class.js b/test/Sema/flow/union-in-class.js index 64f3f3cb409..ca12954125b 100644 --- a/test/Sema/flow/union-in-class.js +++ b/test/Sema/flow/union-in-class.js @@ -39,8 +39,6 @@ class C { // CHECK-NEXT: Decl %d.3 'arguments' Var Arguments // CHECK-NEXT: Func strict // CHECK-NEXT: Scope %s.3 -// CHECK-NEXT: Func strict -// CHECK-NEXT: Scope %s.4 // CHECK:Program Scope %s.1 // CHECK-NEXT: ExpressionStatement