llvm-project/clang/test/CodeGen/wasm-export-name.c
Sam Clegg 0a1e349a79 [WebAssembly] Setting export_name implies llvm.used
This change updates the clang front end to add symbols to llvm.used
when they have explicit export_name attribute.

Differential Revision: https://reviews.llvm.org/D71493
2019-12-16 14:48:38 -08:00

14 lines
374 B
C

// RUN: %clang_cc1 -triple wasm32-unknown-unknown-wasm -emit-llvm -o - %s | FileCheck %s
int __attribute__((export_name("bar"))) foo(void);
int foo(void) {
return 43;
}
// CHECK: @llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @foo to i8*)]
// CHECK: define i32 @foo() [[A:#[0-9]+]]
// CHECK: attributes [[A]] = {{{.*}} "wasm-export-name"="bar" {{.*}}}