     // expected-error@-1:17 {{extra argument 'xx' in call}}
 
     f(xx: 91, 1, 92)
-    // expected-error@-1 {{extra arguments at positions #2, #3 in call}}
-    // expected-error@-2 {{missing argument for parameter 'aa' in call}}
+    // expected-error@-1:6 {{extra arguments at positions #2, #3 in call}}
+    // expected-error@-2:7 {{missing argument for parameter 'aa' in call}}
+
+    f(1, xx: 2, 3)
+    // expected-error@-1:6 {{extra arguments at positions #2, #3 in call}}
+    // expected-error@-2:7 {{missing argument for parameter 'aa' in call}}
+
+    f(1, 2, xx: 3)
+    // expected-error@-1:17 {{extra argument 'xx' in call}}
+  }
+
+  do {
+    func f(_ aa: Int, _ bb: Int = 82, _ cc: Int) { }
+    // expected-note@-1 {{'f' declared here}}
+
+    f(1, 2)
+    // expected-error@-1:11 {{missing argument for parameter #3 in call}}
+
+    f(1, 2, 3) // ok
+  }
+
+  do {
+    func f(_ aa: Int, _ bb: Int, cc: Int) { }
+
+    f(1, 2, cc: 3) // ok
+
+    f(1, 2, xx: 3)
+    // expected-error@-1 {{incorrect argument label in call (have '_:_:xx:', expected '_:_:cc:')}}
+
+    f(1, cc: 2, 3)
+    // expected-error@-1 {{unnamed argument #3 must precede argument 'cc'}}
+
+    f(1, xx: 2, 3)
+    // expected-error@-1 {{incorrect argument labels in call (have '_:xx:_:', expected '_:_:cc:')}}
+
+    f(cc: 1, 2, 3)
+    // expected-error@-1 {{incorrect argument labels in call (have 'cc:_:_:', expected '_:_:cc:')}}
+
+    f(xx: 1, 2, 3)
+    // expected-error@-1 {{incorrect argument labels in call (have 'xx:_:_:', expected '_:_:cc:')}}
+
+    f(xx: 1, yy: 2, 3)
+    // expected-error@-1 {{incorrect argument labels in call (have 'xx:yy:_:', expected '_:_:cc:')}}
+
+    f(xx: 1, 2, yy: 3)
+    // expected-error@-1 {{incorrect argument labels in call (have 'xx:_:yy:', expected '_:_:cc:')}}
+
+    f(1, xx: 2, yy: 3)
+    // expected-error@-1 {{incorrect argument labels in call (have '_:xx:yy:', expected '_:_:cc:')}}
   }
 
   do {
     func f(_ aa: Int, bb: Int, _ cc: Int) { }
+    // expected-note@-1 4 {{'f(_:bb:_:)' declared here}}
+
+    f(1)
+    // expected-error@-1:7 {{missing arguments for parameters 'bb', #3 in call}}
+
+    f(1, 2)
+    // expected-error@-1:8 {{missing argument for parameter 'bb' in call}}
+
+    f(1, 2, 3)
+    // expected-error@-1 {{missing argument label 'bb:' in call}}
+
+    f(1, 2, bb: 3)
+    // expected-error@-1 {{argument 'bb' must precede unnamed argument #2}}
+
+    f(1, bb: 2, 3) // ok
 
     f(bb: 1, 0, 2)
     // expected-error@-1 {{unnamed argument #3 must precede argument 'bb'}}
+
+    f(xx: 1, 2, 3)
+    // expected-error@-1 {{incorrect argument labels in call (have 'xx:_:_:', expected '_:bb:_:')}}
+
+    f(1, xx: 2, 3)
+    // expected-error@-1:17 {{extra argument in call}}
+    // expected-error@-2:8 {{missing argument for parameter 'bb' in call}}
+
+    f(1, 2, xx: 3)
+    // expected-error@-1:8 {{missing argument for parameter 'bb' in call}}
+    // expected-error@-2:17 {{extra argument 'xx' in call}}
   }
 
   do {

    func f(aa: Int, _ bb: Int) { }

    f(1)
    // expected-error@-1 {{missing argument for parameter 'aa' in call}}

    f(0, 1)
    // expected-error@-1:6 {{missing argument label 'aa:' in call}}

    // expected-note@+1 *{{'f(aa:_:_:)' declared here}}
    func f(aa: Int, _ bb: Int, _ cc: Int) {}

    f(1)
    // expected-error@-1:7 {{missing arguments for parameters 'aa', #3 in call}}

    f(0, 1)
    // expected-error@-1:7 {{missing argument for parameter 'aa' in call}}

    f(1, 2, 3)
    // expected-error@-1:6 {{missing argument label 'aa:' in call}}

    f(1, aa: 2, 3)
    // expected-error@-1:10 {{argument 'aa' must precede unnamed argument #1}}

    f(1, xx: 2, 3)
    // expected-error@-1:7 {{missing argument for parameter 'aa' in call}}
    // expected-error@-2:17 {{extra argument in call}}

    f(aa: 1, 2, 3) // ok

    f(xx: 1, 2, 3)
    // expected-error@-1:7 {{missing argument for parameter 'aa' in call}}
    // expected-error@-2:17 {{extra argument in call}}

    f(xx: 1, 2, yy: 3)
    // expected-error@-1:7 {{missing argument for parameter 'aa' in call}}
    // expected-error@-2:21 {{extra argument 'yy' in call}}

    f(xx: 1, yy: 2, 3)
    // expected-error@-1:7 {{missing argument for parameter 'aa' in call}}
    // expected-error@-2:21 {{extra argument in call}}

    f(1, xx: 2, yy: 3)
    // expected-error@-1:7 {{missing argument for parameter 'aa' in call}}
    // expected-error@-2:21 {{extra argument 'yy' in call}}

    f(1, 2, 3, 4)
    // expected-error@-1:16 {{extra argument in call}}

    f(1, aa: 2, 3, 4)
    // expected-error@-1:20 {{extra argument in call}}

    f(1, aa: 2, 3, xx: 4)
    // expected-error@-1:24 {{extra argument 'xx' in call}}

    f(1, aa: 2, xx: 3, 4)
    // expected-error@-1:24 {{extra argument in call}}
  }

  do {
