r300106 - Modular Codegen: Include testing for inline asm as well as some commentary on the implementaiton choice.
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 12 14:14:04 PDT 2017
Author: dblaikie
Date: Wed Apr 12 16:14:04 2017
New Revision: 300106
URL: http://llvm.org/viewvc/llvm-project?rev=300106&view=rev
Log:
Modular Codegen: Include testing for inline asm as well as some commentary on the implementaiton choice.
Modified:
cfe/trunk/test/Modules/Inputs/codegen/foo.h
cfe/trunk/test/Modules/codegen.test
Modified: cfe/trunk/test/Modules/Inputs/codegen/foo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/codegen/foo.h?rev=300106&r1=300105&r2=300106&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/codegen/foo.h (original)
+++ cfe/trunk/test/Modules/Inputs/codegen/foo.h Wed Apr 12 16:14:04 2017
@@ -28,3 +28,5 @@ inline void inst_decl() {
(void)sizeof(&inst<int>);
inst<float>();
}
+
+asm("narf");
Modified: cfe/trunk/test/Modules/codegen.test
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/codegen.test?rev=300106&r1=300105&r2=300106&view=diff
==============================================================================
--- cfe/trunk/test/Modules/codegen.test (original)
+++ cfe/trunk/test/Modules/codegen.test Wed Apr 12 16:14:04 2017
@@ -6,6 +6,20 @@ RUN: %clang_cc1 -triple=x86_64-linux-gnu
RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - %t/foo.pcm | FileCheck --check-prefix=FOO --check-prefix=BOTH %s
RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -fmodules -fmodule-file=%t/foo.pcm %S/Inputs/codegen/use.cpp | FileCheck --check-prefix=BOTH --check-prefix=USE %s
+For want of any better definition, inline asm goes "everywhere" the same as it
+if it were in a header (with the disadvantage that the inline asm will be
+included in the program if the module is used, even if the header containing
+the inline asm is never included - unlike a non-modular build).
+
+This is inconsistent with how namespace scope static variables are handled -
+where they only appear in the code that includes a header. This functionality
+was implemented to workaround/support the initialization of iostreams
+(implemented as a namespace scope static in the header - only to be provided
+when that specific header is included in the program).
+
+FOO: module asm "narf"
+USE: module asm "narf"
+
FOO: $_Z2f1PKcz = comdat any
FOO: $_ZN13implicit_dtorD1Ev = comdat any
USE: $_Z4instIiEvv = comdat any
More information about the cfe-commits
mailing list