r211276 - Improve robustness of tests for module flags metadata

Oliver Stannard oliver.stannard at arm.com
Thu Jun 19 09:10:21 PDT 2014


Author: olista01
Date: Thu Jun 19 11:10:21 2014
New Revision: 211276

URL: http://llvm.org/viewvc/llvm-project?rev=211276&view=rev
Log:
Improve robustness of tests for module flags metadata

Fix clang tests to not break if the ID numbers of module flags metadata
nodes change.


Modified:
    cfe/trunk/test/CodeGen/dependent-lib.c
    cfe/trunk/test/CodeGen/pragma-comment.c
    cfe/trunk/test/CodeGen/pragma-detect_mismatch.c
    cfe/trunk/test/CodeGenObjC/image-info.m
    cfe/trunk/test/CodeGenObjC/ivar-base-as-invariant-load.m
    cfe/trunk/test/CodeGenObjCXX/property-lvalue-capture.mm
    cfe/trunk/test/Driver/ident_md.c
    cfe/trunk/test/Modules/autolink.m

Modified: cfe/trunk/test/CodeGen/dependent-lib.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/dependent-lib.c?rev=211276&r1=211275&r2=211276&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/dependent-lib.c (original)
+++ cfe/trunk/test/CodeGen/dependent-lib.c Thu Jun 19 11:10:21 2014
@@ -2,13 +2,13 @@
 // RUN: %clang_cc1 %s --dependent-lib=msvcrt -triple x86_64-pc-win32 -emit-llvm -o - | FileCheck %s
 // RUN: %clang_cc1 %s --dependent-lib=msvcrt -triple i686-pc-linux -emit-llvm -o - | FileCheck -check-prefix LINUX %s
 
-// CHECK: !llvm.module.flags = !{!0}
-// CHECK: !0 = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
+// CHECK: !llvm.module.flags = !{{{.*}}}
+// CHECK: !{{[0-9]+}} = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
 // CHECK: ![[link_opts]] = metadata !{metadata ![[msvcrt:[0-9]+]]}
 // CHECK: ![[msvcrt]] = metadata !{metadata !"/DEFAULTLIB:msvcrt.lib"}
 
-// LINUX: !llvm.module.flags = !{!0}
-// LINUX: !0 = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
+// LINUX: !llvm.module.flags = !{{{.*}}}
+// LINUX: !{{[0-9]+}} = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
 // LINUX: ![[link_opts]] = metadata !{metadata ![[msvcrt:[0-9]+]]}
 // LINUX: ![[msvcrt]] = metadata !{metadata !"-lmsvcrt"}
 

Modified: cfe/trunk/test/CodeGen/pragma-comment.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pragma-comment.c?rev=211276&r1=211275&r2=211276&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/pragma-comment.c (original)
+++ cfe/trunk/test/CodeGen/pragma-comment.c Thu Jun 19 11:10:21 2014
@@ -9,8 +9,8 @@
 #define BAR "2"
 #pragma comment(linker," /bar=" BAR)
 
-// CHECK: !llvm.module.flags = !{!0}
-// CHECK: !0 = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
+// CHECK: !llvm.module.flags = !{{{.*}}}
+// CHECK: !{{[0-9]+}} = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
 // CHECK: ![[link_opts]] = metadata !{metadata ![[msvcrt:[0-9]+]], metadata ![[kernel32:[0-9]+]], metadata ![[USER32:[0-9]+]], metadata ![[bar:[0-9]+]]}
 // CHECK: ![[msvcrt]] = metadata !{metadata !"/DEFAULTLIB:msvcrt.lib"}
 // CHECK: ![[kernel32]] = metadata !{metadata !"/DEFAULTLIB:kernel32.lib"}

Modified: cfe/trunk/test/CodeGen/pragma-detect_mismatch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pragma-detect_mismatch.c?rev=211276&r1=211275&r2=211276&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/pragma-detect_mismatch.c (original)
+++ cfe/trunk/test/CodeGen/pragma-detect_mismatch.c Thu Jun 19 11:10:21 2014
@@ -5,8 +5,8 @@
 #define BAR "2"
 #pragma detect_mismatch("test2", BAR)
 
-// CHECK: !llvm.module.flags = !{!0}
-// CHECK: !0 = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
+// CHECK: !llvm.module.flags = !{{{.*}}}
+// CHECK: !{{[0-9]+}} = metadata !{i32 6, metadata !"Linker Options", metadata ![[link_opts:[0-9]+]]}
 // CHECK: ![[link_opts]] = metadata !{metadata ![[test:[0-9]+]], metadata ![[test2:[0-9]+]]}
 // CHECK: ![[test]] = metadata !{metadata !"/FAILIFMISMATCH:\22test=1\22"}
 // CHECK: ![[test2]] = metadata !{metadata !"/FAILIFMISMATCH:\22test2=2\22"}

Modified: cfe/trunk/test/CodeGenObjC/image-info.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/image-info.m?rev=211276&r1=211275&r2=211276&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/image-info.m (original)
+++ cfe/trunk/test/CodeGenObjC/image-info.m Thu Jun 19 11:10:21 2014
@@ -4,14 +4,14 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t %s
 // RUN: FileCheck --check-prefix CHECK-NONFRAGILE < %t %s
 
-// CHECK-FRAGILE:      !llvm.module.flags = !{!0, !1, !2, !3}
-// CHECK-FRAGILE:      !0 = metadata !{i32 1, metadata !"Objective-C Version", i32 1}
-// CHECK-FRAGILE-NEXT: !1 = metadata !{i32 1, metadata !"Objective-C Image Info Version", i32 0}
-// CHECK-FRAGILE-NEXT: !2 = metadata !{i32 1, metadata !"Objective-C Image Info Section", metadata !"__OBJC, __image_info,regular"}
-// CHECK-FRAGILE-NEXT: !3 = metadata !{i32 4, metadata !"Objective-C Garbage Collection", i32 0}
+// CHECK-FRAGILE:      !llvm.module.flags = !{{{.*}}}
+// CHECK-FRAGILE:      !{{[0-9]+}} = metadata !{i32 1, metadata !"Objective-C Version", i32 1}
+// CHECK-FRAGILE-NEXT: !{{[0-9]+}} = metadata !{i32 1, metadata !"Objective-C Image Info Version", i32 0}
+// CHECK-FRAGILE-NEXT: !{{[0-9]+}} = metadata !{i32 1, metadata !"Objective-C Image Info Section", metadata !"__OBJC, __image_info,regular"}
+// CHECK-FRAGILE-NEXT: !{{[0-9]+}} = metadata !{i32 4, metadata !"Objective-C Garbage Collection", i32 0}
 
-// CHECK-NONFRAGILE:      !llvm.module.flags = !{!0, !1, !2, !3}
-// CHECK-NONFRAGILE:      !0 = metadata !{i32 1, metadata !"Objective-C Version", i32 2}
-// CHECK-NONFRAGILE-NEXT: !1 = metadata !{i32 1, metadata !"Objective-C Image Info Version", i32 0}
-// CHECK-NONFRAGILE-NEXT: !2 = metadata !{i32 1, metadata !"Objective-C Image Info Section", metadata !"__DATA, __objc_imageinfo, regular, no_dead_strip"}
-// CHECK-NONFRAGILE-NEXT: !3 = metadata !{i32 4, metadata !"Objective-C Garbage Collection", i32 0}
+// CHECK-NONFRAGILE:      !llvm.module.flags = !{{{.*}}}
+// CHECK-NONFRAGILE:      !{{[0-9]+}} = metadata !{i32 1, metadata !"Objective-C Version", i32 2}
+// CHECK-NONFRAGILE-NEXT: !{{[0-9]+}} = metadata !{i32 1, metadata !"Objective-C Image Info Version", i32 0}
+// CHECK-NONFRAGILE-NEXT: !{{[0-9]+}} = metadata !{i32 1, metadata !"Objective-C Image Info Section", metadata !"__DATA, __objc_imageinfo, regular, no_dead_strip"}
+// CHECK-NONFRAGILE-NEXT: !{{[0-9]+}} = metadata !{i32 4, metadata !"Objective-C Garbage Collection", i32 0}

Modified: cfe/trunk/test/CodeGenObjC/ivar-base-as-invariant-load.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/ivar-base-as-invariant-load.m?rev=211276&r1=211275&r2=211276&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/ivar-base-as-invariant-load.m (original)
+++ cfe/trunk/test/CodeGenObjC/ivar-base-as-invariant-load.m Thu Jun 19 11:10:21 2014
@@ -23,7 +23,7 @@
 
 @end
 
-// CHECK: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load !5
-// CHECK: [[T2:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load !5
-// CHECK: [[T3:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load !5
-
+// CHECK: [[T1:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load ![[MD_NUM:[0-9]+]]
+// CHECK: [[T2:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load ![[MD_NUM]]
+// CHECK: [[T3:%.*]] = load i64* @"OBJC_IVAR_$_A._flags", !invariant.load ![[MD_NUM]]
+//

Modified: cfe/trunk/test/CodeGenObjCXX/property-lvalue-capture.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/property-lvalue-capture.mm?rev=211276&r1=211275&r2=211276&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/property-lvalue-capture.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/property-lvalue-capture.mm Thu Jun 19 11:10:21 2014
@@ -24,10 +24,10 @@ typedef Quad2<double> Quad2d;
 }
 @end
 
-// CHECK:   [[TWO:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", !invariant.load !5
+// CHECK:   [[TWO:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", !invariant.load ![[MD_NUM:[0-9]+]]
 // CHECK:   [[THREE:%.*]] = bitcast [[ONET:%.*]]* [[ONE:%.*]] to i8*
 // CHECK:   [[CALL:%.*]] = call nonnull %struct.Quad2* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %struct.Quad2* (i8*, i8*)*)(i8* [[THREE]], i8* [[TWO]])
-// CHECK:   [[FOUR:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_2", !invariant.load !5
+// CHECK:   [[FOUR:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_2", !invariant.load ![[MD_NUM]]
 // CHECK:   [[FIVE:%.*]] = bitcast [[ONET]]* [[ZERO:%.*]] to i8*
 // CHECK:   call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %struct.Quad2*)*)(i8* [[FIVE]], i8* [[FOUR]], %struct.Quad2* nonnull [[CALL]])
 
@@ -47,7 +47,7 @@ void test(C *c, const A &a) {
 }
 
 // CHECK:   [[ONE1:%.*]] = load %struct.A** [[AADDR:%.*]], align 8
-// CHECK:   [[TWO1:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_5", !invariant.load !5
+// CHECK:   [[TWO1:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_5", !invariant.load ![[MD_NUM]]
 // CHECK:   [[THREE1:%.*]] = bitcast [[TWOT:%.*]]* [[ZERO1:%.*]] to i8*
 // CHECK:   call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %struct.A*)*)(i8* [[THREE1]], i8* [[TWO1]], %struct.A* nonnull [[ONE1]])
 // CHECK:   store %struct.A* [[ONE1]], %struct.A** [[RESULT:%.*]], align 8

Modified: cfe/trunk/test/Driver/ident_md.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/ident_md.c?rev=211276&r1=211275&r2=211276&view=diff
==============================================================================
--- cfe/trunk/test/Driver/ident_md.c (original)
+++ cfe/trunk/test/Driver/ident_md.c Thu Jun 19 11:10:21 2014
@@ -1,6 +1,6 @@
 // RUN: %clang %s -emit-llvm -S -o - | FileCheck %s
 // Verify that clang version appears in the llvm.ident metadata.
 
-// CHECK: !llvm.ident = !{!0}
-// CHECK: !0 = metadata !{metadata !{{.*}}
+// CHECK: !llvm.ident = !{{{.*}}}
+// CHECK: !{{[0-9]+}} = metadata !{metadata !{{.*}}
 

Modified: cfe/trunk/test/Modules/autolink.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/autolink.m?rev=211276&r1=211275&r2=211276&view=diff
==============================================================================
--- cfe/trunk/test/Modules/autolink.m (original)
+++ cfe/trunk/test/Modules/autolink.m Thu Jun 19 11:10:21 2014
@@ -36,8 +36,8 @@ int use_autolink_sub3() {
 
 // NOTE: "autolink_sub" is intentionally not linked.
 
-// CHECK: !llvm.module.flags = !{!0, !1, !2, !3, !4}
-// CHECK: !4 = metadata !{i32 6, metadata !"Linker Options", metadata ![[AUTOLINK_OPTIONS:[0-9]+]]}
+// CHECK: !llvm.module.flags = !{{{.*}}}
+// CHECK: !{{[0-9]+}} = metadata !{i32 6, metadata !"Linker Options", metadata ![[AUTOLINK_OPTIONS:[0-9]+]]}
 // CHECK: ![[AUTOLINK_OPTIONS]] = metadata !{metadata ![[AUTOLINK_PCH:[0-9]+]], metadata ![[AUTOLINK_FRAMEWORK:[0-9]+]], metadata ![[AUTOLINK:[0-9]+]], metadata ![[DEPENDSONMODULE:[0-9]+]], metadata ![[MODULE:[0-9]+]], metadata ![[NOUMBRELLA:[0-9]+]]}
 // CHECK: ![[AUTOLINK_PCH]] = metadata !{metadata !"{{(-l|/DEFAULTLIB:)}}autolink_from_pch{{(\.lib)?}}"}
 // CHECK: ![[AUTOLINK_FRAMEWORK]] = metadata !{metadata !"-framework", metadata !"autolink_framework"}





More information about the cfe-commits mailing list