Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: test/NaCl/PNaClABI/types.ll

Issue 14329025: Check for metadata in PNaCl ABI checker. (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: cleanup Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/NaCl/PNaClABI/types.ll
diff --git a/test/NaCl/PNaClABI/types.ll b/test/NaCl/PNaClABI/types.ll
index 6e2d73e82c516b5ab321670ad554f764bc5c35e5..8343a6718251bc23113b518aebd7edfff1e095de 100644
--- a/test/NaCl/PNaClABI/types.ll
+++ b/test/NaCl/PNaClABI/types.ll
@@ -1,4 +1,5 @@
; RUN: pnacl-abicheck < %s | FileCheck %s
+; RUN: pnacl-abicheck -allow-debug-metadata < %s | FileCheck %s --check-prefix=DEBUG
; Test types allowed by PNaCl ABI
; Basic global types
@@ -112,6 +113,17 @@ declare void @badArgType1(half %a, i32 %b)
; CHECK: Function badArgType2 argument 2 has disallowed type
declare void @badArgType2(i32 %a, half %b)
-; CHECK: Named metadata node namedmd refers to disallowed type
+; If the metadata is allowed we want to check for types.
+; We have a hacky way to test this. The -allow-debug-metadata whitelists debug
+; metadata. That allows us to check types within debug metadata, even though
+; debug metadata normally does not have illegal types.
+; DEBUG-NOT: Named metadata node llvm.dbg.cu is disallowed
+; DEBUG: Named metadata node llvm.dbg.cu refers to disallowed type: half
+; CHECK: Named metadata node llvm.dbg.cu is disallowed
+!llvm.dbg.cu = !{!0}
!0 = metadata !{ half 0.0}
-!namedmd = !{!0}
+
+; CHECK: Named metadata node madeup is disallowed
+; DEBUG: Named metadata node madeup is disallowed
+!madeup = !{!1}
+!1 = metadata !{ half 1.0}

Powered by Google App Engine
This is Rietveld 408576698