summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/codegen.test
blob: 6807640e603d653f792d0265cbbc3bff7ee0ac48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
RUN: rm -rf %t
REQUIRES: x86-registered-target

RUN: %clang_cc1 -triple=x86_64-linux-gnu -fmodules-codegen -x c++ -fmodules -emit-module -fmodule-name=foo %S/Inputs/codegen/foo.modulemap -o %t/foo.pcm

RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %t/foo.pcm | FileCheck --check-prefix=FOO --check-prefix=BOTH %s
RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - -fmodules -fmodule-file=%t/foo.pcm %S/Inputs/codegen/use.cpp | FileCheck --check-prefix=BOTH --check-prefix=USE %s

FOO: $_Z2f1PKcz = comdat any
FOO: $_ZN13implicit_dtorD1Ev = comdat any
USE: $_Z4instIiEvv = comdat any
FOO: $_ZN13implicit_dtorD2Ev = comdat any
FOO: define weak_odr void @_Z2f1PKcz(i8* %fmt, ...) #{{[0-9]+}} comdat
FOO:   call void @llvm.va_start(i8* %{{[a-zA-Z0-9]*}})

Test that implicit special members are emitted into the FOO module if they're
ODR used there, otherwise emit them linkonce_odr as usual in the use.

FIXME: Proactively instantiate any valid implicit special members to emit them into the module object.

FOO: define weak_odr void @_ZN13implicit_dtorD1Ev
FOO: define weak_odr void @_Z4instIfEvv
FOO: define weak_odr void @_ZN13implicit_dtorD2Ev

USE: define linkonce_odr void @_ZN20uninst_implicit_dtorD1Ev
USE: define linkonce_odr void @_Z4instIiEvv
USE: define linkonce_odr void @_ZN20uninst_implicit_dtorD2Ev
OpenPOWER on IntegriCloud