From 3de5ef96c93943af6154eeeccad2d7774343e97f Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Fri, 1 Apr 2016 03:54:03 +0000 Subject: [PATCH] Improve CHECK-NOT robustness of dllexport tests This changes some dllexport tests, to verify that some symbols that should not be exported are not, in a way that improves the robustness of CHECK-SAME interaction with CHECK-NOT. We plan to enable dllimport/dllexport support for the PS4, and these changes are for points we noticed in our internal testing. Patch by Warren Ristow! llvm-svn: 265106 --- llvm/test/CodeGen/X86/dllexport-x86_64.ll | 9 ++++++++- llvm/test/CodeGen/X86/dllexport.ll | 16 ++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/llvm/test/CodeGen/X86/dllexport-x86_64.ll b/llvm/test/CodeGen/X86/dllexport-x86_64.ll index 58e25f923971..98303d38ab21 100644 --- a/llvm/test/CodeGen/X86/dllexport-x86_64.ll +++ b/llvm/test/CodeGen/X86/dllexport-x86_64.ll @@ -1,5 +1,7 @@ -; RUN: llc -mtriple x86_64-pc-win32 < %s | FileCheck -check-prefix=CHECK -check-prefix=WIN32 %s +; RUN: llc -mtriple x86_64-pc-win32 < %s | FileCheck -check-prefix=CHECK -check-prefix=WIN32 %s ; RUN: llc -mtriple x86_64-pc-mingw32 < %s | FileCheck -check-prefix=CHECK -check-prefix=MINGW %s +; RUN: llc -mtriple x86_64-pc-win32 < %s | FileCheck -check-prefix=NOTEXPORTED %s +; RUN: llc -mtriple x86_64-pc-mingw32 < %s | FileCheck -check-prefix=NOTEXPORTED %s ; CHECK: .text @@ -70,6 +72,11 @@ define weak_odr dllexport void @weak1() { @blob = global [6 x i8] c"\B8*\00\00\00\C3", section ".text", align 16 @blob_alias = dllexport alias i32 (), bitcast ([6 x i8]* @blob to i32 ()*) +; Verify item that should not be exported does not appear in the export table. +; We use a separate check prefix to avoid confusion between -NOT and -SAME. +; NOTEXPORTED: .section .drectve +; NOTEXPORTED-NOT: notExported + ; CHECK: .section .drectve ; WIN32: /EXPORT:f1 ; WIN32-SAME: /EXPORT:f2 diff --git a/llvm/test/CodeGen/X86/dllexport.ll b/llvm/test/CodeGen/X86/dllexport.ll index 81d686deec22..d833f3c22ffc 100644 --- a/llvm/test/CodeGen/X86/dllexport.ll +++ b/llvm/test/CodeGen/X86/dllexport.ll @@ -4,6 +4,12 @@ ; RUN: | FileCheck -check-prefix CHECK -check-prefix CHECK-GCC %s ; RUN: llc -mtriple i686-pc-cygwin %s -o - \ ; RUN: | FileCheck -check-prefix CHECK -check-prefix CHECK-GCC %s +; RUN: llc -mtriple i386-pc-win32 < %s \ +; RUN: | FileCheck -check-prefix NOTEXPORTED %s +; RUN: llc -mtriple i386-pc-mingw32 < %s \ +; RUN: | FileCheck -check-prefix NOTEXPORTED %s +; RUN: llc -mtriple i686-pc-cygwin %s -o - \ +; RUN: | FileCheck -check-prefix NOTEXPORTED %s ; CHECK: .text @@ -88,8 +94,13 @@ define weak_odr dllexport void @weak1() { ; CHECK: _weak_alias = _f1 @weak_alias = weak_odr dllexport alias void(), void()* @f1 +; Verify items that should not be exported do not appear in the export table. +; We use a separate check prefix to avoid confusion between -NOT and -SAME. +; NOTEXPORTED: .section .drectve +; NOTEXPORTED-NOT: notExported +; NOTEXPORTED-NOT: notDefined + ; CHECK: .section .drectve -; CHECK-CL-NOT: notExported ; CHECK-CL: /EXPORT:_f1 ; CHECK-CL-SAME: /EXPORT:_f2 ; CHECK-CL-SAME: /EXPORT:_stdfun@0 @@ -107,8 +118,6 @@ define weak_odr dllexport void @weak1() { ; CHECK-CL-SAME: /EXPORT:_alias2 ; CHECK-CL-SAME: /EXPORT:_alias3 ; CHECK-CL-SAME: /EXPORT:_weak_alias" -; CHECK-CL-NOT: notExported -; CHECK-GCC-NOT: notExported ; CHECK-GCC: -export:f1 ; CHECK-GCC-SAME: -export:f2 ; CHECK-GCC-SAME: -export:stdfun@0 @@ -126,4 +135,3 @@ define weak_odr dllexport void @weak1() { ; CHECK-GCC-SAME: -export:alias2 ; CHECK-GCC-SAME: -export:alias3 ; CHECK-GCC-SAME: -export:weak_alias" -; CHECK-GCC-NOT: notExported