blob: 2611827d2ace0725b57bb7d70d85c91f3d5f991a [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -verify -fsyntax-only
Chris Lattner7c027ee2009-12-14 06:16:57 +00002
3// Test that we recover gracefully from conflict markers left in input files.
4// PR5238
5
Jordan Roseb13eb8d2012-07-11 19:58:23 +00006// diff3 style expected-error@+1 {{version control conflict marker in file}}
7<<<<<<< .mine
Chris Lattner7c027ee2009-12-14 06:16:57 +00008int x = 4;
9|||||||
10int x = 123;
11=======
12float x = 17;
13>>>>>>> .r91107
14
Jordan Roseb13eb8d2012-07-11 19:58:23 +000015// normal style expected-error@+1 {{version control conflict marker in file}}
16<<<<<<< .mine
Chris Lattner7c027ee2009-12-14 06:16:57 +000017typedef int y;
18=======
19typedef struct foo *y;
20>>>>>>> .r91107
21
Jordan Roseb13eb8d2012-07-11 19:58:23 +000022// Perforce style expected-error@+1 {{version control conflict marker in file}}
23>>>> ORIGINAL conflict-marker.c#6
Richard Smitha9e33d42011-10-12 00:37:51 +000024int z = 1;
25==== THEIRS conflict-marker.c#7
26int z = 0;
27==== YOURS conflict-marker.c
28int z = 2;
29<<<<
30
Chris Lattner7c027ee2009-12-14 06:16:57 +000031;
32y b;
33
Chris Lattner467f6bc2010-05-17 20:27:25 +000034
Chris Lattner7c027ee2009-12-14 06:16:57 +000035int foo() {
36 y a = x;
Richard Smitha9e33d42011-10-12 00:37:51 +000037 return x + a - z;
Chris Lattner7c027ee2009-12-14 06:16:57 +000038}
David Majnemer5a549772014-12-14 04:53:11 +000039
40<<<<<<<>>>>>>> // expected-error {{expected identifier}}