1 ; RUN: llvm-as -o %t.o %s
2 ; RUN: wasm-ld -o %t0 -e main --lto-O0 %t.o
3 ; RUN: obj2yaml %t0 | FileCheck --check-prefix=CHECK-O0 %s
4 ; RUN: wasm-ld -o %t2 -e main --lto-O2 %t.o
5 ; RUN: obj2yaml %t2 | FileCheck --check-prefix=CHECK-O2 %s
6 ; RUN: wasm-ld -o %t2a -e main %t.o
7 ; RUN: obj2yaml %t2a | FileCheck --check-prefix=CHECK-O2 %s
9 ; Reject invalid optimization levels.
10 ; RUN: not wasm-ld -o %t3 -e main --lto-O6 %t.o 2>&1 | \
11 ; RUN: FileCheck --check-prefix=INVALID %s
12 ; INVALID: invalid optimization level for LTO: 6
14 ; RUN: not wasm-ld -o %t3 -e main --lto-O-1 %t.o 2>&1 | \
15 ; RUN: FileCheck --check-prefix=INVALIDNEGATIVE %s
16 ; INVALIDNEGATIVE: invalid optimization level for LTO: 4294967295
18 target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128"
19 target triple = "wasm32-unknown-unknown-wasm"
22 ; CHECK-O2-NOT: Name: foo
23 define internal void @foo() {