[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Lexer / builtin_redef.c
blobb0bb2a096be58809f571ba30f1c3ee6c97e657f5
1 // RUN: %clang_cc1 %s -D__TIME__=1234 -U__DATE__ -E 2>&1 | FileCheck %s --check-prefix=CHECK-OUT
2 // RUN: %clang_cc1 %s -D__TIME__=1234 -U__DATE__ -E 2>&1 | FileCheck %s --check-prefix=CHECK-WARN
3 // RUN: not %clang_cc1 %s -D__TIME__=1234 -U__DATE__ -E 2>&1 -pedantic-errors | FileCheck %s --check-prefix=CHECK-ERR
5 // CHECK-WARN: <command line>:{{.*}} warning: redefining builtin macro
6 // CHECK-WARN: <command line>:{{.*}} warning: undefining builtin macro
8 // CHECK-ERR: <command line>:{{.*}} error: redefining builtin macro
9 // CHECK-ERR: <command line>:{{.*}} error: undefining builtin macro
11 int n = __TIME__;
12 __DATE__
14 #define __FILE__ "my file"
15 // CHECK-WARN: :[[@LINE-1]]:9: warning: redefining builtin macro
16 // CHECK-ERR: :[[@LINE-2]]:9: error: redefining builtin macro
18 // CHECK-OUT: int n = 1234;
19 // CHECK-OUT: __DATE__