Skip to content

Commit

Permalink
Fix up ms-pch-macro.c test to pass on non-Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rnk committed Jan 15, 2020
1 parent 5ca24d0 commit c42116c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clang/test/PCH/ms-pch-macro.c
Expand Up @@ -8,16 +8,16 @@
// RUN: not %clang_cc1 -UFOO -DBAR=int -include-pch %t1.pch %s -pch-through-header=%S/variables.h 2> %t.err
// RUN: FileCheck -check-prefix=CHECK-NOFOO %s < %t.err

// RUN: %clang_cc1 -include-pch %t1.pch -DBAR=int -pch-through-header=%S/variables.h -verify %s 2> %t.err
// RUN: %clang_cc1 -include-pch %t1.pch -DBAR=int -pch-through-header=%S/variables.h -verify %s

// Enabling MS extensions should allow us to add BAR definitions.
// RUN: %clang_cc1 -fms-extensions -DFOO %S/variables.h -emit-pch -o %t1.pch
// RUN: %clang_cc1 -fms-extensions -include-pch %t1.pch -DBAR=int -pch-through-header=%S/variables.h -verify %s 2> %t.err
// RUN: %clang_cc1 -DMSEXT -fms-extensions -DFOO %S/variables.h -emit-pch -o %t1.pch
// RUN: %clang_cc1 -DMSEXT -fms-extensions -include-pch %t1.pch -DBAR=int -pch-through-header=%S/variables.h -verify %s

#include "variables.h"

BAR bar = 17;
#ifndef _MSC_EXTENSIONS
#ifndef MSEXT
// expected-error@-2 {{unknown type name 'BAR'}}
#endif

Expand All @@ -29,7 +29,7 @@ BAR bar = 17;
# error FOO has the wrong definition
#endif

#if defined(_MSC_EXTENSIONS) && !defined(BAR)
#if defined(MSEXT) && !defined(BAR)
# error BAR was not defined
#endif

Expand Down

0 comments on commit c42116c

Please sign in to comment.