31 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -fmodules -emit-llvm %s -o - | FileCheck %s2// RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-macos -fmodules -emit-llvm %s -o - | FileCheck %s3#pragma clang module build A4module A {}5#pragma clang module contents6#pragma clang module begin A7__attribute__((target("default"))) void f();8__attribute__((target("sse4.2"))) void f();9#pragma clang module end10#pragma clang module endbuild11 12#pragma clang module build B13module B {}14#pragma clang module contents15#pragma clang module begin B16__attribute__((target("default"))) void f();17__attribute__((target("sse4.2"))) void f();18#pragma clang module end19#pragma clang module endbuild20 21#pragma clang module import A22#pragma clang module import B23void g() { f(); }24 25// Negative tests to validate that the resolver only calls each 1x.26// CHECK: define weak_odr ptr @_Z1fv.resolver27// CHECK: ret ptr @_Z1fv.sse4.228// CHECK-NOT: ret ptr @_Z1fv.sse4.229// CHECK: ret ptr @_Z1fv30// CHECK-NOT: ret ptr @_Z1fv31