brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 0bee9b7 Raw
35 lines · cpp
1// Test that the timestamp is not included in the produced pch file with2// -fno-pch-timestamp.3 4// RUN: mkdir -p %t-dir5 6// Copying files allow for read-only checkouts to run this test.7// RUN: cp %S/Inputs/pragma-once2-pch.h %t-dir8// RUN: cp %S/Inputs/pragma-once2.h %t-dir9// RUN: cp %s %t-dir/1.cpp10 11// Check timestamp is included by default.12// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %t-dir/pragma-once2-pch.h13// RUN: touch -m -a -t 201008011501 %t-dir/pragma-once2.h14// RUN: not %clang_cc1 -include-pch %t %t-dir/1.cpp 2>&1 | FileCheck -check-prefix=CHECK-TIMESTAMP %s15 16// Check bitcode output as well.17// RUN: llvm-bcanalyzer -dump %t | FileCheck -check-prefix=CHECK-BITCODE-TIMESTAMP-ON %s18 19// Check timestamp inclusion is disabled by -fno-pch-timestamp.20// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %t-dir/pragma-once2-pch.h -fno-pch-timestamp21// RUN: touch -m -a -t 201008011502 %t-dir/pragma-once2.h22// RUN: %clang_cc1 -include-pch %t %t-dir/1.cpp 2>&123 24// Check bitcode output as well.25// RUN: llvm-bcanalyzer -dump %t | FileCheck -check-prefix=CHECK-BITCODE-TIMESTAMP-OFF %s26 27#include "pragma-once2.h"28 29void g() { f(); }30 31// CHECK-BITCODE-TIMESTAMP-ON: <INPUT_FILE abbrevid={{.*}} op0={{.*}} op1={{.*}} op2={{[^0]}}32// CHECK-BITCODE-TIMESTAMP-OFF: <INPUT_FILE abbrevid={{.*}} op0={{.*}} op1={{.*}} op2={{[0]}}33 34// CHECK-TIMESTAMP: fatal error: file {{.*}} has been modified since the precompiled header {{.*}} was built: mtime changed (was {{.*}}, now {{.*}})35