[InstCombine] Preserve NSW flags for `lshr (mul nuw X, C1), C2 -> mul nuw nsw X,...
[llvm-project.git] / clang / test / CodeGenCXX / attr-target-mv-modules.cpp
blobc91cf71fc5f8d4fc8251d0d403d0ccf5a6768715
1 // RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -fmodules -emit-llvm %s -o - | FileCheck %s
2 #pragma clang module build A
3 module A {}
4 #pragma clang module contents
5 #pragma clang module begin A
6 __attribute__((target("default"))) void f();
7 __attribute__((target("sse4.2"))) void f();
8 #pragma clang module end
9 #pragma clang module endbuild
11 #pragma clang module build B
12 module B {}
13 #pragma clang module contents
14 #pragma clang module begin B
15 __attribute__((target("default"))) void f();
16 __attribute__((target("sse4.2"))) void f();
17 #pragma clang module end
18 #pragma clang module endbuild
20 #pragma clang module import A
21 #pragma clang module import B
22 void g() { f(); }
24 // Negative tests to validate that the resolver only calls each 1x.
25 // CHECK: define weak_odr ptr @_Z1fv.resolver
26 // CHECK: ret ptr @_Z1fv.sse4.2
27 // CHECK-NOT: ret ptr @_Z1fv.sse4.2
28 // CHECK: ret ptr @_Z1fv
29 // CHECK-NOT: ret ptr @_Z1fv