diff options
Diffstat (limited to 'validation/optim')
| -rw-r--r-- | validation/optim/bool-context.c | 12 | ||||
| -rw-r--r-- | validation/optim/bool-simplify.c | 8 | ||||
| -rw-r--r-- | validation/optim/void-if-convert.c | 19 |
3 files changed, 37 insertions, 2 deletions
diff --git a/validation/optim/bool-context.c b/validation/optim/bool-context.c new file mode 100644 index 00000000..11326d39 --- /dev/null +++ b/validation/optim/bool-context.c @@ -0,0 +1,12 @@ +#define bool _Bool + +bool bool_ior(int a, int b) { return a || b; } +bool bool_and(int a, int b) { return a && b; } + +/* + * check-name: bool-context + * check-command: test-linearize -Wno-decl $file + * check-output-ignore + * + * check-output-pattern-4-times: setne\\..* %arg[12] + */ diff --git a/validation/optim/bool-simplify.c b/validation/optim/bool-simplify.c index e0ff1c2d..05be1149 100644 --- a/validation/optim/bool-simplify.c +++ b/validation/optim/bool-simplify.c @@ -32,13 +32,17 @@ and_0: and_1: .L2: <entry-point> - ret.32 %arg1 + setne.1 %r8 <- %arg1, $0 + cast.32 %r11 <- (1) %r8 + ret.32 %r11 or_0: .L4: <entry-point> - ret.32 %arg1 + setne.1 %r14 <- %arg1, $0 + cast.32 %r17 <- (1) %r14 + ret.32 %r17 or_1: diff --git a/validation/optim/void-if-convert.c b/validation/optim/void-if-convert.c new file mode 100644 index 00000000..66513c4d --- /dev/null +++ b/validation/optim/void-if-convert.c @@ -0,0 +1,19 @@ +int foo(int a) +{ + if (a) + return 0; + else + return 1; + return 2; +} + +/* + * check-name: Ignore VOID in if-convert + * check-command: test-linearize -Wno-decl $file + * check-output-ignore + * + * check-output-excludes: phisrc\\. + * check-output-excludes: phi\\. + * check-output-excludes: VOID + * check-output-contains: seteq\\. + */ |
