conflict-marker.c revision d5e1d606f8c22ebda17c6fbf952f8c1696428758
1// RUN: %clang_cc1 %s -verify -fsyntax-only
2
3// Test that we recover gracefully from conflict markers left in input files.
4// PR5238
5
6// diff3 style
7<<<<<<< .mine      // expected-error {{version control conflict marker in file}}
8int x = 4;
9|||||||
10int x = 123;
11=======
12float x = 17;
13>>>>>>> .r91107
14
15// normal style.
16<<<<<<< .mine     // expected-error {{version control conflict marker in file}}
17typedef int y;
18=======
19typedef struct foo *y;
20>>>>>>> .r91107
21
22// Perforce style.
23>>>> ORIGINAL conflict-marker.c#6 // expected-error {{version control conflict marker in file}}
24int z = 1;
25==== THEIRS conflict-marker.c#7
26int z = 0;
27==== YOURS conflict-marker.c
28int z = 2;
29<<<<
30
31;
32y b;
33
34
35int foo() {
36  y a = x;
37  return x + a - z;
38}
39