From 63bb6737cee932331468107f6800273fff520ab4 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 10 Oct 2019 18:36:41 +0000 Subject: [PATCH] Update clang tests for new LLVM IR backslash printing in r374415 llvm-svn: 374416 --- clang/test/CodeGen/debug-prefix-map.c | 2 +- clang/test/CodeGen/string-literal.c | 6 +++--- clang/test/CodeGen/ubsan-strip-path-components.cpp | 8 ++++---- clang/test/Driver/darwin-debug-flags.c | 2 +- clang/test/Profile/gcc-flag-compatibility.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/clang/test/CodeGen/debug-prefix-map.c b/clang/test/CodeGen/debug-prefix-map.c index f755ba47a291..d6032a658c2e 100644 --- a/clang/test/CodeGen/debug-prefix-map.c +++ b/clang/test/CodeGen/debug-prefix-map.c @@ -16,7 +16,7 @@ void test_rewrite_includes() { vprintf("string", argp); } -// CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/UNLIKELY_PATH/empty{{/|\\5C}}" +// CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/UNLIKELY_PATH/empty{{/|\\\\}}" // CHECK-NO-MAIN-FILE-NAME: !DIFile(filename: "/UNLIKELY_PATH/empty{{[/\\]}}{{.*}}", // On POSIX systems "Dir" should actually be empty, but on Windows we // can't recognize "/UNLIKELY_PATH" as being an absolute path. diff --git a/clang/test/CodeGen/string-literal.c b/clang/test/CodeGen/string-literal.c index c46018743620..663487282104 100644 --- a/clang/test/CodeGen/string-literal.c +++ b/clang/test/CodeGen/string-literal.c @@ -85,7 +85,7 @@ int main() { // CHECK-CXX11: private unnamed_addr constant [3 x i32] [i32 75, i32 76, i32 0], align 4 const wchar_t *l = LR"bar(KL)bar"; - // CHECK-CXX11: private unnamed_addr constant [9 x i8] c"abc\5Cndef\00", align 1 + // CHECK-CXX11: private unnamed_addr constant [9 x i8] c"abc\\ndef\00", align 1 const char *m = R"(abc\ndef)"; // CHECK-CXX11: private unnamed_addr constant [8 x i8] c"abc\0Adef\00", align 1 @@ -96,13 +96,13 @@ def)"; const char *q = R"(abc def)" "ghi"; - // CHECK-CXX11: private unnamed_addr constant [13 x i8] c"abc\5C\0A??=\0Adef\00", align 1 + // CHECK-CXX11: private unnamed_addr constant [13 x i8] c"abc\\\0A??=\0Adef\00", align 1 const char *r = R\ "(abc\ ??= def)"; - // CHECK-CXX11: private unnamed_addr constant [13 x i8] c"def\5C\0A??=\0Aabc\00", align 1 + // CHECK-CXX11: private unnamed_addr constant [13 x i8] c"def\\\0A??=\0Aabc\00", align 1 const char *s = u8R\ "(def\ ??= diff --git a/clang/test/CodeGen/ubsan-strip-path-components.cpp b/clang/test/CodeGen/ubsan-strip-path-components.cpp index 7a95324d128b..7ab000785e1f 100644 --- a/clang/test/CodeGen/ubsan-strip-path-components.cpp +++ b/clang/test/CodeGen/ubsan-strip-path-components.cpp @@ -10,13 +10,13 @@ // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable -o - -fsanitize-undefined-strip-path-components=-2 | FileCheck %s -check-prefix=LAST-TWO // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -emit-llvm -fsanitize=unreachable -o - -fsanitize-undefined-strip-path-components=-1 | FileCheck %s -check-prefix=LAST-ONLY -// REGULAR: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"{{.*test(.|\\5C)CodeGen(.|\\5C)ubsan-strip-path-components\.cpp}}\00", align 1 +// REGULAR: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"{{.*test(.|\\\\)CodeGen(.|\\\\)ubsan-strip-path-components\.cpp}}\00", align 1 -// First path component: "/" or "$drive_letter:", then a name, or '\5C' on Windows -// REMOVE-FIRST-TWO: @[[STR:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"{{(.:|/)([^\\/]*(/|\\5C))}}[[REST:.*ubsan-strip-path-components\.cpp]]\00", align 1 +// First path component: "/" or "$drive_letter:", then a name, or '\\' on Windows +// REMOVE-FIRST-TWO: @[[STR:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"{{(.:|/)([^\\/]*(/|\\\\))}}[[REST:.*ubsan-strip-path-components\.cpp]]\00", align 1 // REMOVE-FIRST-TWO: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"[[REST]]\00", align 1 -// LAST-TWO: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"CodeGen{{/|\\5C}}ubsan-strip-path-components.cpp\00", align 1 +// LAST-TWO: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"CodeGen{{/|\\\\}}ubsan-strip-path-components.cpp\00", align 1 // LAST-ONLY: @[[SRC:[0-9.a-zA-Z_]+]] = private unnamed_addr constant [{{.*}} x i8] c"ubsan-strip-path-components.cpp\00", align 1 // CHECK: @[[STATIC_DATA:[0-9.a-zA-Z_]+]] = private unnamed_addr global { { [{{.*}} x i8]*, i32, i32 } } { { [{{.*}} x i8]*, i32, i32 } { [{{.*}} x i8]* @[[SRC]], i32 [[@LINE+6]], i32 3 } } diff --git a/clang/test/Driver/darwin-debug-flags.c b/clang/test/Driver/darwin-debug-flags.c index e37680e7f94a..79a7f48350f5 100644 --- a/clang/test/Driver/darwin-debug-flags.c +++ b/clang/test/Driver/darwin-debug-flags.c @@ -7,7 +7,7 @@ // CHECK: distinct !DICompileUnit( // CHECK-SAME: flags: -// CHECK-SAME: -I path\5C with\5C \5C\5Cspaces +// CHECK-SAME: -I path\\ with\\ \\\\spaces // CHECK-SAME: -g -Os // CHECK-SAME: -mmacosx-version-min=10.5.0 diff --git a/clang/test/Profile/gcc-flag-compatibility.c b/clang/test/Profile/gcc-flag-compatibility.c index a378af9d3464..e3594b0ebc71 100644 --- a/clang/test/Profile/gcc-flag-compatibility.c +++ b/clang/test/Profile/gcc-flag-compatibility.c @@ -15,7 +15,7 @@ // Check that -fprofile-generate=/path/to generates /path/to/default.profraw // RUN: %clang %s -c -S -o - -emit-llvm -fprofile-generate=/path/to -fno-experimental-new-pass-manager | FileCheck -check-prefixes=PROFILE-GEN,PROFILE-GEN-EQ %s // RxUN: %clang %s -c -S -o - -emit-llvm -fprofile-generate=/path/to -fexperimental-new-pass-manager | FileCheck -check-prefixes=PROFILE-GEN,PROFILE-GEN-EQ %s -// PROFILE-GEN-EQ: constant [{{.*}} x i8] c"/path/to{{/|\\5C}}{{.*}}\00" +// PROFILE-GEN-EQ: constant [{{.*}} x i8] c"/path/to{{/|\\\\}}{{.*}}\00" // Check that -fprofile-use=some/path reads some/path/default.profdata // This uses Clang FE format profile.