[PATCH] D23905: [Modules] Add 'gnuinlineasm' to the 'requires-declaration' feature-list.

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 10:12:37 PDT 2016


On Thu, Aug 25, 2016 at 9:52 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On 25 Aug 2016 7:37 p.m., "Bruno Cardoso Lopes" <bruno.cardoso at gmail.com>
> wrote:
>
> bruno created this revision.
> bruno added a reviewer: rsmith.
> bruno added subscribers: cfe-commits, eladcohen.
>
> This adds support for modules that require (no-)gnu-inline-asm
> environment, such as the compiler builtin cpuid submodule.
>
> This is the gnu-inline-asm variant of https://reviews.llvm.org/D23871
>
> https://reviews.llvm.org/D23905
>
> Files:
>   docs/Modules.rst
>   lib/Basic/Module.cpp
>   lib/Headers/module.modulemap
>
> test/Modules/Inputs/GNUAsm/NeedsGNUAsmInline.framework/Headers/NeedsGNUAsmInline.h
>   test/Modules/Inputs/GNUAsm/NeedsGNUAsmInline.framework/Headers/asm.h
>   test/Modules/Inputs/GNUAsm/NeedsGNUAsmInline.framework/module.map
>   test/Modules/requires-gnuasminline.m
>
> Index: test/Modules/requires-gnuasminline.m
> ===================================================================
> --- /dev/null
> +++ test/Modules/requires-gnuasminline.m
> @@ -0,0 +1,6 @@
> +// RUN: rm -rf %t
> +// RUN: %clang_cc1 -Wauto-import -fmodules-cache-path=%t -fmodules \
> +// RUN:     -fimplicit-module-maps -F %S/Inputs/GNUAsm %s \
> +// RUN:     -fno-gnu-inline-asm -verify
> +
> + at import NeedsGNUAsmInline.Asm; // expected-error{{module
> 'NeedsGNUAsmInline.Asm' requires feature 'gnuasminline'}}
>
>
> You should add a positive test for the case where inline asm is available,
> too...
>
> Index: test/Modules/Inputs/GNUAsm/NeedsGNUAsmInline.framework/module.map
> ===================================================================
> --- /dev/null
> +++ test/Modules/Inputs/GNUAsm/NeedsGNUAsmInline.framework/module.map
> @@ -0,0 +1,8 @@
> +framework module NeedsGNUAsmInline {
> +  header "NeedsGNUAsmInline.h"
> +
> +  explicit module Asm {
> +    requires gnuasminline
>
>
> ... that way, you'd catch this typo in the test :)

Oops :-)
Will do, thanks!

-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc


More information about the cfe-commits mailing list