2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 %s -verify -fsyntax-only
|
2009-12-14 14:16:57 +08:00
|
|
|
|
|
|
|
// Test that we recover gracefully from conflict markers left in input files.
|
|
|
|
// PR5238
|
|
|
|
|
2012-07-12 03:58:23 +08:00
|
|
|
// diff3 style expected-error@+1 {{version control conflict marker in file}}
|
|
|
|
<<<<<<< .mine
|
2009-12-14 14:16:57 +08:00
|
|
|
int x = 4;
|
|
|
|
|||||||
|
|
|
|
int x = 123;
|
|
|
|
=======
|
|
|
|
float x = 17;
|
|
|
|
>>>>>>> .r91107
|
|
|
|
|
2012-07-12 03:58:23 +08:00
|
|
|
// normal style expected-error@+1 {{version control conflict marker in file}}
|
|
|
|
<<<<<<< .mine
|
2009-12-14 14:16:57 +08:00
|
|
|
typedef int y;
|
|
|
|
=======
|
|
|
|
typedef struct foo *y;
|
|
|
|
>>>>>>> .r91107
|
|
|
|
|
2012-07-12 03:58:23 +08:00
|
|
|
// Perforce style expected-error@+1 {{version control conflict marker in file}}
|
|
|
|
>>>> ORIGINAL conflict-marker.c#6
|
2011-10-12 08:37:51 +08:00
|
|
|
int z = 1;
|
|
|
|
==== THEIRS conflict-marker.c#7
|
|
|
|
int z = 0;
|
|
|
|
==== YOURS conflict-marker.c
|
|
|
|
int z = 2;
|
|
|
|
<<<<
|
|
|
|
|
2009-12-14 14:16:57 +08:00
|
|
|
;
|
|
|
|
y b;
|
|
|
|
|
2010-05-18 04:27:25 +08:00
|
|
|
|
2009-12-14 14:16:57 +08:00
|
|
|
int foo() {
|
|
|
|
y a = x;
|
2011-10-12 08:37:51 +08:00
|
|
|
return x + a - z;
|
2009-12-14 14:16:57 +08:00
|
|
|
}
|
2014-12-14 12:53:11 +08:00
|
|
|
|
|
|
|
<<<<<<<>>>>>>> // expected-error {{expected identifier}}
|