OLD | NEW |
1 ; RUN: opt %s -pnacl-abi-simplify-postopt -S | FileCheck %s | 1 ; RUN: opt %s -pnacl-abi-simplify-postopt -S | FileCheck %s |
2 ; RUN: opt %s -pnacl-abi-simplify-postopt -S \ | 2 ; RUN: opt %s -pnacl-abi-simplify-postopt -S \ |
3 ; RUN: | FileCheck %s -check-prefix=CLEANUP | 3 ; RUN: | FileCheck %s -check-prefix=CLEANUP |
4 | 4 |
5 ; "-pnacl-abi-simplify-postopt" runs various passes which are tested | 5 ; "-pnacl-abi-simplify-postopt" runs various passes which are tested |
6 ; thoroughly in other *.ll files. This file is a smoke test to check | 6 ; thoroughly in other *.ll files. This file is a smoke test to check |
7 ; that the passes work together OK. | 7 ; that the passes work together OK. |
8 | 8 |
9 target datalayout = "p:32:32:32" | 9 target datalayout = "p:32:32:32" |
10 | 10 |
11 @var = global i32 256 | 11 @var = global i32 256 |
12 ; CHECK: @var = global [4 x i8] | 12 ; CHECK: @var = global [4 x i8] |
13 | 13 |
14 define i16 @read_var() { | 14 define i16 @read_var() { |
15 %val = load i16* bitcast (i32* @var to i16*) | 15 %val = load i16, i16* bitcast (i32* @var to i16*) |
16 ret i16 %val | 16 ret i16 %val |
17 } | 17 } |
18 ; CHECK: = bitcast [4 x i8]* @var | 18 ; CHECK: = bitcast [4 x i8]* @var |
19 ; CHECK-NEXT: load i16* | 19 ; CHECK-NEXT: load i16, i16* |
20 | 20 |
21 ; Check that dead prototypes are successfully removed. | 21 ; Check that dead prototypes are successfully removed. |
22 declare void @unused_prototype(i8*) | 22 declare void @unused_prototype(i8*) |
23 ; CLEANUP-NOT: unused_prototype | 23 ; CLEANUP-NOT: unused_prototype |
OLD | NEW |