Debian Codegraph @

clang/test/CodeGenCXX/attr-target-mv-modules.cpp

raw
1 // RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -fmodules -emit-llvm %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-macos -fmodules -emit-llvm %s -o - | FileCheck %s
3 #pragma clang module build A
4 module A {}
5 #pragma clang module contents
6 #pragma clang module begin A
7 __attribute__((target("default"))) void f();
8 __attribute__((target("sse4.2"))) void f();
9 #pragma clang module end
10 #pragma clang module endbuild
11
12 #pragma clang module build B
13 module B {}
14 #pragma clang module contents
15 #pragma clang module begin B
16 __attribute__((target("default"))) void f();
17 __attribute__((target("sse4.2"))) void f();
18 #pragma clang module end
19 #pragma clang module endbuild
20
21 #pragma clang module import A
22 #pragma clang module import B
23 void g() { f(); }
24
25 // Negative tests to validate that the resolver only calls each 1x.
26 // CHECK: define weak_odr ptr @_Z1fv.resolver
27 // CHECK: ret ptr @_Z1fv.sse4.2
28 // CHECK-NOT: ret ptr @_Z1fv.sse4.2
29 // CHECK: ret ptr @_Z1fv
30 // CHECK-NOT: ret ptr @_Z1fv